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
|
||||
|
||||
File diff suppressed because it is too large.
Load diff
@@ -16,93 +16,19 @@
|
||||
]).
|
||||
|
||||
%% ============================================================
|
||||
%% BEREISHIT — Creation narratives
|
||||
%% THE SCROLL — every verse of L1, generated (2026-10-19)
|
||||
%% ============================================================
|
||||
%%
|
||||
%% The 32 hand-written verses that stood here from Phase 1 are gone:
|
||||
%% with them, any root the engine knew lit the same handful and every
|
||||
%% reading cited the same list. l1_verses.pl is written by
|
||||
%% scripts/build_engine_verses.py from l1/torah — 5,853 verses, each
|
||||
%% word's shoresh as the engine names it, the consonantal text as the
|
||||
%% gloss — and carries the SHA-256 of the L1 it read. Check it against
|
||||
%% the scroll with `scripts/build_engine_verses.py --check`.
|
||||
|
||||
verse(bereishit, 1, 1, [bet_resh_aleph, bet_resh_aleph, aleph_lamed_he],
|
||||
'In the beginning God created the heavens and the earth').
|
||||
verse(bereishit, 1, 3, [aleph_mem_resh, aleph_lamed_he, he_yod_he, aleph_vav_resh],
|
||||
'And God said let there be light and there was light').
|
||||
verse(bereishit, 1, 4, [resh_aleph_he, aleph_lamed_he, aleph_vav_resh, tet_vav_bet, bet_dalet_lamed],
|
||||
'And God saw that the light was good and God separated').
|
||||
verse(bereishit, 1, 27, [bet_resh_aleph, aleph_lamed_he, aleph_dalet_mem, tzade_lamed_mem, bet_resh_aleph],
|
||||
'And God created man in His image in the image of God He created him').
|
||||
verse(bereishit, 2, 2, [kaf_lamed_he, aleph_lamed_he, yod_vav_mem, shin_bet_tav, mem_lamed_aleph_kaf_he],
|
||||
'And on the seventh day God completed His work and He rested').
|
||||
verse(bereishit, 2, 3, [bet_resh_kaf, aleph_lamed_he, yod_vav_mem, shin_bet_tav, qof_dalet_shin],
|
||||
'And God blessed the seventh day and sanctified it').
|
||||
verse(bereishit, 9, 6, [shin_pe_kaf, dalet_mem, aleph_dalet_mem, tzade_lamed_mem, aleph_lamed_he],
|
||||
'Whoever sheds the blood of man by man shall his blood be shed for in the image of God He made man').
|
||||
:- include('l1_verses.pl').
|
||||
|
||||
%% ============================================================
|
||||
%% SHEMOT — The ten dibrot and the covenant
|
||||
%% ============================================================
|
||||
|
||||
verse(shemot, 3, 14, [aleph_he_yod_he, aleph_mem_resh, aleph_he_yod_he],
|
||||
'I am that I am').
|
||||
verse(shemot, 20, 2, [aleph_nun_kaf_yod, he_shin_mem, aleph_lamed_he],
|
||||
'I am the LORD your God who brought you out of the land of Egypt').
|
||||
verse(shemot, 20, 3, [he_yod_he, aleph_lamed_he, aleph_chet_resh],
|
||||
'You shall have no other gods before Me').
|
||||
verse(shemot, 20, 8, [zayin_kaf_resh, yod_vav_mem, shin_bet_tav, qof_dalet_shin],
|
||||
'Remember the Sabbath day to sanctify it').
|
||||
verse(shemot, 20, 13, [resh_tzade_chet],
|
||||
'You shall not murder').
|
||||
verse(shemot, 20, 14, [nun_aleph_pe],
|
||||
'You shall not commit adultery').
|
||||
verse(shemot, 20, 15, [gimel_nun_bet],
|
||||
'You shall not steal').
|
||||
verse(shemot, 20, 16, [ayin_nun_he, shin_qof_resh, ayin_dalet],
|
||||
'You shall not bear false witness against your neighbor').
|
||||
verse(shemot, 20, 17, [chet_mem_dalet],
|
||||
'You shall not covet').
|
||||
|
||||
%% ============================================================
|
||||
%% VAYIKRA — Holiness and offerings
|
||||
%% ============================================================
|
||||
|
||||
verse(vayikra, 1, 3, [qof_resh_bet, ayin_lamed_he, tav_mem_yod_mem],
|
||||
'If his offering is a burnt offering let him offer a male without blemish').
|
||||
verse(vayikra, 4, 27, [chet_tet_aleph, nun_pe_shin, shin_gimel_gimel_he],
|
||||
'If anyone of the common people sins unintentionally').
|
||||
verse(vayikra, 19, 2, [qof_dalet_shin, he_yod_he, qof_dalet_shin],
|
||||
'Be holy for I the LORD your God am holy').
|
||||
verse(vayikra, 19, 15, [ayin_shin_he, mem_shin_pe_tet, tzade_dalet_qof],
|
||||
'In righteousness shall you judge your neighbor').
|
||||
verse(vayikra, 19, 18, [aleph_he_bet, resh_ayin, kaf_mem_vav],
|
||||
'You shall love your neighbor as yourself').
|
||||
|
||||
%% ============================================================
|
||||
%% BAMIDBAR — The camp and the cloud
|
||||
%% ============================================================
|
||||
|
||||
verse(bamidbar, 9, 23, [pe_he, he_shin_mem, chet_nun_he, pe_he, he_shin_mem, nun_samekh_ayin],
|
||||
'At the mouth of the LORD they camped and at the mouth of the LORD they journeyed').
|
||||
verse(bamidbar, 10, 2, [ayin_shin_he, shin_nun_yod, chet_tzade_tzade_resh_he, kaf_samekh_pe],
|
||||
'Make two silver trumpets for the calling of the assembly').
|
||||
verse(bamidbar, 35, 11, [mem_qof_lamed_tet, ayin_yod_resh, nun_pe_shin, resh_tzade_chet, shin_gimel_gimel_he],
|
||||
'You shall designate cities of refuge for one who kills a person unintentionally').
|
||||
|
||||
%% ============================================================
|
||||
%% DEVARIM — Moses' final instruction
|
||||
%% ============================================================
|
||||
|
||||
verse(devarim, 6, 4, [shin_mem_ayin, yod_shin_resh_aleph_lamed, he_shin_mem, aleph_lamed_he, he_shin_mem, aleph_chet_dalet],
|
||||
'Hear O Israel the LORD our God the LORD is one').
|
||||
verse(devarim, 6, 5, [aleph_he_bet, he_shin_mem, aleph_lamed_he, kaf_lamed, lamed_bet_bet],
|
||||
'And you shall love the LORD your God with all your heart').
|
||||
verse(devarim, 16, 18, [shin_pe_tet, shin_tet_resh, nun_tav_nun, shin_ayin_resh],
|
||||
'Judges and officers shall you appoint in all your gates').
|
||||
verse(devarim, 16, 20, [tzade_dalet_qof, tzade_dalet_qof, resh_dalet_pe],
|
||||
'Justice justice shall you pursue').
|
||||
verse(devarim, 21, 1, [nun_pe_lamed, chet_lamed_lamed, shin_dalet_he, yod_dalet_ayin],
|
||||
'If a slain person is found in the field and it is not known who struck him').
|
||||
verse(devarim, 25, 12, [nun_tzade_lamed, resh_dalet_pe],
|
||||
'You shall save the pursued from the pursuer').
|
||||
verse(devarim, 26, 2, [lamed_qof_chet, resh_aleph_shin_yod_tav, pe_resh_yod, aleph_dalet_mem_he],
|
||||
'You shall take of the first of all the fruit of the ground').
|
||||
verse(devarim, 26, 5, [aleph_resh_mem_yod, aleph_bet_dalet, aleph_bet_yod],
|
||||
'A wandering Aramean was my father').
|
||||
|
||||
%% ============================================================
|
||||
%% QUERIES
|
||||
|
||||
Reference in new issue
Block a user