Skip to content

Source Attribution

Every normative rule in Mistaber must have complete source attribution. This document specifies the makor chain requirements, citation formats, derivation tracing, and procedures for handling uncertain attributions.

Makor Chain Requirements

Mandatory Citation

All rules that make normative determinations (issur, heter, chiyuv, ptur) require at least one makor/2 declaration:

% REQUIRED - every normative rule needs makor
rule(r_bb_beheima_achiila).
makor(r_bb_beheima_achiila, sa("yd:87:1")).  % Primary source
madrega(r_bb_beheima_achiila, d_oraita).
scope(r_bb_beheima_achiila, mechaber).

asserts(mechaber, issur(achiila, M, d_oraita)) :-
    is_beheima_chalav_mixture(M).

Missing Makor Causes Type Check Failure

The Mistaber type checker rejects normative rules without source attribution:

TypeCheckError: Missing @makor directive for normative rule with head: forbidden

Complete Attribution Chain

A complete attribution chain traces from the Shulchan Aruch codification back through earlier sources:

graph BT
    A[Torah: Shemot 23:19<br/>'Lo tevashel gedi bachalev imo'] --> B[Gemara: Chullin 103b-104a<br/>Three repetitions = three issurim]
    B --> C[Rambam: Maachalot Asurot 9:1<br/>Codified the three prohibitions]
    C --> D[Tur: YD 87<br/>Organized the laws]
    D --> E[Shulchan Aruch: YD 87:1<br/>Final codification]

    style A fill:#e8f5e9
    style E fill:#bbdefb

Encoding the Chain:

rule(r_bb_beheima_achiila).

% Primary source (required)
makor(r_bb_beheima_achiila, sa("yd:87:1")).

% Derivation sources (recommended)
makor(r_bb_beheima_achiila, tur("yd:87")).
makor(r_bb_beheima_achiila, rambam("ma:9:1")).
makor(r_bb_beheima_achiila, gemara("Chullin 103b")).
makor(r_bb_beheima_achiila, torah("Shemot 23:19")).

madrega(r_bb_beheima_achiila, d_oraita).
scope(r_bb_beheima_achiila, mechaber).

Minimum Attribution Requirements

Rule Type Minimum Sources Recommended
D'oraita SA + Gemara SA + Gemara + Rambam + Torah
D'rabanan SA + Gemara SA + Gemara + Rambam
Minhag SA/Rema SA/Rema + Acharonim
Override Rema/Acharonim Rema + Taz/Shach

Citation Format Standards

Primary Source Types

Source Type Function Format Example
sa Shulchan Aruch sa("SECTION:SIMAN:SEIF") sa("yd:87:1")
rema Rema's gloss rema("SECTION:SIMAN:SEIF") rema("yd:87:3")
tur Arba'ah Turim tur("SECTION:SIMAN") tur("yd:87")
rambam Mishneh Torah rambam("HILCHOT:CHAPTER:HALACHA") rambam("ma:9:1")
gemara Talmud Bavli gemara("MASECHET FOLIO") gemara("Chullin 103b")
mishnah Mishnah mishnah("MASECHET CHAPTER:MISHNAH") mishnah("Chullin 8:1")
torah Chumash torah("SEFER CHAPTER:VERSE") torah("Shemot 23:19")

Commentary Source Types

