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 4dcb75ea40
commit 37390bcb8b
19 files changed
+2795 -178

No files matched your search

+74
View File
@@ -0,0 +1,74 @@
%% davar_yatza.pl — Rules 9-11: Exception from a general rule.
%%
%% Rule 9: Davar shehayah biklal veyatza min haklal l'lamed —
%% Something that was in the general and was singled out
%% to teach: it teaches about the entire general, not just itself.
%%
%% Rule 10: Davar shehayah biklal veyatza liton to'an echad —
%% Singled out to teach the same type of law: reduces the severity
%% of the general for that type.
%%
%% Rule 11: Davar shehayah biklal veyatza liton to'an acher —
%% Singled out to teach a different type of law: the exception
%% follows both the general's rules AND its own new rules.
:- module(davar_yatza, [
davar_yatza_llamed/3,
davar_yatza_toan_echad/3,
davar_yatza_toan_acher/3
]).
%% ============================================================
%% RULE 9: EXCEPTION TEACHES ABOUT THE GENERAL
%% ============================================================
%% davar_yatza_llamed(Exception, General, Teaching)
%% The exception teaches about ALL members of the general.
davar_yatza_llamed(
exception(ExceptionItem, Law),
general(GeneralCategory),
teaches(Law, applies_to_all(GeneralCategory))
).
%% Example: The chatat offering has specific blood-sprinkling rules.
%% These rules teach about ALL offerings, not just chatat.
davar_yatza_llamed(
exception(chatat, blood_sprinkling_north),
general(all_offerings),
teaches(blood_sprinkling_north, applies_to_all(all_offerings))
).
%% ============================================================
%% RULE 10: EXCEPTION WITH SAME TYPE OF LAW
%% ============================================================
%% davar_yatza_toan_echad(Exception, General, Modification)
%% Same type of law but singled out = reduces severity for the general.
davar_yatza_toan_echad(
exception(ExceptionItem, SameLaw),
general(GeneralCategory, SameLaw),
reduces(SameLaw, for(GeneralCategory), because(ExceptionItem))
).
%% ============================================================
%% RULE 11: EXCEPTION WITH DIFFERENT TYPE OF LAW
%% ============================================================
%% davar_yatza_toan_acher(Exception, General, DualApplication)
%% Different type of law = exception follows both sets of rules.
davar_yatza_toan_acher(
exception(ExceptionItem, NewLaw),
general(GeneralCategory, OriginalLaw),
dual_rules(ExceptionItem, follows(OriginalLaw), and(NewLaw))
).
%% Example: Metzora singled out from tumah laws with unique procedures.
%% Metzora follows both general tumah laws AND metzora-specific laws.
davar_yatza_toan_acher(
exception(metzora, outside_camp_procedure),
general(tumah, standard_purification),
dual_rules(metzora, follows(standard_purification), and(outside_camp_procedure))
).