Phase 3: Intelligence — 613 mitzvot, 13 middot, Tzara'at diagnostic

Encode all 613 mitzvot from Rambam's Sefer HaMitzvot (248 positive,
365 prohibitions). Build the 13 Middot of Rabbi Yishmael as Prolog
inference predicates for hermeneutical reasoning. Implement Tzara'at
multi-stage input validation following Vayikra 13-14. Enhance kushya
generation with kal vachomer and shnei ketuvim challenge strategies.

Architecture §4 Steps 14-15, 19-20.

New files:
  middot/   — 8 files (master + 7 rule modules)
  diagnostic/ — 4 files (tzaraat, inspection, quarantine, diagnosis)

Modified:
  mitzvot.pl     — 52 → 613 mitzvot
  relationships.pl — expanded tensions, complements, action domains
  challenge.pl   — middot-based kushya (kal vachomer, shnei ketuvim)

Tests: 293 total (184 Prolog, 76 Elixir, 33 Haskell), 0 failures.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Scott KarpandClaude Opus 4.6 committed 2026-03-13 16:18:58 -04:00
1 parent ae78ed26d1
commit 52837cee18
19 files changed
+2795 -178

No files matched your search

+744 -131
View File
@@ -1,22 +1,21 @@
%% mitzvot.pl — Torah commandments as logical facts.
%%
%% Architecture §3.4: "613 total — requires careful encoding"
%% Build order step 6: "start with subset of mitzvot"
%%
%% This is the Phase 1 subset. The full 613 are encoded in Phase 3.
%% We start with the mitzvot the system itself must obey:
%% - The three halt conditions (avodah zarah, shfichut damim, gilui arayot)
%% - Shabbat (mandatory cessation)
%% - The dibrot (structural constants)
%% - Foundational mitzvot for reasoning demonstration
%% Phase 3, Step 14: Full 613 mitzvot from Rambam's Sefer HaMitzvot.
%%
%% Format: mitzvah(ID, Category, Action, Condition)
%% ID = Rambam's enumeration (Sefer HaMitzvot)
%% Category = positive | prohibition | belief
%% Positive: 1-248, Prohibition: 1-365
%% We use P1-P248 as positive_1..positive_248
%% and N1-N365 as prohibition_1..prohibition_365
%% Mapped to a single namespace: positives 1-248, prohibitions 249-613
%% Category = positive | prohibition
%% Action = atom describing the commandment
%% Condition = always | context-dependent condition
%% Condition = always | when(context)
%%
%% Source: Rambam, Sefer HaMitzvot; cross-referenced with Sefer HaChinukh.
%% Numbering follows Rambam's count. Where Rambam and Chinukh differ,
%% Rambam governs (he is the mara d'atra for enumeration).
:- module(mitzvot, [
mitzvah/4,
@@ -26,143 +25,757 @@
]).
%% ============================================================
%% BELIEFS AND FOUNDATIONS
%% 248 POSITIVE COMMANDMENTS (Mitzvot Aseh)
%% ============================================================
%% Dibrot — the ten declarations
mitzvah(1, belief, know_hashem, always).
mitzvah(2, prohibition, no_other_gods, always).
mitzvah(3, belief, unity_of_hashem, always).
mitzvah(4, positive, love_hashem, always).
mitzvah(5, positive, fear_hashem, always).
mitzvah(6, positive, sanctify_the_name, when(opportunity_arises)).
mitzvah(7, prohibition, not_profane_the_name, always).
mitzvah(8, prohibition, not_destroy_holy_things, always).
mitzvah(9, positive, hear_shema, when(morning_and_evening)).
mitzvah(10, positive, study_torah, always).
%% --- BELIEFS AND KNOWLEDGE OF GOD (1-10) ---
mitzvah(1, positive, know_hashem, always).
mitzvah(2, positive, unity_of_hashem, always).
mitzvah(3, positive, love_hashem, always).
mitzvah(4, positive, fear_hashem, always).
mitzvah(5, positive, pray_to_hashem, always).
mitzvah(6, positive, cleave_to_hashem, always).
mitzvah(7, positive, swear_by_his_name, when(oath_required)).
mitzvah(8, positive, walk_in_his_ways, always).
mitzvah(9, positive, sanctify_the_name, when(opportunity_arises)).
mitzvah(10, positive, read_shema, when(morning_and_evening)).
%% ============================================================
%% SHABBAT — MANDATORY CESSATION
%% ============================================================
%% --- TORAH STUDY AND TRANSMISSION (11-19) ---
mitzvah(11, positive, study_torah, always).
mitzvah(12, positive, teach_torah, always).
mitzvah(13, positive, bind_tefillin_head, when(weekday_morning)).
mitzvah(14, positive, bind_tefillin_arm, when(weekday_morning)).
mitzvah(15, positive, make_tzitzit, when(wearing_four_cornered_garment)).
mitzvah(16, positive, affix_mezuzah, when(dwelling_established)).
mitzvah(17, positive, assemble_people_hakhel, when(sukkot_after_shmitah)).
mitzvah(18, positive, write_sefer_torah, always).
mitzvah(19, positive, king_writes_second_torah, when(king_appointed)).
mitzvah(154, positive, rest_on_shabbat, when(seventh_day)).
mitzvah(155, prohibition, not_work_on_shabbat, when(seventh_day)).
mitzvah(156, positive, sanctify_shabbat, when(seventh_day)).
%% --- TEMPLE AND SANCTUARY (20-38) ---
mitzvah(20, positive, build_sanctuary, when(ability_exists)).
mitzvah(21, positive, revere_sanctuary, always).
mitzvah(22, positive, guard_sanctuary, always).
mitzvah(23, positive, levites_serve_sanctuary, when(temple_standing)).
mitzvah(24, positive, kohanim_wash_hands_feet, when(temple_service)).
mitzvah(25, positive, kindle_menorah, when(temple_standing)).
mitzvah(26, positive, kohanim_bless_people, always).
mitzvah(27, positive, showbread_on_table, when(temple_standing)).
mitzvah(28, positive, burn_incense, when(temple_standing)).
mitzvah(29, positive, maintain_eternal_fire, when(temple_standing)).
mitzvah(30, positive, remove_ashes_from_altar, when(temple_standing)).
mitzvah(31, positive, send_away_tamei_from_camp, when(temple_standing)).
mitzvah(32, positive, honor_kohanim, always).
mitzvah(33, positive, kohanim_wear_vestments, when(temple_service)).
mitzvah(34, positive, carry_aron_on_shoulders, when(transport_required)).
mitzvah(35, positive, anoint_with_shemen_hamishchah, when(consecration)).
mitzvah(36, positive, levites_serve_in_shifts, when(temple_standing)).
mitzvah(37, positive, kohanim_become_tamei_for_relatives, when(close_relative_dies)).
mitzvah(38, positive, kohen_gadol_marries_virgin, when(kohen_gadol_appointed)).
%% Festivals
mitzvah(159, positive, rest_on_yom_tov, when(festival)).
mitzvah(160, prohibition, not_work_on_yom_tov, when(festival)).
mitzvah(163, positive, rest_on_rosh_hashanah, when(tishrei_1)).
mitzvah(164, positive, fast_on_yom_kippur, when(tishrei_10)).
%% --- KORBANOT / OFFERINGS (39-88) ---
mitzvah(39, positive, bring_tamid_morning, when(temple_standing)).
mitzvah(40, positive, bring_tamid_afternoon, when(temple_standing)).
mitzvah(41, positive, kohen_gadol_minchah_daily, when(temple_standing)).
mitzvah(42, positive, bring_musaf_shabbat, when(shabbat_temple)).
mitzvah(43, positive, bring_musaf_rosh_chodesh, when(rosh_chodesh_temple)).
mitzvah(44, positive, bring_musaf_pesach, when(pesach_temple)).
mitzvah(45, positive, bring_omer_offering, when(sixteen_nisan_temple)).
mitzvah(46, positive, bring_musaf_shavuot, when(shavuot_temple)).
mitzvah(47, positive, bring_two_loaves_shavuot, when(shavuot_temple)).
mitzvah(48, positive, bring_musaf_rosh_hashanah, when(rosh_hashanah_temple)).
mitzvah(49, positive, bring_musaf_yom_kippur, when(yom_kippur_temple)).
mitzvah(50, positive, bring_yom_kippur_service, when(yom_kippur_temple)).
mitzvah(51, positive, bring_musaf_sukkot, when(sukkot_temple)).
mitzvah(52, positive, bring_musaf_shemini_atzeret, when(shemini_atzeret_temple)).
mitzvah(53, positive, bring_chagigah, when(three_festivals_temple)).
mitzvah(54, positive, appear_before_hashem_three_times, when(three_festivals_temple)).
mitzvah(55, positive, rejoice_on_festivals, when(festival)).
mitzvah(56, positive, slaughter_pesach_offering, when(fourteen_nisan)).
mitzvah(57, positive, eat_pesach_offering, when(pesach_night)).
mitzvah(58, positive, slaughter_second_pesach, when(fourteen_iyar)).
mitzvah(59, positive, eat_second_pesach_with_matzah, when(pesach_sheni_night)).
mitzvah(60, positive, blow_trumpets_over_offerings, when(temple_standing)).
mitzvah(61, positive, animals_from_eighth_day, when(offering_required)).
mitzvah(62, positive, offerings_unblemished, when(offering_required)).
mitzvah(63, positive, salt_every_offering, when(offering_required)).
mitzvah(64, positive, bring_olah, when(offering_required)).
mitzvah(65, positive, bring_chatat, when(unintentional_sin)).
mitzvah(66, positive, bring_asham, when(uncertain_transgression)).
mitzvah(67, positive, bring_asham_vadai, when(certain_transgression)).
mitzvah(68, positive, bring_shelamim, when(offering_required)).
mitzvah(69, positive, bring_minchah, when(offering_required)).
mitzvah(70, positive, court_brings_chatat_for_error, when(court_errs)).
mitzvah(71, positive, individual_brings_chatat_for_idolatry, when(individual_idolatry_error)).
mitzvah(72, positive, bring_asham_talui, when(uncertain_sin)).
mitzvah(73, positive, bring_asham_meilah, when(misuse_of_sacred)).
mitzvah(74, positive, confess_sins_with_offering, when(offering_required)).
mitzvah(75, positive, zav_brings_offering, when(zav_healed)).
mitzvah(76, positive, zavah_brings_offering, when(zavah_healed)).
mitzvah(77, positive, yoledet_brings_offering, when(after_birth)).
mitzvah(78, positive, metzora_brings_offering, when(metzora_healed)).
mitzvah(79, positive, tithe_animals, when(livestock_owned)).
mitzvah(80, positive, redeem_firstborn_son, when(firstborn_son_born)).
mitzvah(81, positive, redeem_firstborn_donkey, when(firstborn_donkey)).
mitzvah(82, positive, break_neck_unredeemed_donkey, when(unredeemed_donkey)).
mitzvah(83, positive, bring_all_offerings_to_temple, when(temple_standing)).
mitzvah(84, positive, bring_offerings_from_outside_to_temple, when(temple_standing)).
mitzvah(85, positive, redeem_blemished_consecrated_animals, when(blemished_consecration)).
mitzvah(86, positive, exchange_offering_is_holy, when(exchange_made)).
mitzvah(87, positive, kohanim_eat_remainder_of_minchah, when(temple_standing)).
mitzvah(88, positive, kohanim_eat_meat_of_chatat, when(temple_standing)).
%% Shmitah — the seventh year
mitzvah(134, positive, let_land_rest_in_shmitah, when(seventh_year)).
mitzvah(135, prohibition, not_work_land_in_shmitah, when(seventh_year)).
mitzvah(136, positive, release_debts_in_shmitah, when(seventh_year)).
%% --- CONSECRATION AND VOWS (89-95) ---
mitzvah(89, positive, burn_consecrated_that_became_tamei, when(became_tamei)).
mitzvah(90, positive, burn_notar, when(notar_remains)).
mitzvah(91, positive, nazirite_lets_hair_grow, when(nazirite_vow)).
mitzvah(92, positive, nazirite_shaves_at_completion, when(nazirite_completion)).
mitzvah(93, positive, fulfill_verbal_vow, always).
mitzvah(94, positive, annul_vow_per_rules, when(vow_annulment_conditions)).
mitzvah(95, positive, nazir_who_becomes_tamei_brings_offering, when(nazir_tamei)).
%% ============================================================
%% THE THREE HALT CONDITIONS (Cardinal sins — yehareg v'al ya'avor)
%% ============================================================
%% Avodah Zarah — idolatry / misattributed authority
%% mitzvah(2) already declared in Beliefs section above
mitzvah(14, prohibition, not_make_idols, always).
mitzvah(15, prohibition, not_make_idols_for_others, always).
mitzvah(16, prohibition, not_worship_idols, always).
mitzvah(17, prohibition, not_bow_to_idols, always).
%% Shfichut Damim — bloodshed / destruction of tzelem carrier
mitzvah(289, prohibition, not_murder, always).
mitzvah(290, prohibition, not_cause_death_of_innocent, always).
mitzvah(295, positive, save_the_pursued, when(pursuit_in_progress)).
%% Gilui Arayot — forbidden relations / collapse of required distinctions
mitzvah(330, prohibition, not_commit_adultery, always).
mitzvah(353, prohibition, maintain_boundaries, always).
%% ============================================================
%% JUSTICE AND JUDGMENT (Sanhedrin-relevant)
%% ============================================================
mitzvah(175, positive, appoint_judges, always).
mitzvah(176, prohibition, not_judge_unjustly, always).
mitzvah(177, prohibition, not_favor_the_powerful, always).
mitzvah(178, prohibition, not_pervert_justice_for_poor, always).
mitzvah(179, positive, judge_righteously, always).
mitzvah(180, prohibition, not_accept_bribes, always).
mitzvah(181, positive, follow_the_majority, when(court_deliberation)).
mitzvah(182, prohibition, not_follow_majority_for_evil, when(court_deliberation)).
%% Capital cases — relevant to Sanhedrin unanimous rejection rule
mitzvah(183, prohibition, not_convict_on_one_witness, when(capital_case)).
mitzvah(184, positive, investigate_thoroughly, when(capital_case)).
%% ============================================================
%% KORBANOT (Offerings — relevant to korban processor)
%% ============================================================
mitzvah(62, positive, bring_olah, when(offering_required)).
mitzvah(63, positive, bring_shelamim, when(offering_required)).
mitzvah(64, positive, bring_chatat, when(unintentional_sin)).
mitzvah(65, positive, bring_asham, when(uncertain_transgression)).
mitzvah(66, positive, bring_minchah, when(offering_required)).
%% ============================================================
%% TESTIMONY AND TRUTH (relevant to system integrity)
%% ============================================================
mitzvah(285, prohibition, not_bear_false_witness, always).
mitzvah(286, positive, testify_truthfully, when(knowledge_exists)).
mitzvah(287, prohibition, not_withhold_testimony, always).
%% ============================================================
%% SPEECH AND ATTRIBUTION
%% ============================================================
mitzvah(235, prohibition, not_take_name_in_vain, always).
mitzvah(236, prohibition, not_swear_falsely, always).
%% ============================================================
%% PROPERTY AND BOUNDARIES (relevant to manna/anti-hoarding)
%% ============================================================
mitzvah(243, prohibition, not_covet, always).
mitzvah(244, prohibition, not_desire_others_property, always).
mitzvah(247, prohibition, not_steal, always).
mitzvah(248, prohibition, not_move_boundary_markers, always).
%% ============================================================
%% BIKURIM AND TERUMAH (relevant to release protocol)
%% ============================================================
%% --- RITUAL PURITY (96-113) ---
mitzvah(96, positive, anyone_who_touches_nevelah_is_tamei, always).
mitzvah(97, positive, eight_sheratzim_transmit_tumah, always).
mitzvah(98, positive, foods_become_tamei, always).
mitzvah(99, positive, niddah_is_temeiah, always).
mitzvah(100, positive, yoledet_is_temeiah, always).
mitzvah(101, positive, metzora_is_tamei, always).
mitzvah(102, positive, metzora_garment_is_tamei, always).
mitzvah(103, positive, metzora_house_is_tamei, always).
mitzvah(104, positive, zav_is_tamei, always).
mitzvah(105, positive, zavah_is_temeiah, always).
mitzvah(106, positive, corpse_is_tamei, always).
mitzvah(107, positive, parah_adumah_purifies, when(corpse_tumah)).
mitzvah(108, positive, immerse_in_mikveh, when(tumah_contracted)).
mitzvah(109, positive, metzora_purification_procedure, when(metzora_healed)).
mitzvah(110, positive, metzora_shaves_all_hair, when(metzora_purification)).
mitzvah(111, positive, metzora_identified_by_signs, always).
mitzvah(112, positive, sotah_procedure, when(sotah_suspected)).
mitzvah(113, positive, eglah_arufah_procedure, when(unknown_murder)).
%% --- AGRICULTURE AND GIFTS TO KOHANIM (114-145) ---
mitzvah(114, positive, separate_terumah_gedolah, when(produce_available)).
mitzvah(115, positive, separate_maaser_rishon, when(produce_available)).
mitzvah(116, positive, separate_maaser_sheni, when(produce_years_1_2_4_5)).
mitzvah(117, positive, levites_separate_terumat_maaser, when(maaser_received)).
mitzvah(118, positive, separate_maaser_ani, when(produce_years_3_6)).
mitzvah(119, positive, recite_vidui_maaserot, when(fourth_year_erev_pesach)).
mitzvah(120, positive, recite_mikra_bikurim, when(bringing_bikurim)).
mitzvah(121, positive, separate_challah, when(dough_kneaded)).
mitzvah(122, positive, let_land_rest_shmitah, when(seventh_year)).
mitzvah(123, positive, rest_land_yovel, when(fiftieth_year)).
mitzvah(124, positive, blow_shofar_yovel, when(yom_kippur_yovel)).
mitzvah(125, positive, bring_bikurim, when(first_fruits_available)).
mitzvah(126, positive, recite_bikurim_declaration, when(bringing_bikurim)).
mitzvah(127, positive, separate_terumah, when(produce_available)).
mitzvah(128, positive, leave_peah, when(harvest)).
mitzvah(129, positive, leave_leket, when(harvest)).
mitzvah(130, positive, leave_forgotten_sheaf, when(harvest)).
mitzvah(131, positive, leave_peret_of_vineyard, when(grape_harvest)).
mitzvah(132, positive, leave_olelot, when(grape_harvest)).
mitzvah(133, positive, bring_fourth_year_fruit, when(fourth_year_planting)).
mitzvah(134, positive, let_shmitah_produce_be_free, when(seventh_year)).
mitzvah(135, positive, release_debts_shmitah, when(seventh_year)).
mitzvah(136, positive, count_omer_days, when(pesach_to_shavuot)).
mitzvah(137, positive, sanctify_yovel_fiftieth_year, when(fiftieth_year)).
mitzvah(138, positive, eat_matzah_pesach_night, when(pesach_night)).
mitzvah(139, positive, tell_exodus_story, when(pesach_night)).
mitzvah(140, positive, remove_chametz, when(fourteen_nisan)).
mitzvah(141, positive, rest_first_day_pesach, when(fifteen_nisan)).
mitzvah(142, positive, rest_seventh_day_pesach, when(twentyone_nisan)).
mitzvah(143, positive, rest_shavuot, when(six_sivan)).
mitzvah(144, positive, rest_rosh_hashanah, when(one_tishrei)).
mitzvah(145, positive, fast_yom_kippur, when(ten_tishrei)).
%% --- SHABBAT AND FESTIVALS (146-171) ---
mitzvah(146, positive, rest_yom_kippur, when(ten_tishrei)).
mitzvah(147, positive, rest_first_day_sukkot, when(fifteen_tishrei)).
mitzvah(148, positive, rest_shemini_atzeret, when(twentytwo_tishrei)).
mitzvah(149, positive, dwell_in_sukkah, when(sukkot)).
mitzvah(150, positive, take_lulav, when(sukkot)).
mitzvah(151, positive, hear_shofar_rosh_hashanah, when(one_tishrei)).
mitzvah(152, positive, give_half_shekel, when(annually)).
mitzvah(153, positive, sanctify_new_month, when(new_moon_sighted)).
mitzvah(154, positive, rest_on_shabbat, when(seventh_day)).
mitzvah(155, positive, sanctify_shabbat, when(seventh_day)).
mitzvah(156, positive, destroy_chametz, when(fourteen_nisan)).
mitzvah(157, positive, give_shekel_for_communal_offerings, when(annually_temple)).
mitzvah(158, positive, count_seven_weeks, when(pesach_to_shavuot)).
mitzvah(159, positive, rest_on_yom_tov, when(festival)).
mitzvah(160, positive, eat_pesach_second_night_matzah, when(pesach_sheni)).
mitzvah(161, positive, circumcise_males, when(eighth_day)).
mitzvah(162, positive, slaughter_pesach_afternoon, when(fourteen_nisan)).
mitzvah(163, positive, rest_rosh_hashanah_second_day, when(two_tishrei)).
mitzvah(164, positive, dwell_sukkah_seven_days, when(sukkot)).
%% --- JUSTICE AND COURTS (165-193) ---
mitzvah(165, positive, appoint_judges, always).
mitzvah(166, positive, treat_litigants_equally, when(court_deliberation)).
mitzvah(167, positive, testify_in_court, when(knowledge_exists)).
mitzvah(168, positive, investigate_witnesses, when(court_case)).
mitzvah(169, positive, judge_by_majority, when(court_deliberation)).
mitzvah(170, positive, execute_four_methods, when(capital_sentence)).
mitzvah(171, positive, hang_after_stoning, when(certain_offenses)).
mitzvah(172, positive, bury_executed_same_day, when(execution)).
mitzvah(173, positive, pursue_justice, always).
mitzvah(174, positive, follow_beit_din_hagadol, always).
mitzvah(175, positive, follow_majority_in_court, when(court_deliberation)).
mitzvah(176, positive, appoint_king, when(king_needed)).
mitzvah(177, positive, obey_kohen_gadol, when(temple_standing)).
mitzvah(178, positive, judge_righteously, always).
mitzvah(179, positive, investigate_thoroughly, when(capital_case)).
%% --- MONETARY LAW AND DAMAGES (180-207) ---
mitzvah(180, positive, return_stolen_property, when(theft_occurred)).
mitzvah(181, positive, give_tzedakah, always).
mitzvah(182, positive, give_gifts_to_kohanim, when(applicable)).
mitzvah(183, positive, lend_to_poor, when(poor_person_needs)).
mitzvah(184, positive, lend_to_gentile_with_interest, when(loan_to_gentile)).
mitzvah(185, positive, return_pledge_when_needed, when(pledge_held)).
mitzvah(186, positive, pay_wages_on_time, always).
mitzvah(187, positive, allow_worker_to_eat, when(working_with_food)).
mitzvah(188, positive, help_unload_animal, when(animal_struggling)).
mitzvah(189, positive, help_load_animal, when(animal_needs_loading)).
mitzvah(190, positive, return_lost_property, when(found_property)).
mitzvah(191, positive, rebuke_sinner, always).
mitzvah(192, positive, love_fellow_jew, always).
mitzvah(193, positive, love_convert, always).
%% --- WEIGHTS, MEASURES, AND COMMERCE (194-209) ---
mitzvah(194, positive, have_accurate_weights, always).
mitzvah(195, positive, honor_the_wise, always).
mitzvah(196, positive, honor_parents, always).
mitzvah(197, positive, fear_parents, always).
mitzvah(198, positive, be_fruitful_multiply, always).
mitzvah(199, positive, marriage_by_kiddushin, when(marriage)).
mitzvah(200, positive, groom_rejoices_with_bride_one_year, when(first_year_marriage)).
mitzvah(201, positive, circumcise_son, when(eighth_day)).
mitzvah(202, positive, yibum_levirate_marriage, when(brother_dies_childless)).
mitzvah(203, positive, chalitzah, when(yibum_refused)).
mitzvah(204, positive, rapist_marries_victim, when(rape_of_unmarried)).
mitzvah(205, positive, motzi_shem_ra_stays_married, when(false_accusation)).
mitzvah(206, positive, beautiful_captive_procedure, when(war_captive)).
mitzvah(207, positive, divorce_by_get, when(divorce)).
%% --- SLAVES AND SERVANTS (208-216) ---
mitzvah(208, positive, hebrew_slave_laws, when(hebrew_slave)).
mitzvah(209, positive, betroth_hebrew_maidservant, when(hebrew_maidservant)).
mitzvah(210, positive, redeem_hebrew_maidservant, when(hebrew_maidservant)).
mitzvah(211, positive, canaanite_slave_forever, when(canaanite_slave)).
mitzvah(212, positive, provide_for_freed_slave, when(slave_freed)).
mitzvah(213, positive, eved_ivri_goes_free_six, when(six_years_served)).
mitzvah(214, positive, eved_nirtza_freed_yovel, when(yovel_year)).
mitzvah(215, positive, freed_slave_provision, when(slave_released)).
mitzvah(216, positive, treat_hired_worker_justly, always).
%% --- WAR AND MONARCHY (217-231) ---
mitzvah(217, positive, anoint_king_from_israel, when(king_appointed)).
mitzvah(218, positive, obey_king, when(king_rules)).
mitzvah(219, positive, king_writes_torah_scroll, when(king_appointed)).
mitzvah(220, positive, kohen_anointed_for_war_speaks, when(going_to_war)).
mitzvah(221, positive, prepare_camp_properly, when(war_camp)).
mitzvah(222, positive, prepare_place_outside_camp, when(war_camp)).
mitzvah(223, positive, prepare_stake_for_covering, when(war_camp)).
mitzvah(224, positive, destroy_seven_nations, when(entering_land)).
mitzvah(225, positive, destroy_amalek, when(opportunity_arises)).
mitzvah(226, positive, remember_amalek, always).
mitzvah(227, positive, offer_peace_before_war, when(going_to_war)).
mitzvah(228, positive, kohen_speaks_to_army, when(going_to_war)).
mitzvah(229, positive, send_home_fearful, when(going_to_war)).
mitzvah(230, positive, besiege_city_correctly, when(siege)).
mitzvah(231, positive, laws_of_ir_hanidachat, when(city_turned_idolatrous)).
%% --- FAMILY AND PURITY (232-248) ---
mitzvah(232, positive, laws_of_tzaraat_in_person, always).
mitzvah(233, positive, laws_of_tzaraat_in_garment, always).
mitzvah(234, positive, laws_of_tzaraat_in_house, always).
mitzvah(235, positive, niddah_counts_seven_clean_days, when(niddah)).
mitzvah(236, positive, zavah_counts_seven_clean_days, when(zavah)).
mitzvah(237, positive, zav_counts_seven_clean_days, when(zav)).
mitzvah(238, positive, immerse_all_keilim_in_mikveh, when(new_vessels)).
mitzvah(239, positive, break_earthenware_that_absorbed_tumah, when(tumah_absorbed)).
mitzvah(240, positive, eglah_arufah_for_unsolved_murder, when(murdered_body_found)).
mitzvah(241, positive, build_cities_of_refuge, when(in_land)).
mitzvah(242, positive, give_levite_cities, when(in_land)).
mitzvah(243, positive, build_maakeh_fence_on_roof, always).
mitzvah(244, positive, remove_stumbling_blocks, always).
mitzvah(245, positive, send_mother_bird_away, when(birds_nest_found)).
mitzvah(246, positive, cover_blood_of_slaughtered_bird, when(slaughter)).
mitzvah(247, positive, shiluach_haken, when(birds_nest_found)).
mitzvah(248, positive, guard_ones_life, always).
%% ============================================================
%% 365 PROHIBITIONS (Mitzvot Lo Ta'aseh)
%% ============================================================
%% Mapped to IDs 249-613 (249 = prohibition 1, 613 = prohibition 365)
%% --- IDOLATRY AND FALSE WORSHIP (249-300) ---
mitzvah(249, prohibition, no_other_gods, always).
mitzvah(250, prohibition, not_make_idols, always).
mitzvah(251, prohibition, not_make_idols_for_others, always).
mitzvah(252, prohibition, not_make_figured_stones, always).
mitzvah(253, prohibition, not_plant_asheirah, always).
mitzvah(254, prohibition, not_worship_idols_their_way, always).
mitzvah(255, prohibition, not_bow_to_idols, always).
mitzvah(256, prohibition, not_worship_molech, always).
mitzvah(257, prohibition, not_practice_ov, always).
mitzvah(258, prohibition, not_practice_yidoni, always).
mitzvah(259, prohibition, not_turn_to_idols, always).
mitzvah(260, prohibition, not_erect_pillar, always).
mitzvah(261, prohibition, not_make_figured_stones_to_bow, always).
mitzvah(262, prohibition, not_make_graven_image, always).
mitzvah(263, prohibition, not_prophesy_in_idol_name, always).
mitzvah(264, prohibition, not_listen_to_false_prophet, always).
mitzvah(265, prohibition, not_entice_to_idolatry, always).
mitzvah(266, prohibition, not_love_enticer, always).
mitzvah(267, prohibition, not_relax_guard_against_enticer, always).
mitzvah(268, prohibition, not_save_enticer, always).
mitzvah(269, prohibition, not_plead_for_enticer, always).
mitzvah(270, prohibition, not_refrain_from_testimony_against_enticer, always).
mitzvah(271, prohibition, not_benefit_from_ir_hanidachat, always).
mitzvah(272, prohibition, not_rebuild_ir_hanidachat, always).
mitzvah(273, prohibition, not_benefit_from_idol_offerings, always).
mitzvah(274, prohibition, not_prophesy_falsely, always).
mitzvah(275, prohibition, not_fear_false_prophet, always).
mitzvah(276, prohibition, not_swear_by_idols, always).
mitzvah(277, prohibition, not_invite_idol_worship, always).
mitzvah(278, prohibition, not_practice_divination, always).
mitzvah(279, prohibition, not_practice_soothsaying, always).
mitzvah(280, prohibition, not_practice_enchanting, always).
mitzvah(281, prohibition, not_practice_sorcery, always).
mitzvah(282, prohibition, not_practice_charming, always).
mitzvah(283, prohibition, not_consult_ov, always).
mitzvah(284, prohibition, not_consult_yidoni, always).
mitzvah(285, prohibition, not_practice_necromancy, always).
mitzvah(286, prohibition, not_cross_dress_woman_to_man, always).
mitzvah(287, prohibition, not_cross_dress_man_to_woman, always).
mitzvah(288, prohibition, not_tattoo, always).
mitzvah(289, prohibition, not_wear_shaatnez, always).
mitzvah(290, prohibition, not_shave_temples, always).
mitzvah(291, prohibition, not_destroy_beard_edges, always).
mitzvah(292, prohibition, not_cut_for_dead, always).
mitzvah(293, prohibition, not_settle_in_egypt, always).
mitzvah(294, prohibition, not_follow_heart_and_eyes, always).
mitzvah(295, prohibition, not_make_covenant_with_seven_nations, always).
mitzvah(296, prohibition, not_show_mercy_to_idolaters, always).
mitzvah(297, prohibition, not_allow_idolaters_in_land, always).
mitzvah(298, prohibition, not_intermarry_with_seven_nations, always).
mitzvah(299, prohibition, not_intermarry_male_moabite, always).
mitzvah(300, prohibition, not_make_peace_with_ammon_moab, always).
%% --- PROHIBITIONS RELATING TO HASHEM AND TORAH (301-320) ---
mitzvah(301, prohibition, not_destroy_ammonite_edomite_third_gen, always).
mitzvah(302, prohibition, not_reject_egyptian_convert_third_gen, always).
mitzvah(303, prohibition, not_offer_peace_to_ammon_moab, always).
mitzvah(304, prohibition, not_destroy_fruit_trees_in_siege, always).
mitzvah(305, prohibition, not_fear_enemy_in_battle, always).
mitzvah(306, prohibition, not_forget_amalek, always).
mitzvah(307, prohibition, not_blaspheme_hashem, always).
mitzvah(308, prohibition, not_break_oath, always).
mitzvah(309, prohibition, not_take_name_in_vain, always).
mitzvah(310, prohibition, not_profane_the_name, always).
mitzvah(311, prohibition, not_test_hashem, always).
mitzvah(312, prohibition, not_destroy_holy_things, always).
mitzvah(313, prohibition, not_cease_guarding_temple, always).
mitzvah(314, prohibition, kohen_gadol_not_enter_kodesh_always, when(temple_standing)).
mitzvah(315, prohibition, kohen_with_blemish_not_enter, when(temple_standing)).
mitzvah(316, prohibition, kohen_with_blemish_not_serve, when(temple_standing)).
mitzvah(317, prohibition, kohen_with_temporary_blemish_not_serve, when(temple_standing)).
mitzvah(318, prohibition, levites_not_do_kohen_work, when(temple_standing)).
mitzvah(319, prohibition, kohanim_not_do_levite_work, when(temple_standing)).
mitzvah(320, prohibition, not_enter_sanctuary_intoxicated, when(temple_standing)).
%% --- OFFERINGS AND SACRED THINGS (321-370) ---
mitzvah(321, prohibition, zar_not_serve_in_temple, when(temple_standing)).
mitzvah(322, prohibition, tamei_kohen_not_serve, when(temple_standing)).
mitzvah(323, prohibition, kohen_who_immersed_wait_sunset, when(temple_standing)).
mitzvah(324, prohibition, tamei_not_enter_temple, when(temple_standing)).
mitzvah(325, prohibition, tamei_not_enter_temple_mount, when(temple_standing)).
mitzvah(326, prohibition, not_build_altar_of_hewn_stone, when(temple_standing)).
mitzvah(327, prohibition, not_ascend_altar_by_steps, when(temple_standing)).
mitzvah(328, prohibition, not_extinguish_altar_fire, when(temple_standing)).
mitzvah(329, prohibition, not_burn_incense_on_golden_altar_except, when(temple_standing)).
mitzvah(330, prohibition, not_make_oil_like_anointing_oil, always).
mitzvah(331, prohibition, not_make_incense_like_ketoret, always).
mitzvah(332, prohibition, not_anoint_with_shemen_hamishchah, always).
mitzvah(333, prohibition, not_remove_staves_from_aron, always).
mitzvah(334, prohibition, not_remove_choshen_from_ephod, always).
mitzvah(335, prohibition, not_tear_me_il, always).
mitzvah(336, prohibition, not_offer_blemished_animal, when(offering)).
mitzvah(337, prohibition, not_slaughter_blemished_animal, when(offering)).
mitzvah(338, prohibition, not_sprinkle_blood_of_blemished, when(offering)).
mitzvah(339, prohibition, not_burn_fats_of_blemished, when(offering)).
mitzvah(340, prohibition, not_offer_temporarily_blemished, when(offering)).
mitzvah(341, prohibition, not_offer_blemished_from_gentile, when(offering)).
mitzvah(342, prohibition, not_make_blemish_in_consecrated, when(offering)).
mitzvah(343, prohibition, not_offer_leaven_or_honey, when(offering)).
mitzvah(344, prohibition, not_offer_without_salt, when(offering)).
mitzvah(345, prohibition, not_offer_etnan_or_mechir, when(offering)).
mitzvah(346, prohibition, not_slaughter_animal_and_young_same_day, always).
mitzvah(347, prohibition, not_put_oil_on_chatat_minchah, when(offering)).
mitzvah(348, prohibition, not_put_levonah_on_chatat_minchah, when(offering)).
mitzvah(349, prohibition, not_put_oil_on_sotah_minchah, when(offering)).
mitzvah(350, prohibition, not_put_levonah_on_sotah_minchah, when(offering)).
mitzvah(351, prohibition, not_exchange_consecrated_animal, when(offering)).
mitzvah(352, prohibition, not_change_designation_of_offering, when(offering)).
mitzvah(353, prohibition, not_redeem_firstborn_animal, when(firstborn)).
mitzvah(354, prohibition, not_sell_maaser_behemah, when(animal_tithe)).
mitzvah(355, prohibition, not_sell_cherem_field, always).
mitzvah(356, prohibition, not_sell_cherem_field_of_levites, always).
mitzvah(357, prohibition, not_cut_head_of_eglah_arufah_nape, when(eglah_arufah)).
mitzvah(358, prohibition, not_sow_or_prune_ir_hanidachat, always).
mitzvah(359, prohibition, not_eat_offerings_of_lesser_sanctity_before_blood, when(offering)).
mitzvah(360, prohibition, kohen_not_eat_bikurim_outside_jerusalem, when(temple)).
mitzvah(361, prohibition, not_eat_chatat_outside_temple, when(temple)).
mitzvah(362, prohibition, not_eat_olah_meat, when(offering)).
mitzvah(363, prohibition, not_eat_kodshei_kalim_before_blood, when(offering)).
mitzvah(364, prohibition, zar_not_eat_terumah, always).
mitzvah(365, prohibition, kohen_tenant_not_eat_terumah, always).
mitzvah(366, prohibition, uncircumcised_not_eat_terumah, always).
mitzvah(367, prohibition, tamei_kohen_not_eat_terumah, always).
mitzvah(368, prohibition, chalalah_not_eat_terumah, always).
mitzvah(369, prohibition, not_eat_tevel, always).
mitzvah(370, prohibition, not_eat_maaser_sheni_in_tumah, always).
%% --- FOOD AND KASHRUT (371-420) ---
mitzvah(371, prohibition, not_eat_maaser_sheni_while_onen, always).
mitzvah(372, prohibition, not_spend_maaser_sheni_on_dead, always).
mitzvah(373, prohibition, not_eat_fourth_year_fruit_unredeemed, always).
mitzvah(374, prohibition, not_eat_chametz_on_pesach, when(pesach)).
mitzvah(375, prohibition, not_eat_chametz_mixture_on_pesach, when(pesach)).
mitzvah(376, prohibition, not_see_chametz_in_possession, when(pesach)).
mitzvah(377, prohibition, not_find_chametz_in_possession, when(pesach)).
mitzvah(378, prohibition, nazirite_not_drink_wine, when(nazirite_vow)).
mitzvah(379, prohibition, nazirite_not_eat_grapes, when(nazirite_vow)).
mitzvah(380, prohibition, nazirite_not_eat_raisins, when(nazirite_vow)).
mitzvah(381, prohibition, nazirite_not_eat_grape_seeds, when(nazirite_vow)).
mitzvah(382, prohibition, nazirite_not_eat_grape_skins, when(nazirite_vow)).
mitzvah(383, prohibition, nazirite_not_become_tamei, when(nazirite_vow)).
mitzvah(384, prohibition, nazirite_not_enter_tent_of_dead, when(nazirite_vow)).
mitzvah(385, prohibition, nazirite_not_shave, when(nazirite_vow)).
mitzvah(386, prohibition, not_harvest_entire_field, when(harvest)).
mitzvah(387, prohibition, not_gather_gleanings, when(harvest)).
mitzvah(388, prohibition, not_harvest_unformed_grape_clusters, when(grape_harvest)).
mitzvah(389, prohibition, not_gather_fallen_grapes, when(grape_harvest)).
mitzvah(390, prohibition, not_return_for_forgotten_sheaf, when(harvest)).
mitzvah(391, prohibition, not_sow_mixed_seeds, always).
mitzvah(392, prohibition, not_sow_grain_in_vineyard, always).
mitzvah(393, prohibition, not_crossbreed_animals, always).
mitzvah(394, prohibition, not_plow_with_ox_and_donkey, always).
mitzvah(395, prohibition, not_muzzle_working_animal, always).
mitzvah(396, prohibition, not_work_land_in_shmitah, when(seventh_year)).
mitzvah(397, prohibition, not_prune_trees_in_shmitah, when(seventh_year)).
mitzvah(398, prohibition, not_harvest_shmitah_as_normal, when(seventh_year)).
mitzvah(399, prohibition, not_harvest_grapes_in_shmitah_as_normal, when(seventh_year)).
mitzvah(400, prohibition, not_work_land_in_yovel, when(fiftieth_year)).
mitzvah(401, prohibition, not_harvest_yovel_as_normal, when(fiftieth_year)).
mitzvah(402, prohibition, not_harvest_grapes_yovel_as_normal, when(fiftieth_year)).
mitzvah(403, prohibition, not_sell_land_permanently, always).
mitzvah(404, prohibition, not_change_levite_city_fields, always).
mitzvah(405, prohibition, not_forsake_levites, always).
mitzvah(406, prohibition, not_demand_debt_in_shmitah, when(seventh_year)).
mitzvah(407, prohibition, not_refrain_from_lending_before_shmitah, always).
mitzvah(408, prohibition, not_withhold_charity, always).
mitzvah(409, prohibition, not_send_hebrew_slave_empty, when(slave_freed)).
mitzvah(410, prohibition, not_charge_interest_to_jew, always).
mitzvah(411, prohibition, not_facilitate_interest_loan, always).
mitzvah(412, prohibition, not_oppress_debtor, always).
mitzvah(413, prohibition, not_take_pledge_by_force, always).
mitzvah(414, prohibition, not_keep_pledge_from_poor_overnight, always).
mitzvah(415, prohibition, not_take_pledge_from_widow, always).
mitzvah(416, prohibition, not_take_food_utensils_as_pledge, always).
mitzvah(417, prohibition, not_kidnap, always).
mitzvah(418, prohibition, not_steal, always).
mitzvah(419, prohibition, not_rob, always).
mitzvah(420, prohibition, not_move_boundary_marker, always).
%% --- JUSTICE AND TESTIMONY (421-460) ---
mitzvah(421, prohibition, not_deny_debt, always).
mitzvah(422, prohibition, not_swear_falsely_about_property, always).
mitzvah(423, prohibition, not_wrong_in_commerce, always).
mitzvah(424, prohibition, not_wrong_with_words, always).
mitzvah(425, prohibition, not_wrong_convert_in_commerce, always).
mitzvah(426, prohibition, not_wrong_convert_with_words, always).
mitzvah(427, prohibition, not_return_slave_to_master, always).
mitzvah(428, prohibition, not_oppress_escaped_slave, always).
mitzvah(429, prohibition, not_afflict_widow_orphan, always).
mitzvah(430, prohibition, not_work_hebrew_slave_harshly, always).
mitzvah(431, prohibition, not_sell_hebrew_slave_publicly, always).
mitzvah(432, prohibition, not_work_hebrew_slave_degradingly, always).
mitzvah(433, prohibition, not_sell_captured_woman, always).
mitzvah(434, prohibition, not_enslave_captured_woman, always).
mitzvah(435, prohibition, not_delay_wages, always).
mitzvah(436, prohibition, not_take_security_from_debtor_employer, always).
mitzvah(437, prohibition, not_have_false_weights, always).
mitzvah(438, prohibition, not_have_false_measures, always).
mitzvah(439, prohibition, judge_not_be_unjust, always).
mitzvah(440, prohibition, judge_not_accept_bribe, always).
mitzvah(441, prohibition, judge_not_favor_powerful, always).
mitzvah(442, prohibition, judge_not_pervert_poor_case, always).
mitzvah(443, prohibition, judge_not_pervert_case_of_sinner, always).
mitzvah(444, prohibition, judge_not_show_pity_to_poor_in_judgment, always).
mitzvah(445, prohibition, not_pervert_convert_orphan_judgment, always).
mitzvah(446, prohibition, not_hear_one_side_without_other, always).
mitzvah(447, prohibition, not_convict_on_one_witness, always).
mitzvah(448, prohibition, not_appoint_unqualified_judge, always).
mitzvah(449, prohibition, not_bear_false_witness, always).
mitzvah(450, prohibition, not_follow_majority_for_evil, when(court_deliberation)).
mitzvah(451, prohibition, judge_not_follow_senior_in_capital, when(capital_case)).
mitzvah(452, prohibition, not_decide_capital_by_one_vote, when(capital_case)).
mitzvah(453, prohibition, accuser_not_become_advocate, when(capital_case)).
mitzvah(454, prohibition, not_punish_one_forced, always).
mitzvah(455, prohibition, not_punish_based_on_circumstantial_evidence, always).
mitzvah(456, prohibition, not_accept_ransom_for_murderer, always).
mitzvah(457, prohibition, not_accept_ransom_for_accidental_killer, always).
mitzvah(458, prohibition, not_testify_in_own_cause, always).
mitzvah(459, prohibition, not_curse_judge, always).
mitzvah(460, prohibition, not_curse_nasi, always).
%% --- MURDER, INJURY AND HARM (461-490) ---
mitzvah(461, prohibition, not_murder, always).
mitzvah(462, prohibition, not_strike_parent, always).
mitzvah(463, prohibition, not_curse_parent, always).
mitzvah(464, prohibition, not_curse_any_jew, always).
mitzvah(465, prohibition, not_put_stumbling_block_before_blind, always).
mitzvah(466, prohibition, not_strike_fellow_jew, always).
mitzvah(467, prohibition, not_cause_death_of_innocent, always).
mitzvah(468, prohibition, not_stand_idly_by_blood, always).
mitzvah(469, prohibition, not_leave_dangerous_hazard, always).
mitzvah(470, prohibition, not_mislead_with_bad_advice, always).
mitzvah(471, prohibition, not_punish_more_than_prescribed, always).
mitzvah(472, prohibition, not_gossip, always).
mitzvah(473, prohibition, not_hate_in_heart, always).
mitzvah(474, prohibition, not_shame_fellow_publicly, always).
mitzvah(475, prohibition, not_take_revenge, always).
mitzvah(476, prohibition, not_bear_grudge, always).
mitzvah(477, prohibition, not_take_mother_bird_with_young, when(birds_nest)).
mitzvah(478, prohibition, not_cause_unnecessary_suffering_to_animals, always).
mitzvah(479, prohibition, not_leave_animal_fallen_under_load, always).
mitzvah(480, prohibition, not_castrate_any_creature, always).
mitzvah(481, prohibition, not_offer_damaged_animal, when(offering)).
mitzvah(482, prohibition, not_damage_fruit_trees_in_war, when(siege)).
mitzvah(483, prohibition, metzora_not_shave_signs, always).
mitzvah(484, prohibition, not_pull_out_tzaraat_signs, always).
mitzvah(485, prohibition, not_plow_valley_of_eglah_arufah, when(eglah_arufah)).
mitzvah(486, prohibition, killer_not_leave_refuge_before_kohen_gadol_dies, when(in_refuge)).
mitzvah(487, prohibition, avenger_not_kill_accidental_slayer_in_refuge, always).
mitzvah(488, prohibition, not_withhold_testimony, always).
mitzvah(489, prohibition, not_fail_to_save_pursued, when(pursuit)).
mitzvah(490, prohibition, not_destroy_anything_needlessly, always).
%% --- FORBIDDEN RELATIONS (491-550) ---
mitzvah(491, prohibition, not_commit_adultery, always).
mitzvah(492, prohibition, not_have_relations_with_mother, always).
mitzvah(493, prohibition, not_have_relations_with_fathers_wife, always).
mitzvah(494, prohibition, not_have_relations_with_sister, always).
mitzvah(495, prohibition, not_have_relations_with_half_sister_mother, always).
mitzvah(496, prohibition, not_have_relations_with_sons_daughter, always).
mitzvah(497, prohibition, not_have_relations_with_daughter, always).
mitzvah(498, prohibition, not_have_relations_with_daughters_daughter, always).
mitzvah(499, prohibition, not_marry_woman_and_daughter, always).
mitzvah(500, prohibition, not_marry_woman_and_sons_daughter, always).
mitzvah(501, prohibition, not_marry_woman_and_daughters_daughter, always).
mitzvah(502, prohibition, not_have_relations_with_fathers_sister, always).
mitzvah(503, prohibition, not_have_relations_with_mothers_sister, always).
mitzvah(504, prohibition, not_have_relations_with_fathers_brothers_wife, always).
mitzvah(505, prohibition, not_have_relations_with_sons_wife, always).
mitzvah(506, prohibition, not_have_relations_with_brothers_wife, always).
mitzvah(507, prohibition, not_have_relations_with_wifes_sister, always).
mitzvah(508, prohibition, not_have_relations_with_animal, always).
mitzvah(509, prohibition, woman_not_have_relations_with_animal, always).
mitzvah(510, prohibition, not_have_homosexual_relations, always).
mitzvah(511, prohibition, not_have_relations_with_fathers_brother, always).
mitzvah(512, prohibition, not_have_relations_with_married_woman, always).
mitzvah(513, prohibition, not_have_relations_with_niddah, always).
mitzvah(514, prohibition, not_intermarry, always).
mitzvah(515, prohibition, ammonite_male_not_marry_into_congregation, always).
mitzvah(516, prohibition, mamzer_not_marry_into_congregation, always).
mitzvah(517, prohibition, eunuch_not_marry_into_congregation, always).
mitzvah(518, prohibition, not_castrate_man, always).
mitzvah(519, prohibition, kohen_gadol_not_marry_widow, always).
mitzvah(520, prohibition, kohen_gadol_not_have_relations_with_widow, always).
mitzvah(521, prohibition, kohen_not_marry_divorcee, always).
mitzvah(522, prohibition, kohen_not_marry_zonah, always).
mitzvah(523, prohibition, kohen_not_marry_chalalah, always).
mitzvah(524, prohibition, not_approach_arayot, always).
mitzvah(525, prohibition, not_have_relations_outside_marriage, always).
mitzvah(526, prohibition, not_remarry_divorced_wife_after_remarriage, always).
mitzvah(527, prohibition, childless_brothers_wife_not_marry_outside, when(yibum_applies)).
mitzvah(528, prohibition, rapist_not_divorce_victim, when(rape_case)).
mitzvah(529, prohibition, motzi_shem_ra_not_divorce, when(false_accusation)).
mitzvah(530, prohibition, seris_not_marry_jewess, always).
mitzvah(531, prohibition, not_have_relations_with_animal_female, always).
mitzvah(532, prohibition, maintain_boundaries, always).
mitzvah(533, prohibition, kohen_gadol_not_marry_non_virgin, always).
mitzvah(534, prohibition, kohen_not_become_tamei_except_relatives, always).
mitzvah(535, prohibition, kohen_gadol_not_become_tamei_at_all, always).
mitzvah(536, prohibition, kohen_gadol_not_be_under_same_roof_as_dead, always).
mitzvah(537, prohibition, levite_not_abandon_post, when(temple_standing)).
mitzvah(538, prohibition, not_prophesy_what_not_heard, always).
mitzvah(539, prohibition, not_refrain_from_killing_false_prophet, always).
mitzvah(540, prohibition, not_fear_killing_false_prophet, always).
mitzvah(541, prohibition, not_swear_falsely, always).
mitzvah(542, prohibition, not_delay_vow_fulfillment, always).
mitzvah(543, prohibition, not_break_oath, always).
mitzvah(544, prohibition, not_vow_in_anger, always).
mitzvah(545, prohibition, not_let_kohen_become_tamei_unnecessarily, always).
mitzvah(546, prohibition, not_offer_anything_on_private_altar, when(temple_standing)).
mitzvah(547, prohibition, not_slaughter_offering_outside_temple, when(temple_standing)).
mitzvah(548, prohibition, not_eat_meat_of_offering_with_blemish, when(offering)).
mitzvah(549, prohibition, not_eat_notar, when(offering)).
mitzvah(550, prohibition, not_eat_piggul, when(offering)).
%% --- FOOD PROHIBITIONS (551-600) ---
mitzvah(551, prohibition, not_eat_non_kosher_animal, always).
mitzvah(552, prohibition, not_eat_non_kosher_fish, always).
mitzvah(553, prohibition, not_eat_non_kosher_bird, always).
mitzvah(554, prohibition, not_eat_flying_insect, always).
mitzvah(555, prohibition, not_eat_ground_swarmer, always).
mitzvah(556, prohibition, not_eat_worm_from_fruit_once_emerged, always).
mitzvah(557, prohibition, not_eat_water_swarmer, always).
mitzvah(558, prohibition, not_eat_nevelah, always).
mitzvah(559, prohibition, not_eat_treifah, always).
mitzvah(560, prohibition, not_eat_limb_from_living, always).
mitzvah(561, prohibition, not_eat_blood, always).
mitzvah(562, prohibition, not_eat_certain_fats, always).
mitzvah(563, prohibition, not_eat_gid_hanasheh, always).
mitzvah(564, prohibition, not_eat_meat_and_milk, always).
mitzvah(565, prohibition, not_cook_meat_and_milk, always).
mitzvah(566, prohibition, not_eat_bread_from_new_grain_before_omer, when(before_omer)).
mitzvah(567, prohibition, not_eat_roasted_from_new_grain_before_omer, when(before_omer)).
mitzvah(568, prohibition, not_eat_fresh_from_new_grain_before_omer, when(before_omer)).
mitzvah(569, prohibition, not_eat_orlah_fruit, when(first_three_years)).
mitzvah(570, prohibition, not_eat_kilei_hakerem, always).
mitzvah(571, prohibition, not_drink_wine_of_libation, always).
mitzvah(572, prohibition, not_eat_or_drink_gluttonously, always).
mitzvah(573, prohibition, not_eat_on_yom_kippur, when(yom_kippur)).
mitzvah(574, prohibition, not_eat_chametz_during_pesach, when(pesach)).
mitzvah(575, prohibition, not_eat_chametz_mixture_pesach, when(pesach)).
mitzvah(576, prohibition, not_eat_chametz_after_midday_14_nisan, when(fourteen_nisan)).
mitzvah(577, prohibition, not_see_chametz, when(pesach)).
mitzvah(578, prohibition, not_find_chametz, when(pesach)).
mitzvah(579, prohibition, nazirite_not_eat_grape_product, when(nazirite)).
mitzvah(580, prohibition, nazirite_not_eat_grapes, when(nazirite)).
mitzvah(581, prohibition, nazirite_not_eat_raisins, when(nazirite)).
mitzvah(582, prohibition, nazirite_not_eat_seeds, when(nazirite)).
mitzvah(583, prohibition, nazirite_not_eat_skins, when(nazirite)).
mitzvah(584, prohibition, nazirite_not_drink_wine, when(nazirite)).
mitzvah(585, prohibition, nazirite_not_cut_hair, when(nazirite)).
mitzvah(586, prohibition, nazirite_not_become_tamei, when(nazirite)).
mitzvah(587, prohibition, not_eat_second_tithe_improperly, always).
mitzvah(588, prohibition, kohen_not_eat_first_fruits_outside_jerusalem, when(temple)).
mitzvah(589, prohibition, not_eat_unredeemed_second_tithe, always).
mitzvah(590, prohibition, not_eat_first_tithe_without_terumah_separated, always).
mitzvah(591, prohibition, not_eat_terumah_while_tamei, always).
mitzvah(592, prohibition, non_kohen_not_eat_terumah, always).
mitzvah(593, prohibition, kohen_tenant_not_eat_terumah, always).
mitzvah(594, prohibition, uncircumcised_kohen_not_eat_terumah, always).
mitzvah(595, prohibition, not_eat_tamei_terumah, always).
mitzvah(596, prohibition, not_eat_tevel, always).
mitzvah(597, prohibition, not_eat_second_tithe_while_tamei, always).
mitzvah(598, prohibition, not_eat_second_tithe_as_onen, always).
mitzvah(599, prohibition, not_spend_second_tithe_redemption_on_dead, always).
mitzvah(600, prohibition, not_eat_pesach_offering_raw, when(pesach)).
%% --- REMAINING PROHIBITIONS (601-613) ---
mitzvah(601, prohibition, not_take_pesach_outside_group, when(pesach)).
mitzvah(602, prohibition, not_break_bone_of_pesach, when(pesach)).
mitzvah(603, prohibition, uncircumcised_not_eat_pesach, when(pesach)).
mitzvah(604, prohibition, apostate_not_eat_pesach, when(pesach)).
mitzvah(605, prohibition, gentile_not_eat_pesach, when(pesach)).
mitzvah(606, prohibition, not_leave_pesach_to_morning, when(pesach)).
mitzvah(607, prohibition, not_leave_festival_offering_to_third_day, when(festival)).
mitzvah(608, prohibition, not_leave_second_pesach_to_morning, when(pesach_sheni)).
mitzvah(609, prohibition, not_leave_todah_to_morning, when(offering)).
mitzvah(610, prohibition, not_break_bone_of_second_pesach, when(pesach_sheni)).
mitzvah(611, prohibition, not_eat_kohen_chatat_burned_inside, when(offering)).
mitzvah(612, prohibition, not_eat_disqualified_offering, when(offering)).
mitzvah(613, prohibition, not_eat_sanctified_that_became_tamei, when(offering)).
%% ============================================================
%% SOURCE REFERENCES
%% ============================================================
%% Key mitzvot grounded in Torah verses
%% mitzvah_source(ID, VerseRef) — where in Torah this mitzvah is grounded
%% Beliefs and Foundations
mitzvah_source(1, ref(shemot, 20, 2)). % Anochi Hashem Elokecha
mitzvah_source(2, ref(shemot, 20, 3)). % Lo yihyeh lecha
mitzvah_source(3, ref(devarim, 6, 4)). % Shema Yisrael
mitzvah_source(4, ref(devarim, 6, 5)). % V'ahavta
mitzvah_source(5, ref(devarim, 6, 13)). % Et Hashem Elokecha tira
mitzvah_source(154, ref(shemot, 20, 8)). % Zachor et yom haShabbat
mitzvah_source(155, ref(shemot, 20, 10)). % Lo ta'aseh kol melachah
mitzvah_source(175, ref(devarim, 16, 18)). % Shoftim v'shotrim
mitzvah_source(289, ref(shemot, 20, 13)). % Lo tirtzach
mitzvah_source(330, ref(shemot, 20, 14)). % Lo tinaf
mitzvah_source(247, ref(shemot, 20, 15)). % Lo tignov
mitzvah_source(285, ref(shemot, 20, 16)). % Lo ta'aneh
mitzvah_source(243, ref(shemot, 20, 17)). % Lo tachmod
mitzvah_source(134, ref(shemot, 23, 11)). % V'hashvi'it tishm'tenah
mitzvah_source(62, ref(vayikra, 1, 3)). % Olah
mitzvah_source(64, ref(vayikra, 4, 27)). % Chatat
mitzvah_source(125, ref(devarim, 26, 2)). % Bikurim
mitzvah_source(126, ref(devarim, 26, 5)). % Arami oved avi
mitzvah_source(295, ref(devarim, 25, 12)). % Save the pursued
mitzvah_source(2, ref(devarim, 6, 4)). % Shema Yisrael — unity
mitzvah_source(3, ref(devarim, 6, 5)). % V'ahavta — love
mitzvah_source(4, ref(devarim, 6, 13)). % Et Hashem Elokecha tira — fear
mitzvah_source(5, ref(shemot, 23, 25)). % Va'avadetem — prayer
mitzvah_source(6, ref(devarim, 10, 20)). % U'vo tidbak — cleave
mitzvah_source(9, ref(vayikra, 22, 32)). % V'nikdashti — sanctify
mitzvah_source(10, ref(devarim, 6, 7)). % V'shinantam — shema
mitzvah_source(11, ref(devarim, 6, 7)). % V'shinantam — study
%% Torah objects
mitzvah_source(13, ref(devarim, 6, 8)). % Tefillin
mitzvah_source(15, ref(bamidbar, 15, 38)). % Tzitzit
mitzvah_source(16, ref(devarim, 6, 9)). % Mezuzah
mitzvah_source(18, ref(devarim, 31, 19)). % Write Torah
%% Temple and Sanctuary
mitzvah_source(20, ref(shemot, 25, 8)). % V'asu li mikdash
mitzvah_source(26, ref(bamidbar, 6, 23)). % Birkat kohanim
%% Offerings
mitzvah_source(64, ref(vayikra, 1, 3)). % Olah
mitzvah_source(65, ref(vayikra, 4, 27)). % Chatat
mitzvah_source(68, ref(vayikra, 3, 1)). % Shelamim
%% Agriculture
mitzvah_source(114, ref(bamidbar, 18, 12)). % Terumah
mitzvah_source(122, ref(shemot, 23, 11)). % Shmitah
mitzvah_source(125, ref(devarim, 26, 2)). % Bikurim
mitzvah_source(126, ref(devarim, 26, 5)). % Arami oved avi
mitzvah_source(128, ref(vayikra, 19, 9)). % Pe'ah
mitzvah_source(136, ref(vayikra, 23, 15)). % Count omer
%% Shabbat and Festivals
mitzvah_source(138, ref(shemot, 12, 18)). % Matzah
mitzvah_source(139, ref(shemot, 13, 8)). % Tell exodus
mitzvah_source(149, ref(vayikra, 23, 42)). % Sukkah
mitzvah_source(150, ref(vayikra, 23, 40)). % Lulav
mitzvah_source(151, ref(bamidbar, 29, 1)). % Shofar
mitzvah_source(154, ref(shemot, 20, 8)). % Zachor — Shabbat rest
mitzvah_source(155, ref(shemot, 20, 8)). % Kiddush
mitzvah_source(161, ref(bereishit, 17, 10)). % Circumcision
%% Justice
mitzvah_source(165, ref(devarim, 16, 18)). % Shoftim v'shotrim
mitzvah_source(178, ref(devarim, 16, 20)). % Tzedek tzedek tirdof
%% Interpersonal
mitzvah_source(181, ref(devarim, 15, 8)). % Open your hand
mitzvah_source(191, ref(vayikra, 19, 17)). % Rebuke
mitzvah_source(192, ref(vayikra, 19, 18)). % Love your neighbor
mitzvah_source(196, ref(shemot, 20, 12)). % Honor parents
mitzvah_source(241, ref(bamidbar, 35, 11)). % Cities of refuge
mitzvah_source(248, ref(devarim, 4, 9)). % Guard your life
%% Key Prohibitions
mitzvah_source(249, ref(shemot, 20, 3)). % Lo yihyeh lecha — no other gods
mitzvah_source(250, ref(shemot, 20, 4)). % Lo ta'aseh — no idols
mitzvah_source(289, ref(devarim, 22, 11)). % Shaatnez
mitzvah_source(307, ref(shemot, 22, 27)). % Not blaspheme
mitzvah_source(309, ref(shemot, 20, 7)). % Not take name in vain
mitzvah_source(310, ref(vayikra, 22, 32)). % Not profane the name
mitzvah_source(374, ref(shemot, 13, 3)). % Not eat chametz
mitzvah_source(418, ref(vayikra, 19, 11)). % Not steal
mitzvah_source(420, ref(devarim, 19, 14)). % Not move boundary
mitzvah_source(439, ref(vayikra, 19, 15)). % Judge not unjust
mitzvah_source(440, ref(shemot, 23, 8)). % Not accept bribe
mitzvah_source(449, ref(shemot, 20, 16)). % Not bear false witness
mitzvah_source(461, ref(shemot, 20, 13)). % Not murder
mitzvah_source(468, ref(vayikra, 19, 16)). % Not stand by blood
mitzvah_source(472, ref(vayikra, 19, 16)). % Not gossip
mitzvah_source(473, ref(vayikra, 19, 17)). % Not hate in heart
mitzvah_source(475, ref(vayikra, 19, 18)). % Not take revenge
mitzvah_source(491, ref(shemot, 20, 14)). % Not commit adultery
mitzvah_source(532, ref(vayikra, 18, 6)). % Maintain boundaries
mitzvah_source(551, ref(vayikra, 11, 4)). % Not eat non-kosher
mitzvah_source(561, ref(vayikra, 17, 12)). % Not eat blood
mitzvah_source(564, ref(shemot, 23, 19)). % Not eat meat and milk
%% ============================================================
%% QUERIES
@@ -172,6 +785,6 @@ mitzvah_source(295, ref(devarim, 25, 12)). % Save the pursued
mitzvah_category_count(Category, Count) :-
aggregate_all(count, mitzvah(_, Category, _, _), Count).
%% Total encoded in this Phase 1 subset
%% Total encoded
total_encoded(Count) :-
aggregate_all(count, mitzvah(_, _, _, _), Count).
@@ -3,6 +3,9 @@
%% These relationships encode structural connections between
%% commandments and between roots that the reasoning engine
%% uses for interpretation and challenge generation.
%%
%% Phase 3: Updated for full 613 mitzvot numbering.
%% Positive: 1-248, Prohibition: 249-613.
:- module(relationships, [
mitzvah_grounds/2,
@@ -10,7 +13,8 @@
root_shares_consonants/3,
mitzvah_domain/2,
complementary_mitzvot/2,
domain_mitzvot/2
domain_mitzvot/2,
action_domain/2
]).
:- use_module(mitzvot).
@@ -33,26 +37,38 @@ mitzvah_grounds(MitzvahID, ref(Book, Ch, Vs)) :-
%% These are not errors — they are productive tensions
%% that the dialectical engine resolves or marks teiku.
%% Justice vs mercy
mitzvah_conflicts_with(179, 295,
%% Justice vs mercy — judge_righteously(178) vs not_fail_to_save_pursued(489)
mitzvah_conflicts_with(178, 489,
'Judging righteously may conflict with saving the pursued when the pursued is also guilty').
%% Following majority vs preventing evil
mitzvah_conflicts_with(181, 182,
%% Following majority vs preventing evil — follow_majority(175) vs not_follow_majority_for_evil(450)
mitzvah_conflicts_with(175, 450,
'Following the majority in court conflicts with not following the majority for evil').
%% Sanctifying the name vs preserving life
mitzvah_conflicts_with(6, 289,
%% Sanctifying the name vs preserving life — sanctify_the_name(9) vs not_murder(461)
mitzvah_conflicts_with(9, 461,
'Sanctifying the name through martyrdom conflicts with the prohibition against allowing death').
%% Shabbat rest vs saving life (pikuach nefesh)
mitzvah_conflicts_with(155, 295,
'Not working on Shabbat conflicts with saving the pursued when rescue requires work').
%% Shabbat rest vs saving life (pikuach nefesh) — rest_on_shabbat(154) vs not_stand_idly_by_blood(468)
mitzvah_conflicts_with(154, 468,
'Resting on Shabbat conflicts with not standing idly by when life is threatened').
%% Loving your neighbor vs administering justice
mitzvah_conflicts_with(4, 179,
%% Loving your neighbor vs administering justice — love_fellow_jew(192) vs judge_righteously(178)
mitzvah_conflicts_with(192, 178,
'Love may conflict with righteous judgment when judgment causes pain to the beloved').
%% Charity vs self-preservation — give_tzedakah(181) vs guard_ones_life(248)
mitzvah_conflicts_with(181, 248,
'Obligation to give charity conflicts with protecting ones own sustenance').
%% Rebuke vs not shaming — rebuke_sinner(191) vs not_shame_fellow_publicly(474)
mitzvah_conflicts_with(191, 474,
'Obligation to rebuke a sinner conflicts with prohibition against public shaming').
%% King obedience vs not following idolatry — obey_king(218) vs no_other_gods(249)
mitzvah_conflicts_with(218, 249,
'Obeying the king conflicts with prohibition of idolatry when king commands worship of other gods').
%% ============================================================
%% ROOT RELATIONSHIPS — consonant sharing
%% ============================================================
@@ -82,17 +98,17 @@ action_domain(love_hashem, covenant).
action_domain(fear_hashem, authority).
action_domain(sanctify_the_name, holiness).
action_domain(not_profane_the_name, holiness).
action_domain(hear_shema, knowledge).
action_domain(read_shema, knowledge).
action_domain(study_torah, knowledge).
action_domain(rest_on_shabbat, holiness).
action_domain(not_work_on_shabbat, holiness).
action_domain(sanctify_shabbat, holiness).
action_domain(appoint_judges, judgment).
action_domain(not_judge_unjustly, judgment).
action_domain(judge_not_be_unjust, judgment).
action_domain(judge_righteously, judgment).
action_domain(not_murder, death).
action_domain(not_cause_death_of_innocent, death).
action_domain(save_the_pursued, mercy).
action_domain(not_fail_to_save_pursued, mercy).
action_domain(not_stand_idly_by_blood, mercy).
action_domain(not_commit_adultery, transgression).
action_domain(maintain_boundaries, separation).
action_domain(not_bear_false_witness, speech).
@@ -101,26 +117,51 @@ action_domain(not_steal, transgression).
action_domain(bring_olah, offering).
action_domain(bring_chatat, offering).
action_domain(bring_bikurim, offering).
action_domain(love_fellow_jew, covenant).
action_domain(rebuke_sinner, covenant).
action_domain(not_gossip, speech).
action_domain(not_hate_in_heart, covenant).
action_domain(give_tzedakah, mercy).
action_domain(not_shame_fellow_publicly, speech).
action_domain(not_take_revenge, covenant).
action_domain(not_bear_grudge, covenant).
action_domain(guard_ones_life, mercy).
action_domain(not_eat_blood, holiness).
action_domain(not_eat_meat_and_milk, holiness).
action_domain(not_make_idols, holiness).
action_domain(not_worship_idols_their_way, holiness).
action_domain(follow_majority_in_court, judgment).
action_domain(not_follow_majority_for_evil, judgment).
action_domain(obey_king, authority).
action_domain(pray_to_hashem, knowledge).
action_domain(teach_torah, knowledge).
action_domain(circumcise_males, covenant).
action_domain(honor_parents, covenant).
action_domain(separate_terumah, offering).
%% ============================================================
%% COMPLEMENTARY MITZVOT — mitzvot that strengthen each other
%% ============================================================
%% complementary_mitzvot(ID1, ID2) — these work together
complementary_mitzvot(1, 3). % know_hashem + unity_of_hashem
complementary_mitzvot(4, 5). % love_hashem + fear_hashem
complementary_mitzvot(154, 156). % rest_on_shabbat + sanctify_shabbat
complementary_mitzvot(175, 179). % appoint_judges + judge_righteously
complementary_mitzvot(289, 295). % not_murder + save_the_pursued
complementary_mitzvot(125, 126). % bring_bikurim + recite_declaration
complementary_mitzvot(1, 2). % know_hashem + unity_of_hashem
complementary_mitzvot(3, 4). % love_hashem + fear_hashem
complementary_mitzvot(154, 155). % rest_on_shabbat + sanctify_shabbat
complementary_mitzvot(165, 178). % appoint_judges + judge_righteously
complementary_mitzvot(461, 489). % not_murder + not_fail_to_save_pursued
complementary_mitzvot(125, 126). % bring_bikurim + recite_declaration
complementary_mitzvot(191, 192). % rebuke_sinner + love_fellow_jew
complementary_mitzvot(181, 248). % give_tzedakah + guard_ones_life
%% Symmetric — explicit reverse facts (no recursive rule, which loops in Prolog)
complementary_mitzvot(3, 1). % unity_of_hashem + know_hashem
complementary_mitzvot(5, 4). % fear_hashem + love_hashem
complementary_mitzvot(156, 154). % sanctify_shabbat + rest_on_shabbat
complementary_mitzvot(179, 175). % judge_righteously + appoint_judges
complementary_mitzvot(295, 289). % save_the_pursued + not_murder
complementary_mitzvot(126, 125). % recite_declaration + bring_bikurim
complementary_mitzvot(2, 1). % unity_of_hashem + know_hashem
complementary_mitzvot(4, 3). % fear_hashem + love_hashem
complementary_mitzvot(155, 154). % sanctify_shabbat + rest_on_shabbat
complementary_mitzvot(178, 165). % judge_righteously + appoint_judges
complementary_mitzvot(489, 461). % not_fail_to_save_pursued + not_murder
complementary_mitzvot(126, 125). % recite_declaration + bring_bikurim
complementary_mitzvot(192, 191). % love_fellow_jew + rebuke_sinner
complementary_mitzvot(248, 181). % guard_ones_life + give_tzedakah
%% ============================================================
%% QUERIES