engine: the verse facts are the whole scroll, derived from L1
torah_text.pl held 32 hand-written verses from Phase 1 — "the reasoning layer's view of the specification". With the cycle and the Sanhedrin now consulting the engine on every question (2026-10-19), that view showed: any root it knew lit the same handful, and bereishit 1:1 and devarim 6:4 were read in the same eleven verses. - scripts/build_engine_verses.py writes talmudic_engine/src/specification/l1_verses.pl from l1/torah: every verse, each word's shoresh as the engine names it (Hebrew → letter names, finals folded), the consonantal text as gloss, and the SHA-256 of the L1 files read in the header. `--check` exits 1 when the facts lag the scroll; build_and_push.sh runs it beside the Doorpost check. - torah_text.pl includes the generated file; the hand facts are gone. L1's roots are authoritative where the hand facts differed (Israel שרה, the Name הוה). - interpret.pl: over 5,853 verses a common root lights hundreds, so the reading ranks verses by how many of the case's roots each carries and keeps the top 12 in canonical order; the coupling trace names only the verses the reading cites. Local, over the full scroll: bereishit 1:1 → itself, Devarim 4:32, Bereishit 2:4 …; devarim 6:4 → itself, Shemot 3:18, Devarim 4:1 …; shabbat roots → Bereishit 2:3, Shemot 20:8, 20:11, 31:13. interpret 15 ms, challenge 10 ms (now finds a kushya for the Shema), resolve 24 ms. Prolog 7 suites green (middot 2.9 s — pairwise scans over the scroll). 5,853 verses loaded, 49,542 root occurrences. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
1 parent
4e0eb2f983
commit
861cd4e64e
5 files changed
+6023
-91
No files matched your search
@@ -111,16 +111,45 @@ find_relevant_mitzvot_traced(case(_Ref, Domain, Roots, _Question), Mitzvot, Coup
|
||||
find_relevant_verses(case(Ref, Domain, Roots, Question), Verses) :-
|
||||
find_relevant_verses_traced(case(Ref, Domain, Roots, Question), Verses, _).
|
||||
|
||||
%% Traced version: returns verses AND the coupling trace for each
|
||||
%% Traced version: returns verses AND the coupling trace for each.
|
||||
%%
|
||||
%% Over the whole scroll (2026-10-19, l1_verses.pl) a common root lights
|
||||
%% hundreds of verses; a reading that cites them all cites nothing. The
|
||||
%% verses are ranked by how many of the case's roots they carry — a
|
||||
%% verse sharing three roots stands closer to the case than one sharing
|
||||
%% one — and the reading keeps the top ?MAX_VERSES, ties broken by
|
||||
%% canonical order. The coupling trace is kept only for the verses the
|
||||
%% reading cites: a trace names what the reading stands on.
|
||||
max_verses(12).
|
||||
|
||||
find_relevant_verses_traced(case(_Ref, _Domain, Roots, _Question), Verses, Couplings) :-
|
||||
findall(verse_ref(Book, Ch, Vs, Gloss)-coupled(root(Root), verse(Book, Ch, Vs)),
|
||||
( member(Root, Roots),
|
||||
verse(Book, Ch, Vs, VerseRoots, Gloss),
|
||||
sort(Roots, UniqueRoots),
|
||||
findall(Shared-verse_ref(Book, Ch, Vs, Gloss),
|
||||
( verse(Book, Ch, Vs, VerseRoots, Gloss),
|
||||
intersection(UniqueRoots, VerseRoots, SharedRoots),
|
||||
SharedRoots \== [],
|
||||
length(SharedRoots, N),
|
||||
Shared is -N
|
||||
),
|
||||
Scored),
|
||||
%% keysort is stable: equal scores keep the scroll's order
|
||||
keysort(Scored, Ranked),
|
||||
pairs_values(Ranked, RankedVerses),
|
||||
max_verses(Max),
|
||||
take(Max, RankedVerses, Verses),
|
||||
findall(coupled(root(Root), verse(Book, Ch, Vs)),
|
||||
( member(verse_ref(Book, Ch, Vs, _), Verses),
|
||||
verse(Book, Ch, Vs, VerseRoots, _),
|
||||
member(Root, UniqueRoots),
|
||||
member(Root, VerseRoots)
|
||||
),
|
||||
AllPairs),
|
||||
pairs_keys_values(AllPairs, AllVerses, Couplings),
|
||||
sort(AllVerses, Verses).
|
||||
Couplings).
|
||||
|
||||
take(N, List, Prefix) :-
|
||||
length(List, L),
|
||||
( L =< N -> Prefix = List
|
||||
; length(Prefix, N), append(Prefix, _, List)
|
||||
).
|
||||
|
||||
%% ============================================================
|
||||
%% CONSTRUCT INTERPRETATION
|
||||
|
||||
Reference in new issue
Block a user