Source Type Function Format Example
beit_yosef Beit Yosef beit_yosef("SECTION:SIMAN") beit_yosef("yd:87")
taz Turei Zahav taz("SECTION:SIMAN:S"K") taz("yd:87:3")
shach Siftei Kohen shach("SECTION:SIMAN:S"K") shach("yd:87:5")
pri_megadim Pri Megadim pri_megadim("SECTION:SIMAN") pri_megadim("yd:87")
mishnah_berurah Mishnah Berurah mishnah_berurah("SIMAN:S"K") mishnah_berurah("yd:87:1")
aruch_hashulchan Aruch HaShulchan aruch_hashulchan("SECTION:SIMAN:SEIF") aruch_hashulchan("yd:87:1")

Section Abbreviations

Abbreviation Full Name Hebrew
yd Yoreh Deah יורה דעה
oc Orach Chaim אורח חיים
eh Even HaEzer אבן העזר
cm Choshen Mishpat חושן משפט
ma Maachalot Asurot מאכלות אסורות

Citation Examples

% Shulchan Aruch Yoreh Deah 87:1
makor(r_example, sa("yd:87:1")).

% Rema on Yoreh Deah 87:3
makor(r_example, rema("yd:87:3")).

% Rambam Hilchot Maachalot Asurot Chapter 9 Halacha 1
makor(r_example, rambam("ma:9:1")).

% Gemara Chullin 103b
makor(r_example, gemara("Chullin 103b")).

% Taz on YD 87 sif katan 3
makor(r_example, taz("yd:87:3")).

% Shach on YD 87 sif katan 5
makor(r_example, shach("yd:87:5")).

% Torah citation
makor(r_example, torah("Shemot 23:19")).

% Mishnah Berurah
makor(r_example, mishnah_berurah("yd:87:1")).

Tracing Derivations

The derives_from Predicate

Use derives_from/2 to trace the logical derivation of a rule:

% Rule derives from earlier source
derives_from(r_bb_beheima_achiila, r_torah_lo_tevashel).
derives_from(r_torah_lo_tevashel, "Torah Shemot 23:19").

% Chain of derivation
% Torah -> Gemara interpretation -> Rambam codification -> SA ruling

Derivation Chain Documentation

Document the reasoning chain in comments:

% ============================================================
% DERIVATION CHAIN: Beheima + Chalav Issur Achiila
% ============================================================
%
% 1. TORAH SOURCE:
%    "Lo tevashel gedi bachalev imo" (Shemot 23:19)
%    Repeated three times in Torah (Shemot 23:19, 34:26; Devarim 14:21)
%
% 2. GEMARA DERIVATION (Chullin 103b-104a):
%    The three repetitions teach three prohibitions:
%    - Bishul (cooking)
%    - Achiila (eating)
%    - Hanaah (benefit)
%
% 3. RISHONIM CODIFICATION:
%    Rambam (Maachalot Asurot 9:1): Codifies all three as d'oraita
%    for beheima (domesticated kosher animal)
%
% 4. SHULCHAN ARUCH (YD 87:1):
%    "Basar beheima tehora she'nitbashel bechalav... assur
%    ba'achiila min haTorah"
%
% This chain establishes that the issur is d_oraita specifically
% for beheima, not for chaya (wild animal) or of (poultry).
% ============================================================

rule(r_bb_beheima_achiila).
makor(r_bb_beheima_achiila, sa("yd:87:1")).
makor(r_bb_beheima_achiila, rambam("ma:9:1")).
makor(r_bb_beheima_achiila, gemara("Chullin 103b")).
makor(r_bb_beheima_achiila, torah("Shemot 23:19")).
madrega(r_bb_beheima_achiila, d_oraita).

When rules are related, document the relationship:

% YD 87:1 - Core prohibition
rule(r_bb_beheima_achiila).
% ... makor, madrega, scope ...

% YD 87:3 - Extension to poultry (d'rabanan)
rule(r_bb_of_achiila).
related_to(r_bb_of_achiila, r_bb_beheima_achiila).
% ... makor, madrega, scope ...

% The of rule is a gezeira based on the beheima rule
gezeira_for(r_bb_of_achiila, r_bb_beheima_achiila).

Handling Multiple Sources

When Multiple Sources Agree

Cite all agreeing sources to strengthen the attribution:

rule(r_bb_beheima_achiila).

% All agree on this d'oraita prohibition
makor(r_bb_beheima_achiila, sa("yd:87:1")).
makor(r_bb_beheima_achiila, rema("yd:87:1")).     % Rema agrees (no gloss)
makor(r_bb_beheima_achiila, rambam("ma:9:1")).
makor(r_bb_beheima_achiila, tur("yd:87")).

% Commentary agreement
% Note: Taz 87:1, Shach 87:1 both affirm

When Sources Disagree

When sources disagree, encode each position in appropriate worlds:

% === Mechaber's Position ===
rule(r_bb_dag_sakana).
makor(r_bb_dag_sakana, sa("yd:87:3")).
makor(r_bb_dag_sakana, beit_yosef("yd:87")).
scope(r_bb_dag_sakana, mechaber).

asserts(mechaber, sakana(M)) :-
    is_dag_chalav_mixture(M).

% === Rema's Position ===
rule(r_rema_dag_mutar).
makor(r_rema_dag_mutar, rema("yd:87:3")).  % Implied by absence of gloss
makor(r_rema_dag_mutar, taz("yd:87:3")).   % Explains Ashkenazi practice
makor(r_rema_dag_mutar, shach("yd:87:5")). % Supports permission
scope(r_rema_dag_mutar, rema).

override(rema, sakana(M), no_sakana) :-
    is_dag_chalav_mixture(M).

Citing Commentary Disagreements

When Acharonim disagree on interpretation:

% === Main Rule ===
rule(r_bb_specific_case).
makor(r_bb_specific_case, sa("yd:87:X")).
scope(r_bb_specific_case, mechaber).

% === Commentary Disagreement ===
% Taz (87:X) interprets: [interpretation A]
% Shach (87:X) interprets: [interpretation B]
%
% Following the Taz's interpretation as it is more widely accepted
% per Pri Megadim.

makor(r_bb_specific_case, taz("yd:87:X")).
% Note: Shach disagrees - see r_bb_specific_case_shach for alternative

Attribution Uncertainty

When Primary Source is Unclear

When the exact source is debated:

% Source unclear - multiple possibilities
rule(r_uncertain_source).

% Possible sources
possible_source(r_uncertain_source, gemara("Pesachim 76b")).
possible_source(r_uncertain_source, gemara("Chullin 111b")).

% Encode based on SA's codification regardless
makor(r_uncertain_source, sa("yd:XX:Y")).

% Document uncertainty
% UNCERTAINTY: The Gemara source is disputed.
% Beit Yosef cites Pesachim 76b, but some Rishonim derive from Chullin 111b.
% Encoding based on the SA codification which is definitive regardless of source.

When Attribution Cannot Be Verified

If a citation cannot be verified:

% DO NOT encode unverified attributions
%
% If you find a rule in secondary literature but cannot verify
% the primary source:
%
% 1. Mark as unverified in comments
% 2. Do not include makor until verified
% 3. Open an issue for research
%
% Example:
% UNVERIFIED: Some claim this derives from Yerushalmi Chullin X:Y
% but this citation could not be located. Requires research.
% TRACKING: Create a research ticket in the project tracker.

Missing Rema Gloss

When Rema does not gloss, this typically indicates agreement:

% Rema's silence = agreement with Mechaber
rule(r_both_agree).
makor(r_both_agree, sa("yd:87:1")).
% Note: No Rema gloss on this seif indicates agreement

% Encode in mechaber; rema inherits automatically
scope(r_both_agree, mechaber).

% Child worlds (rema, ashk_mb, etc.) will inherit via accessible/2

Implicit vs Explicit Sources

Type Description How to Cite
Explicit Source directly states the rule Normal makor citation
Implied Source implies the rule Note "implied by" in comment
Derived Rule follows logically from source Use derives_from predicate
Established Universally accepted without source Cite authoritative codification
% Explicit citation
makor(r_explicit, sa("yd:87:1")).

% Implied citation
makor(r_implied, rema("yd:87:3")).
% Note: Rema's lack of gloss implies agreement with Mechaber

% Derived rule
rule(r_derived_from_principle).
derives_from(r_derived_from_principle, r_general_principle).
makor(r_derived_from_principle, sa("yd:87:5")).  % Where derivation is stated

Source Verification Checklist

Before submitting an encoding, verify:

  • [ ] Every normative rule has at least one makor/2
  • [ ] SA/Rema citation uses correct format (sa("yd:siman:seif"))
  • [ ] Gemara citations include masechet and folio (gemara("Chullin 103b"))
  • [ ] Rambam citations use abbreviated hilchot name (rambam("ma:9:1"))
  • [ ] Torah citations include sefer and verse (torah("Shemot 23:19"))
  • [ ] D'oraita rules cite Gemara source
  • [ ] D'oraita rules cite Torah source (if applicable)
  • [ ] Machloket has sources for both positions
  • [ ] Commentary disagreements are documented
  • [ ] Uncertain attributions are marked

Common Attribution Mistakes

Mistake 1: Wrong Citation Format

% WRONG - incorrect format
makor(r_example, "Shulchan Aruch YD 87:1").  % String, not structured
makor(r_example, sa(87, 1)).                  % Wrong arity
makor(r_example, sa("87:1")).                 % Missing section

% CORRECT
makor(r_example, sa("yd:87:1")).

Mistake 2: Missing Section Identifier

% WRONG - no section identifier
makor(r_example, sa("87:1")).

% CORRECT - includes section
makor(r_example, sa("yd:87:1")).
makor(r_example, sa("oc:328:1")).

Mistake 3: Citing Commentary as Primary

% WRONG - commentary without SA
rule(r_example).
makor(r_example, taz("yd:87:3")).  % Only Taz, no SA

% CORRECT - SA primary, commentary secondary
rule(r_example).
makor(r_example, sa("yd:87:3")).   % Primary
makor(r_example, taz("yd:87:3")).  % Commentary clarification

Mistake 4: Unverified Citation

% WRONG - cannot verify this citation exists
makor(r_example, gemara("Chullin 999a")).  % No such page

% CORRECT - verify before citing
makor(r_example, gemara("Chullin 103b")).  % Verified