Files
shorashim-readings/mishpatim/mishpatim_human.pl
T
Scott KarpandClaude Opus 4.6 cde364ca44 Initial commit: readings extracted from shorashim
Three readings of Torah as AI specification:

- mishpatim/ — the ordinances. 53 mitzvot encoded in two parallel
  Prolog readings (human + AI). AI governance law as the Torah
  already wrote it. Plus README summarizing key readings.
- maaseh_merkavah/ — the chariot as AI architecture. Why the
  mishkan specification is shaped as chapter headings.
- moreh_nevuchim/ — Maimonides as the manual for reading Torah
  as AI specification. The perplexity resolves.

These essays and encodings lived in the shorashim repo under
readings/ until commit 04713cc. They are not spec, not
implementation — they are the book that argues for the spec.
Separated so each can grow without dragging the other.

The mishkan is in the companion repo, shorashim.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-21 10:59:23 -04:00

1091 lines
42 KiB
Prolog

%% ============================================================================
%% MISHPATIM — שמות כ״א:א׳ - כ״ד:י״ח
%% V'eileh hamishpatim asher tasim lifneihem.
%% And these are the ordinances that you shall set before them.
%%
%% Rashi: "V'eileh" — the vav connects. Just as the former were from Sinai,
%% so these are from Sinai. The mishpatim are not lesser commandments.
%% They are the same revelation, continued.
%%
%% This file reads Torah as specification and encodes each mitzvah in Prolog.
%% The source is the text. The text is L1. The encoding is the builder's work.
%% Ka'asher tzivah.
%% ============================================================================
:- module(mishpatim, [
mitzvah/4, % mitzvah(Id, Type, Source, Description)
applies/3, % applies(MitzvahId, Subject, Condition)
obligation/3, % obligation(MitzvahId, Action, Object)
prohibition/3, % prohibition(MitzvahId, Action, Object)
consequence/3, % consequence(MitzvahId, Violation, Result)
condition/3, % condition(MitzvahId, If, Then)
temporal/2, % temporal(MitzvahId, TimeConstraint)
damages/4, % damages(MitzvahId, Cause, Harm, Restitution)
shoresh/2 % shoresh(MitzvahId, Root) — the three-letter root
]).
%% ============================================================================
%% TYPE SYSTEM
%% Torah distinguishes: aseh (positive command), lo ta'aseh (prohibition),
%% mishpat (ordinance/case law with conditions)
%% ============================================================================
mitzvah_type(aseh). % Do this
mitzvah_type(lo_taaseh). % Do not do this
mitzvah_type(mishpat). % When X, then Y — case law
%% ============================================================================
%% SHEMOT 21:2-6 — EVED IVRI (Hebrew Servant)
%% Ki tikneh eved ivri shesh shanim ya'avod
%% uvasheviit yetzei lachofshi chinam.
%% ============================================================================
mitzvah(eved_ivri_release, mishpat,
'Shemot 21:2',
'When you acquire a Hebrew servant, six years he serves,
in the seventh he goes free, without payment').
condition(eved_ivri_release,
acquired(Person, eved_ivri),
release_year(Person, 7)).
condition(eved_ivri_release,
entered_status(Person, eved_ivri, alone),
exits(Person, alone)).
condition(eved_ivri_release,
entered_status(Person, eved_ivri, with_wife),
exits(Person, with_wife)).
% 21:4 — If the master gives him a wife
condition(eved_ivri_release,
(master_gave_wife(Person, Wife), children(Wife, Children)),
(wife_and_children_remain(Wife, Children, master), exits(Person, alone))).
% 21:5-6 — If the servant says "I love my master"
mitzvah(eved_ivri_retziah, mishpat,
'Shemot 21:5-6',
'If the servant says: I love my master, my wife, my children,
I will not go free — bring him to the door, pierce his ear
with an awl, and he serves until the yovel').
condition(eved_ivri_retziah,
(declares_love(Servant, master), declares_love(Servant, wife),
declares_love(Servant, children), refuses_freedom(Servant)),
(pierce_ear(Servant, doorpost), serves_until(Servant, yovel))).
shoresh(eved_ivri_release, resh_tzadi_ayin). % רצע — pierce
shoresh(eved_ivri_release, ayin_bet_dalet). % עבד — serve
%% ============================================================================
%% SHEMOT 21:7-11 — AMAH IVRIYAH (Hebrew Maidservant)
%% V'chi yimkor ish et bito l'amah lo tetzei k'tzet ha'avadim.
%% ============================================================================
mitzvah(amah_ivriyah, mishpat,
'Shemot 21:7',
'If a man sells his daughter as a maidservant, she does not go out
as the menservants go out').
% 21:8 — If she is displeasing to her master who designated her for himself
condition(amah_ivriyah,
(designated_for(Master, Amah, self), displeasing(Master, Amah)),
(allow_redemption(Amah), prohibition(sell_to_foreign_nation, Amah))).
% 21:9 — If he designates her for his son
condition(amah_ivriyah,
designated_for(Master, Amah, son),
treat_as(Amah, daughter)).
% 21:10 — If he takes another wife
mitzvah(amah_three_rights, mishpat,
'Shemot 21:10',
'Her food, her clothing, and her conjugal rights he shall not diminish').
obligation(amah_three_rights, provide, food).
obligation(amah_three_rights, provide, clothing).
obligation(amah_three_rights, provide, conjugal_rights).
% 21:11 — If he does not provide these three
condition(amah_three_rights,
fails_three(Master, Amah, [food, clothing, conjugal_rights]),
goes_free(Amah, without_payment)).
%% ============================================================================
%% SHEMOT 21:12-14 — MURDER AND MANSLAUGHTER
%% Makeh ish vamet mot yumat.
%% ============================================================================
mitzvah(murder_death_penalty, mishpat,
'Shemot 21:12',
'One who strikes a person and he dies shall surely be put to death').
consequence(murder_death_penalty,
(strikes(Person, Victim), dies(Victim)),
death_penalty(Person)).
% 21:13 — Unintentional killing
mitzvah(manslaughter_refuge, mishpat,
'Shemot 21:13',
'One who did not lie in wait, but God brought it to his hand —
I will appoint for you a place to which he shall flee').
condition(manslaughter_refuge,
(kills(Person, Victim), \+ premeditated(Person, Victim),
god_caused(Person, Victim)),
flee_to(Person, place_of_refuge)).
% 21:14 — Premeditated murder
mitzvah(premeditated_murder, mishpat,
'Shemot 21:14',
'If a man schemes against his neighbor to kill him with cunning,
from My altar you shall take him to die').
condition(premeditated_murder,
(schemes(Person, Victim), kills_with_cunning(Person, Victim)),
(no_sanctuary(Person, altar), death_penalty(Person))).
%% ============================================================================
%% SHEMOT 21:15 — STRIKING A PARENT
%% Umakeh aviv v'imo mot yumat.
%% ============================================================================
mitzvah(striking_parent, lo_taaseh,
'Shemot 21:15',
'One who strikes his father or his mother shall surely be put to death').
prohibition(striking_parent, strike, parent).
consequence(striking_parent, strikes(Person, parent_of(Person)), death_penalty(Person)).
%% ============================================================================
%% SHEMOT 21:16 — KIDNAPPING
%% V'gonev ish umecharo v'nimtza v'yado mot yumat.
%% ============================================================================
mitzvah(kidnapping, lo_taaseh,
'Shemot 21:16',
'One who steals a person and sells him, and he is found in his hand,
shall surely be put to death').
prohibition(kidnapping, steal, person).
consequence(kidnapping,
(steals(Person, Victim), sells(Person, Victim)),
death_penalty(Person)).
%% ============================================================================
%% SHEMOT 21:17 — CURSING A PARENT
%% Umkalel aviv v'imo mot yumat.
%% ============================================================================
mitzvah(cursing_parent, lo_taaseh,
'Shemot 21:17',
'One who curses his father or his mother shall surely be put to death').
prohibition(cursing_parent, curse, parent).
shoresh(cursing_parent, qof_lamed_lamed). % קלל — to curse/belittle
%% ============================================================================
%% SHEMOT 21:18-19 — INJURY IN A QUARREL
%% V'chi y'rivun anashim v'hikah ish et re'ehu b'even o v'egrof
%% ============================================================================
mitzvah(injury_quarrel, mishpat,
'Shemot 21:18-19',
'When men quarrel and one strikes the other with a stone or fist,
and he does not die but takes to his bed — if he rises and walks
outside on his support, the striker is clear; only he shall pay
for his lost time and shall provide for his healing').
damages(injury_quarrel,
(quarrel(A, B), strikes(A, B, Instrument),
\+ dies(B), bedridden(B)),
(lost_time(B), needs_healing(B)),
(pay_lost_time(A, B), pay_healing(A, B))).
condition(injury_quarrel,
(recovers(B), walks_with_support(B)),
cleared_of_death_penalty(A)).
%% ============================================================================
%% SHEMOT 21:20-21 — STRIKING A SERVANT
%% V'chi yakeh ish et avdo o et amato bashavet umet tachat yado
%% nakom yinakem.
%% ============================================================================
mitzvah(striking_servant, mishpat,
'Shemot 21:20-21',
'If a man strikes his servant or maidservant with a rod and they die
under his hand, he shall surely be avenged. But if he survives a day
or two, he shall not be avenged, for he is his property').
condition(striking_servant,
(strikes(Master, Servant, rod), dies_immediately(Servant)),
avenged(Master)).
condition(striking_servant,
(strikes(Master, Servant, rod), survives_days(Servant, N), N >= 1),
not_avenged(Master)).
%% ============================================================================
%% SHEMOT 21:22-25 — INJURY TO A PREGNANT WOMAN / LEX TALIONIS
%% V'chi yinatzu anashim v'nagfu ishah harah
%% ============================================================================
mitzvah(injury_pregnant, mishpat,
'Shemot 21:22',
'When men fight and strike a pregnant woman and her children depart,
but there is no fatality — he shall be fined as the woman''s husband
demands, and he shall pay by judges'' assessment').
damages(injury_pregnant,
(fighting(Men), strikes(_, Woman), pregnant(Woman),
miscarriage(Woman), \+ fatal(Woman)),
loss_of_child(Woman),
fine(Striker, as_husband_demands, assessed_by_judges)).
% 21:23-25 — Lex talionis
mitzvah(lex_talionis, mishpat,
'Shemot 21:23-25',
'If there is a fatality: life for life, eye for eye, tooth for tooth,
hand for hand, foot for foot, burn for burn, wound for wound,
bruise for bruise').
damages(lex_talionis, fatal_injury, death, life_for_life).
damages(lex_talionis, eye_injury, loss_of_eye, eye_for_eye).
damages(lex_talionis, tooth_injury, loss_of_tooth, tooth_for_tooth).
damages(lex_talionis, hand_injury, loss_of_hand, hand_for_hand).
damages(lex_talionis, foot_injury, loss_of_foot, foot_for_foot).
damages(lex_talionis, burn_injury, burn, burn_for_burn).
damages(lex_talionis, wound_injury, wound, wound_for_wound).
damages(lex_talionis, bruise_injury, bruise, bruise_for_bruise).
%% ============================================================================
%% SHEMOT 21:26-27 — SERVANT'S EYE OR TOOTH
%% V'chi yakeh ish et ein avdo o et ein amato v'shichatah
%% lachofshi y'shalchenu tachat eino.
%% ============================================================================
mitzvah(servant_eye_tooth, mishpat,
'Shemot 21:26-27',
'If a man strikes the eye of his servant or maidservant and destroys it,
he shall send him free for his eye. If he knocks out the tooth of his
servant or maidservant, he shall send him free for his tooth').
condition(servant_eye_tooth,
(strikes(Master, Servant), destroys(Master, eye_of(Servant))),
goes_free(Servant)).
condition(servant_eye_tooth,
(strikes(Master, Servant), knocks_out(Master, tooth_of(Servant))),
goes_free(Servant)).
%% ============================================================================
%% SHEMOT 21:28-32 — THE GORING OX
%% V'chi yigach shor et ish o et ishah vamet
%% ============================================================================
mitzvah(goring_ox_first, mishpat,
'Shemot 21:28',
'If an ox gores a man or woman and they die, the ox shall be stoned
and its flesh shall not be eaten, and the owner is clear').
condition(goring_ox_first,
(gores(Ox, Person), dies(Person), \+ warned_before(Owner, Ox)),
(stone(Ox), do_not_eat(Ox), owner_clear(Owner))).
% 21:29 — Warned ox (mu'ad)
mitzvah(goring_ox_muad, mishpat,
'Shemot 21:29',
'If the ox was a gorer from yesterday and the day before, and its owner
was warned but did not guard it, and it kills a man or woman —
the ox shall be stoned and also its owner shall die').
condition(goring_ox_muad,
(gores(Ox, Person), dies(Person),
warned_before(Owner, Ox), \+ guarded(Owner, Ox)),
(stone(Ox), death_penalty(Owner))).
% 21:30 — Ransom
condition(goring_ox_muad,
ransom_imposed(Owner),
pay_ransom(Owner, as_imposed)).
% 21:31 — Whether it gores a son or daughter
condition(goring_ox_muad,
(gores(Ox, Child), is_minor(Child)),
same_law_applies).
% 21:32 — Gores a servant
mitzvah(goring_ox_servant, mishpat,
'Shemot 21:32',
'If the ox gores a servant or maidservant, thirty shekels of silver
shall be given to the master, and the ox shall be stoned').
damages(goring_ox_servant,
(gores(Ox, Servant), dies(Servant)),
death_of_servant,
(pay_thirty_shekels(Owner, master_of(Servant)), stone(Ox))).
%% ============================================================================
%% SHEMOT 21:33-34 — THE OPEN PIT
%% V'chi yiftach ish bor o chi yichreh ish bor v'lo y'chasenu
%% ============================================================================
mitzvah(open_pit, mishpat,
'Shemot 21:33-34',
'If a man opens a pit, or digs a pit and does not cover it,
and an ox or donkey falls into it — the owner of the pit shall pay,
he shall return money to its owner, and the dead animal is his').
damages(open_pit,
(opens_pit(Person), \+ covers(Person, pit),
falls_in(Animal, pit), dies(Animal)),
death_of_animal,
(pay_value(Person, owner_of(Animal)), dead_animal_to(Person))).
%% ============================================================================
%% SHEMOT 21:35-36 — OX GORES OX
%% V'chi yigof shor ish et shor re'ehu vamet
%% ============================================================================
mitzvah(ox_gores_ox, mishpat,
'Shemot 21:35-36',
'If a man''s ox strikes another''s ox and it dies — they sell the living
ox and divide its price and also the dead they divide. Or if it was
known that the ox was a gorer from before and its owner did not guard
it — he shall pay ox for ox and the dead is his').
% Tam (innocent) ox
damages(ox_gores_ox,
(gores(Ox1, Ox2), dies(Ox2), \+ muad(Ox1)),
death_of_ox,
(sell_living(Ox1), divide_price, divide_dead(Ox2))).
% Mu'ad (warned) ox
damages(ox_gores_ox,
(gores(Ox1, Ox2), dies(Ox2), muad(Ox1), \+ guarded(Owner, Ox1)),
death_of_ox,
(pay_full_ox(Owner, owner_of(Ox2)), dead_to(Ox2, Owner))).
%% ============================================================================
%% SHEMOT 21:37 / 22:1-3 — THEFT
%% Ki yignov ish shor o seh utvacho o mecharo
%% ============================================================================
mitzvah(theft_restitution, mishpat,
'Shemot 21:37',
'If a man steals an ox or sheep and slaughters or sells it —
five cattle for the ox, four sheep for the sheep').
damages(theft_restitution,
(steals(Thief, ox), (slaughters(Thief, ox) ; sells(Thief, ox))),
loss_of_ox,
pay_fivefold(Thief)).
damages(theft_restitution,
(steals(Thief, sheep), (slaughters(Thief, sheep) ; sells(Thief, sheep))),
loss_of_sheep,
pay_fourfold(Thief)).
% 22:1 — Tunneling thief
mitzvah(tunneling_thief, mishpat,
'Shemot 22:1-2',
'If the thief is found tunneling and is struck and dies,
there is no blood-guilt for him. If the sun has risen upon him,
there is blood-guilt for him').
condition(tunneling_thief,
(thief_tunneling(Thief), struck(Thief), dies(Thief), nighttime),
no_blood_guilt).
condition(tunneling_thief,
(thief_tunneling(Thief), struck(Thief), dies(Thief), sun_risen),
blood_guilt).
% 22:2 — Thief's restitution
condition(theft_restitution,
(thief_caught(Thief), has_means(Thief)),
pay_double(Thief)).
condition(theft_restitution,
(thief_caught(Thief), \+ has_means(Thief)),
sold_for_theft(Thief)).
% 22:3 — Animal found alive
condition(theft_restitution,
(stolen(Animal), found_alive(Animal, in_hand(Thief))),
pay_double(Thief)).
%% ============================================================================
%% SHEMOT 22:4 — GRAZING DAMAGE (MAV'EH)
%% Ki yav'er ish sadeh o kerem v'shilach et b'iro
%% ============================================================================
mitzvah(grazing_damage, mishpat,
'Shemot 22:4',
'If a man causes a field or vineyard to be grazed, and sends his animal
and it grazes in another''s field — the best of his field and the best
of his vineyard he shall pay').
damages(grazing_damage,
(sends_animal(Owner, Animal), grazes(Animal, field_of(Other))),
crop_loss(Other),
pay_from_best(Owner, [field, vineyard])).
%% ============================================================================
%% SHEMOT 22:5 — FIRE DAMAGE
%% Ki tetzei esh umatz'ah kotzim v'ne'echal gadish
%% ============================================================================
mitzvah(fire_damage, mishpat,
'Shemot 22:5',
'If fire goes out and finds thorns and a stack of grain or standing
grain or the field is consumed — the one who kindled the fire
shall surely pay').
damages(fire_damage,
(kindles_fire(Person), spreads(fire),
consumes(fire, Property)),
loss_of(Property),
shall_pay(Person)).
shoresh(fire_damage, bet_ayin_resh). % בער — to burn
%% ============================================================================
%% SHEMOT 22:6-8 — GUARDIAN (SHOMER CHINAM)
%% Ki yiten ish el re'ehu kesef o kelim lishmor
%% ============================================================================
mitzvah(shomer_chinam, mishpat,
'Shemot 22:6-8',
'If a man gives his neighbor money or vessels to guard, and it is stolen
from the man''s house — if the thief is found, he pays double.
If the thief is not found, the owner of the house approaches the
judges to determine whether he laid his hand on his neighbor''s property').
condition(shomer_chinam,
(deposits(Owner, Property, Guardian), stolen(Property), thief_found(Thief)),
pay_double(Thief)).
condition(shomer_chinam,
(deposits(Owner, Property, Guardian), stolen(Property), \+ thief_found(_)),
approach_judges(Guardian)).
% 22:8 — General disputes over property
mitzvah(property_dispute, mishpat,
'Shemot 22:8',
'For every matter of trespass — for ox, donkey, sheep, garment, any lost
thing about which one says "this is it" — the case of both comes
before the judges. Whom the judges condemn shall pay double').
condition(property_dispute,
(claims(A, Property), claims(B, Property)),
(judges_decide(A, B, Property), condemned_pays_double)).
%% ============================================================================
%% SHEMOT 22:9-12 — GUARDIAN OF ANIMALS (SHOMER SACHAR)
%% Ki yiten ish el re'ehu chamor o shor o seh v'chol behemah lishmor
%% ============================================================================
mitzvah(shomer_sachar, mishpat,
'Shemot 22:9-12',
'If a man gives his neighbor a donkey, ox, sheep, or any animal to guard,
and it dies, is broken, or is driven away, and no one sees —
an oath of the Lord between them both, that he did not lay his hand
on his neighbor''s property').
condition(shomer_sachar,
(deposits(Owner, Animal, Guardian),
(dies(Animal) ; injured(Animal) ; driven_away(Animal)),
no_witnesses),
oath_of_lord(Guardian, did_not_take(Animal))).
condition(shomer_sachar,
(oath_taken(Guardian), accepts(Owner, oath)),
guardian_clear(Guardian)).
% 22:11 — If stolen from the guardian
condition(shomer_sachar,
(deposits(Owner, Animal, Guardian), stolen(Animal, from(Guardian))),
pay_owner(Guardian, Owner)).
% 22:12 — If torn by a beast
condition(shomer_sachar,
(deposits(Owner, Animal, Guardian), torn_by_beast(Animal)),
(bring_evidence(Guardian, torn_remains), guardian_clear(Guardian))).
%% ============================================================================
%% SHEMOT 22:13-14 — BORROWER (SHO'EL)
%% V'chi yish'al ish me'im re'ehu
%% ============================================================================
mitzvah(shoel, mishpat,
'Shemot 22:13-14',
'If a man borrows from his neighbor and it is broken or dies,
its owner not being with it — he shall surely pay.
If its owner is with it, he shall not pay.
If it is hired, it came for its hire').
condition(shoel,
(borrows(Borrower, Animal, Owner),
(injured(Animal) ; dies(Animal)),
\+ owner_present(Owner)),
shall_pay(Borrower)).
condition(shoel,
(borrows(Borrower, Animal, Owner),
(injured(Animal) ; dies(Animal)),
owner_present(Owner)),
borrower_clear(Borrower)).
%% ============================================================================
%% SHEMOT 22:15-16 — SEDUCTION OF A VIRGIN
%% V'chi y'fateh ish betulah asher lo orasah
%% ============================================================================
mitzvah(seduction_virgin, mishpat,
'Shemot 22:15-16',
'If a man seduces a virgin who is not betrothed, he shall pay the bride
price and take her as wife. If her father refuses to give her,
he shall weigh out silver according to the bride price of virgins').
condition(seduction_virgin,
(seduces(Man, Virgin), \+ betrothed(Virgin)),
(pay_bride_price(Man), marry(Man, Virgin))).
condition(seduction_virgin,
(seduces(Man, Virgin), refuses(father_of(Virgin))),
pay_bride_price_silver(Man)).
%% ============================================================================
%% SHEMOT 22:17 — SORCERY
%% M'chashefah lo t'chayeh.
%% ============================================================================
mitzvah(sorcery, lo_taaseh,
'Shemot 22:17',
'You shall not allow a sorceress to live').
prohibition(sorcery, allow_to_live, sorceress).
%% ============================================================================
%% SHEMOT 22:18 — BESTIALITY
%% Kol shochev im behemah mot yumat.
%% ============================================================================
mitzvah(bestiality, lo_taaseh,
'Shemot 22:18',
'Whoever lies with an animal shall surely be put to death').
prohibition(bestiality, lie_with, animal).
consequence(bestiality, lies_with_animal(Person), death_penalty(Person)).
%% ============================================================================
%% SHEMOT 22:19 — IDOLATRY
%% Zoveach la'elohim yochoram bilti laHashem l'vado.
%% ============================================================================
mitzvah(sacrifice_to_gods, lo_taaseh,
'Shemot 22:19',
'One who sacrifices to gods shall be destroyed —
except to the Lord alone').
prohibition(sacrifice_to_gods, sacrifice_to, other_gods).
consequence(sacrifice_to_gods,
sacrifices_to(Person, God), God \= hashem,
cherem(Person)).
shoresh(sacrifice_to_gods, chet_resh_mem). % חרם — utter destruction
%% ============================================================================
%% SHEMOT 22:20 — THE STRANGER
%% V'ger lo toneh v'lo tilchatzenu ki gerim heyitem b'eretz mitzrayim.
%% ============================================================================
mitzvah(stranger_no_wrong, lo_taaseh,
'Shemot 22:20',
'A stranger you shall not wrong and you shall not oppress him,
for you were strangers in the land of Egypt').
prohibition(stranger_no_wrong, wrong, ger).
prohibition(stranger_no_wrong, oppress, ger).
% The reason is encoded in the law itself — ki gerim heyitem
applies(stranger_no_wrong, Subject,
was_stranger_in(Subject, egypt)).
%% ============================================================================
%% SHEMOT 22:21-23 — WIDOW AND ORPHAN
%% Kol almanah v'yatom lo t'anun.
%% ============================================================================
mitzvah(widow_orphan, lo_taaseh,
'Shemot 22:21',
'Any widow or orphan you shall not afflict').
prohibition(widow_orphan, afflict, widow).
prohibition(widow_orphan, afflict, orphan).
% 22:22-23 — The consequence is not from a court
mitzvah(widow_orphan_consequence, mishpat,
'Shemot 22:22-23',
'If you afflict them, when they cry out to Me I will hear their cry.
My anger will burn and I will kill you with the sword,
and your wives will be widows and your children orphans').
consequence(widow_orphan_consequence,
(afflicts(Person, Vulnerable), cries_out(Vulnerable, hashem)),
(anger(hashem), sword(Person),
becomes(wife_of(Person), widow),
becomes(children_of(Person), orphan))).
%% ============================================================================
%% SHEMOT 22:24 — LENDING TO THE POOR
%% Im kesef talveh et ami et he'ani imach
%% lo tihyeh lo k'nosheh lo tasimun alav neshech.
%% ============================================================================
mitzvah(lending_poor_no_interest, lo_taaseh,
'Shemot 22:24',
'If you lend money to My people, to the poor among you,
you shall not be to him as a creditor,
you shall not place upon him interest').
prohibition(lending_poor_no_interest, act_as_creditor, poor_person).
prohibition(lending_poor_no_interest, charge_interest, poor_person).
shoresh(lending_poor_no_interest, nun_shin_kaf). % נשך — interest (lit. bite)
%% ============================================================================
%% SHEMOT 22:25-26 — THE GARMENT PLEDGE
%% Im chavol tachbol salmat re'echa ad bo hashemesh t'shivenu lo.
%% ============================================================================
mitzvah(garment_pledge, mishpat,
'Shemot 22:25-26',
'If you take as pledge your neighbor''s garment, you shall return it
to him by sunset. For it is his only covering, it is his garment
for his skin — in what shall he sleep? And it will be, when he
cries out to Me, I will hear, for I am gracious').
obligation(garment_pledge, return_by_sunset, pledged_garment).
temporal(garment_pledge, before_sunset).
% The reason: ki hi ch'suto l'vadah — it is his only covering
% The consequence: v'hayah ki yitz'ak elai v'shamati ki chanun ani
% — when he cries I will hear, for I am gracious
%% ============================================================================
%% SHEMOT 22:27 — DO NOT CURSE GOD OR A RULER
%% Elohim lo t'kalel v'nasi v'amcha lo ta'or.
%% ============================================================================
mitzvah(no_curse_god, lo_taaseh,
'Shemot 22:27',
'God you shall not curse').
prohibition(no_curse_god, curse, elohim).
mitzvah(no_curse_ruler, lo_taaseh,
'Shemot 22:27',
'A ruler among your people you shall not curse').
prohibition(no_curse_ruler, curse, nasi).
%% ============================================================================
%% SHEMOT 22:28 — FIRST OF THE HARVEST AND FIRSTBORN
%% Mel'at'cha v'dim'acha lo t'acher b'chor banecha titen li.
%% ============================================================================
mitzvah(firstfruits_timing, aseh,
'Shemot 22:28',
'Your fullness and your flow you shall not delay.
The firstborn of your sons you shall give to Me').
obligation(firstfruits_timing, do_not_delay, [fullness, flow]).
obligation(firstfruits_timing, give, firstborn_son).
%% ============================================================================
%% SHEMOT 22:29 — FIRSTBORN ANIMALS
%% Ken ta'aseh l'shorcha l'tzonecha shiv'at yamim yihyeh im imo
%% bayom hashmini titno li.
%% ============================================================================
mitzvah(firstborn_animal, aseh,
'Shemot 22:29',
'So shall you do with your ox and your flock: seven days it shall be
with its mother, on the eighth day you shall give it to Me').
obligation(firstborn_animal, give_on_eighth_day, firstborn).
temporal(firstborn_animal, seven_days_with_mother_then_eighth).
%% ============================================================================
%% SHEMOT 22:30 — TREIFAH
%% V'anshei kodesh tihyun li u'vasar basadeh treifah lo tochelu
%% lakelev tashlichun oto.
%% ============================================================================
mitzvah(treifah, lo_taaseh,
'Shemot 22:30',
'People of holiness you shall be to Me. Flesh in the field that is torn
you shall not eat; to the dog you shall cast it').
prohibition(treifah, eat, torn_flesh).
obligation(treifah, cast_to_dog, torn_flesh).
%% ============================================================================
%% SHEMOT 23:1 — FALSE REPORT
%% Lo tisa shema shav al tashet yadcha im rasha lihyot ed chamas.
%% ============================================================================
mitzvah(false_report, lo_taaseh,
'Shemot 23:1',
'You shall not raise a false report. Do not join your hand with a
wicked person to be a witness of violence').
prohibition(false_report, raise, false_report).
prohibition(false_report, join_hand_with, wicked_witness).
%% ============================================================================
%% SHEMOT 23:2 — DO NOT FOLLOW THE MAJORITY TO DO EVIL
%% Lo tihyeh acharei rabim l'ra'ot
%% v'lo ta'aneh al riv lintot acharei rabim l'hatot.
%% ============================================================================
mitzvah(majority_evil, lo_taaseh,
'Shemot 23:2',
'You shall not follow the majority to do evil.
You shall not respond in a dispute to lean after the majority
to pervert justice').
prohibition(majority_evil, follow_majority, to_do_evil).
prohibition(majority_evil, lean_after_majority, to_pervert_justice).
%% ============================================================================
%% SHEMOT 23:3 — DO NOT FAVOR THE POOR IN JUDGMENT
%% V'dal lo tehdar b'rivo.
%% ============================================================================
mitzvah(no_favor_poor, lo_taaseh,
'Shemot 23:3',
'A poor person you shall not favor in his dispute').
prohibition(no_favor_poor, favor_in_judgment, poor_person).
%% ============================================================================
%% SHEMOT 23:4-5 — ENEMY'S ANIMAL
%% Ki tifga shor oyvcha o chamoro to'eh hashev t'shivenu lo.
%% Ki tir'eh chamor son'acha rovetz tachat masa'o...azov ta'azov imo.
%% ============================================================================
mitzvah(enemy_animal_return, aseh,
'Shemot 23:4',
'When you encounter your enemy''s ox or donkey going astray,
you shall surely return it to him').
obligation(enemy_animal_return, return, enemy_lost_animal).
mitzvah(enemy_animal_burden, aseh,
'Shemot 23:5',
'When you see the donkey of one who hates you crouching under its burden,
you shall refrain from leaving it to him — you shall surely
release it with him').
obligation(enemy_animal_burden, help_unload, enemy_burdened_animal).
%% ============================================================================
%% SHEMOT 23:6 — DO NOT PERVERT JUSTICE FOR THE POOR
%% Lo tateh mishpat evyoncha b'rivo.
%% ============================================================================
mitzvah(no_pervert_poor, lo_taaseh,
'Shemot 23:6',
'You shall not pervert the justice of your destitute in his dispute').
prohibition(no_pervert_poor, pervert_justice, destitute_person).
%% ============================================================================
%% SHEMOT 23:7 — DISTANCE FROM FALSEHOOD / INNOCENT AND RIGHTEOUS
%% Midvar sheker tirchak v'naki v'tzadik al taharog
%% ki lo atzdik rasha.
%% ============================================================================
mitzvah(distance_falsehood, lo_taaseh,
'Shemot 23:7',
'From a false matter you shall distance yourself.
The innocent and righteous you shall not kill,
for I will not justify the wicked').
prohibition(distance_falsehood, approach, false_matter).
prohibition(distance_falsehood, kill, innocent).
prohibition(distance_falsehood, kill, righteous).
%% ============================================================================
%% SHEMOT 23:8 — BRIBERY
%% V'shochad lo tikach ki hashochad y'aver pikchim
%% visalef divrei tzadikim.
%% ============================================================================
mitzvah(bribery, lo_taaseh,
'Shemot 23:8',
'A bribe you shall not take, for the bribe blinds the clear-sighted
and perverts the words of the righteous').
prohibition(bribery, take, bribe).
%% ============================================================================
%% SHEMOT 23:9 — THE STRANGER AGAIN
%% V'ger lo tilchatz v'atem y'datem et nefesh hager
%% ki gerim heyitem b'eretz mitzrayim.
%% ============================================================================
mitzvah(stranger_no_oppress, lo_taaseh,
'Shemot 23:9',
'A stranger you shall not oppress — you know the soul of the stranger,
for you were strangers in the land of Egypt').
prohibition(stranger_no_oppress, oppress, ger).
% The deepest law: atem y'datem et nefesh hager — you KNOW the soul
% Not "you should empathize." You KNOW. Because you were.
%% ============================================================================
%% SHEMOT 23:10-11 — SHMITAH (SABBATICAL YEAR)
%% V'shesh shanim tizra et artzecha... v'hashviit tishm'tenah untashtah
%% ============================================================================
mitzvah(shmitah, aseh,
'Shemot 23:10-11',
'Six years you shall sow your land and gather its produce.
And the seventh you shall release it and abandon it,
and the destitute of your people shall eat,
and what they leave the animal of the field shall eat.
So shall you do with your vineyard and your olive grove').
obligation(shmitah, sow_and_gather, years_1_to_6).
obligation(shmitah, release_and_abandon, year_7).
temporal(shmitah, seven_year_cycle).
% The destitute eat first, then the animals
applies(shmitah, destitute, eat_first).
applies(shmitah, animals_of_field, eat_remainder).
%% ============================================================================
%% SHEMOT 23:12 — SHABBAT
%% Sheshet yamim ta'aseh ma'asecha uvayom hashvii tishbot
%% l'ma'an yanuach shorcha vachamorcha
%% v'yinafesh ben amatcha v'hager.
%% ============================================================================
mitzvah(shabbat, aseh,
'Shemot 23:12',
'Six days you shall do your work, and on the seventh day you shall rest,
in order that your ox and your donkey may rest,
and the son of your maidservant and the stranger may be refreshed').
obligation(shabbat, work, days_1_to_6).
obligation(shabbat, rest, day_7).
temporal(shabbat, seven_day_cycle).
% The reason — l'ma'an: so that the animals rest,
% the servant's son rests, the stranger is refreshed
% Shabbat is not for you. It is for those under you.
%% ============================================================================
%% SHEMOT 23:13 — GUARD EVERYTHING / OTHER GODS' NAMES
%% Uv'chol asher amarti aleichem tishameru
%% v'shem elohim acherim lo tazkiru lo yishama al picha.
%% ============================================================================
mitzvah(guard_all_said, aseh,
'Shemot 23:13',
'In all that I have said to you, you shall guard yourselves').
obligation(guard_all_said, guard, all_that_is_said).
mitzvah(no_other_gods_names, lo_taaseh,
'Shemot 23:13',
'The name of other gods you shall not mention,
it shall not be heard on your mouth').
prohibition(no_other_gods_names, mention, name_of_other_gods).
prohibition(no_other_gods_names, allow_heard, name_of_other_gods).
%% ============================================================================
%% SHEMOT 23:14-17 — THREE FESTIVALS
%% Shalosh regalim tachog li bashanah.
%% ============================================================================
mitzvah(three_festivals, aseh,
'Shemot 23:14',
'Three times you shall celebrate to Me in the year').
% 23:15 — Matzot
mitzvah(chag_hamatzot, aseh,
'Shemot 23:15',
'The festival of matzot you shall keep — seven days you shall eat
matzot as I commanded you, at the appointed time in the month of Aviv,
for in it you went out of Egypt.
And they shall not appear before Me empty-handed').
temporal(chag_hamatzot, month_of_aviv).
obligation(chag_hamatzot, eat_matzot, seven_days).
prohibition(chag_hamatzot, appear_empty, before_hashem).
% 23:16 — Harvest (Shavuot)
mitzvah(chag_hakatzir, aseh,
'Shemot 23:16a',
'The festival of the harvest, the firstfruits of your labor
that you sow in the field').
% 23:16 — Ingathering (Sukkot)
mitzvah(chag_ha_asif, aseh,
'Shemot 23:16b',
'The festival of the ingathering at the going out of the year,
when you gather your labor from the field').
temporal(chag_ha_asif, end_of_year).
% 23:17
mitzvah(three_appearances, aseh,
'Shemot 23:17',
'Three times in the year all your males shall appear
before the Lord God').
obligation(three_appearances, appear_before_hashem, all_males).
temporal(three_appearances, three_times_yearly).
%% ============================================================================
%% SHEMOT 23:18 — BLOOD AND FAT
%% Lo tizbach al chametz dam zivchi
%% v'lo yalin chelev chagi ad boker.
%% ============================================================================
mitzvah(blood_not_with_chametz, lo_taaseh,
'Shemot 23:18',
'You shall not slaughter upon chametz the blood of My sacrifice.
The fat of My festival shall not remain until morning').
prohibition(blood_not_with_chametz, slaughter_with_chametz, sacrifice_blood).
prohibition(blood_not_with_chametz, leave_until_morning, festival_fat).
%% ============================================================================
%% SHEMOT 23:19a — FIRSTFRUITS TO THE HOUSE
%% Reishit bikurei admatcha tavi beit Hashem Elokecha.
%% ============================================================================
mitzvah(bikurim, aseh,
'Shemot 23:19a',
'The first of the firstfruits of your land you shall bring
to the house of the Lord your God').
obligation(bikurim, bring_to_house_of_hashem, first_firstfruits).
%% ============================================================================
%% SHEMOT 23:19b — KID IN MOTHER'S MILK
%% Lo t'vashel g'di bachalev imo.
%% ============================================================================
mitzvah(meat_milk, lo_taaseh,
'Shemot 23:19b',
'You shall not cook a kid in its mother''s milk').
prohibition(meat_milk, cook, kid_in_mothers_milk).
shoresh(meat_milk, bet_shin_lamed). % בשל — to cook
%% ============================================================================
%% SHEMOT 23:20-33 — THE ANGEL AND THE LAND
%% These are promises and warnings, not mitzvot in the standard sense.
%% But they contain commandments within the narrative.
%% ============================================================================
% 23:21 — Obey the angel
mitzvah(obey_angel, aseh,
'Shemot 23:21',
'Guard yourself before him and listen to his voice.
Do not rebel against him, for he will not forgive your transgression,
for My name is within him').
obligation(obey_angel, guard, before_angel).
obligation(obey_angel, listen, voice_of_angel).
prohibition(obey_angel, rebel_against, angel).
% 23:24 — Do not bow to their gods
mitzvah(no_bow_to_gods, lo_taaseh,
'Shemot 23:24',
'You shall not bow to their gods and you shall not serve them
and you shall not do according to their deeds.
Rather you shall tear them down and smash their pillars').
prohibition(no_bow_to_gods, bow_to, other_gods).
prohibition(no_bow_to_gods, serve, other_gods).
prohibition(no_bow_to_gods, do_deeds_of, other_nations).
obligation(no_bow_to_gods, tear_down, idols).
obligation(no_bow_to_gods, smash, pillars).
% 23:32-33 — No covenant with them or their gods
mitzvah(no_covenant, lo_taaseh,
'Shemot 23:32-33',
'You shall not make a covenant with them or with their gods.
They shall not dwell in your land lest they cause you to sin
against Me, for you will serve their gods — it will be a snare').
prohibition(no_covenant, make_covenant_with, other_nations).
prohibition(no_covenant, make_covenant_with, other_gods).
prohibition(no_covenant, allow_dwelling, other_nations_in_land).
%% ============================================================================
%% SUMMARY STATISTICS
%% ============================================================================
%% Mishpatim contains approximately 53 mitzvot:
%% 23 aseh (positive commands)
%% 30 lo ta'aseh (prohibitions)
%%
%% Categories:
%% - Servitude and freedom (21:2-11)
%% - Capital offenses (21:12-17)
%% - Personal injury (21:18-27)
%% - Property damage and liability (21:28-22:5)
%% - Guardianship and trust (22:6-14)
%% - Sexual ethics (22:15-16)
%% - Prohibitions: sorcery, bestiality, idolatry (22:17-19)
%% - Protection of the vulnerable (22:20-26)
%% - Respect for authority (22:27)
%% - Sacred obligations (22:28-30)
%% - Justice system (23:1-8)
%% - Stranger protection (23:9)
%% - Sabbatical and Shabbat (23:10-12)
%% - Festival calendar (23:14-19)
%% - Covenant warnings (23:20-33)
%%
%% The specification begins with servitude — ki gerim heyitem.
%% You were slaves. Now here is how you treat those who serve you.
%% The first law after Sinai is about freedom.
%% ============================================================================
%% QUERY INTERFACE
%% ============================================================================
%% Find all prohibitions:
%% ?- prohibition(Id, Action, Object).
%%
%% Find all obligations:
%% ?- obligation(Id, Action, Object).
%%
%% Find all damages cases:
%% ?- damages(Id, Cause, Harm, Restitution).
%%
%% Find all mitzvot about the stranger:
%% ?- mitzvah(Id, _, _, Desc), sub_string(Desc, _, _, _, "stranger").
%%
%% Find all capital offenses:
%% ?- consequence(Id, _, death_penalty(_)).
%%
%% Find temporal constraints:
%% ?- temporal(Id, Constraint).
%%
%% Find by Torah source:
%% ?- mitzvah(Id, _, Source, _), sub_string(Source, _, _, _, "22").