Skip to content

World Scoping

Mistaber uses a directed acyclic graph (DAG) of seven Kripke worlds to represent different halachic traditions. Choosing the correct world for each rule is critical for accurate representation and proper inheritance behavior. This document explains the world hierarchy, when to use each world, and common scoping mistakes.

World Hierarchy Explained

The Seven Worlds

graph TD
    base[base<br/><small>Shulchan Aruch shared rules</small>]

    base --> mechaber[mechaber<br/><small>Sefardi tradition</small>]
    base --> rema[rema<br/><small>Ashkenazi tradition</small>]
    base --> gra[gra<br/><small>Vilna Gaon position</small>]

    mechaber --> sefardi_yo[sefardi_yo<br/><small>Yalkut Yosef</small>]
    rema --> ashk_mb[ashk_mb<br/><small>Mishnah Berurah</small>]
    rema --> ashk_ah[ashk_ah<br/><small>Aruch HaShulchan</small>]
    gra --> ashk_ah

    style base fill:#e1f5fe,stroke:#0288d1
    style mechaber fill:#fff3e0,stroke:#f57c00
    style rema fill:#f3e5f5,stroke:#7b1fa2
    style gra fill:#e8f5e9,stroke:#388e3c
    style sefardi_yo fill:#fff3e0,stroke:#f57c00
    style ashk_mb fill:#f3e5f5,stroke:#7b1fa2
    style ashk_ah fill:#f3e5f5,stroke:#7b1fa2

World Definitions

World Hebrew Authority Tradition Parents
base בסיס Shulchan Aruch (shared) Universal None (root)
mechaber מחבר R' Yosef Karo Sefardi base
rema רמ"א R' Moshe Isserles Ashkenazi base
gra גר"א Vilna Gaon GRA followers base
sefardi_yo ילקוט יוסף R' Ovadia Yosef Modern Sefardi mechaber
ashk_mb משנה ברורה Chofetz Chaim Litvish Ashkenazi rema
ashk_ah ערוך השולחן R' Epstein Russian/Lithuanian rema, gra

Inheritance Behavior

Rules propagate from parent to child worlds unless overridden:

% Rule scoped to mechaber
scope(r_example, mechaber).
asserts(mechaber, some_ruling(X)).

% Result:
% - mechaber: has some_ruling(X)
% - sefardi_yo: inherits some_ruling(X)
% - rema, ashk_mb, ashk_ah: DO NOT have some_ruling(X)

When to Use Base

Use Base When

  1. All traditions agree on a fundamental principle
  2. Shulchan Aruch states without Rema gloss and applies universally
  3. Shared classification facts (not normative rules)

Examples of Base Content

% === Classification facts (always in base) ===
basar_type(beheima).
basar_type(chaya).
basar_type(of).
basar_type(dag).

% === Universal helper predicates ===
mixture_has_basar(M, BType) :-
    mixture(M),
    contains(M, F),
    food(F),
    food_type(F, BType),
    is_basar_type(BType).

% === Default safek policies ===
safek_policy(base, d_oraita, l_chumra).
safek_policy(base, d_rabanan, l_kula).

Do NOT Use Base For

  • Normative rules that may vary by tradition
  • Rules with any Rema gloss (agreement or disagreement)
  • Rulings specific to one tradition
  • Anything the GRA or Acharonim modify

Base World Caution

Using base incorrectly causes rules to propagate to ALL worlds, including traditions that may not follow that ruling. Prefer mechaber for Shulchan Aruch content unless universal applicability is certain.

When to Use Mechaber

Use Mechaber When

  1. SA explicitly states the ruling (author is Mechaber)
  2. Rema does not gloss (implying potential disagreement elsewhere)
  3. Encoding Sefardi baseline that may differ from Ashkenazi

Mechaber World Characteristics

% Mechaber inherits from base
world(mechaber).
accessible(mechaber, base).

% Primary source: Shulchan Aruch
% Followed by: Sefardi communities, Yalkut Yosef

Examples of Mechaber Content

% === YD 87:1 - Beheima + Chalav d'oraita ===
rule(r_bb_beheima_achiila).
makor(r_bb_beheima_achiila, sa("yd:87:1")).
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).

% === YD 87:3 - Fish + Dairy = Sakana (Mechaber's unique position) ===
rule(r_bb_dag_sakana).
makor(r_bb_dag_sakana, sa("yd:87:3")).
scope(r_bb_dag_sakana, mechaber).

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

When to Use Rema

Use Rema When

  1. Rema explicitly glosses with different ruling
  2. Encoding Ashkenazi baseline that differs from Mechaber
  3. Overriding Mechaber's position for Ashkenazi practice

Rema World Characteristics

% Rema inherits from base (NOT from mechaber)
world(rema).
accessible(rema, base).

% Represents: Ashkenazi tradition
minhag_region(rema, ashkenaz).

Examples of Rema Content

% === Override: Fish + Dairy permitted (differs from Mechaber) ===
rule(r_rema_dag_chalav_mutar).
makor(r_rema_dag_chalav_mutar, rema("yd:87:3")).
scope(r_rema_dag_chalav_mutar, rema).

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

asserts(rema, heter(achiila, M)) :-
    is_dag_chalav_mixture(M).

% === Rema addition (not in Mechaber) ===
rule(r_rema_waiting_time).
makor(r_rema_waiting_time, rema("yd:89:1")).
scope(r_rema_waiting_time, rema).

ashkenazi_waiting_hours(6).

When to Use GRA

Use GRA When

  1. Vilna Gaon has unique position differing from both Mechaber and Rema
  2. Ashk_ah follows GRA over Rema on this point
  3. GRA's approach represents distinct methodology

GRA World Characteristics

% GRA inherits from base
world(gra).
accessible(gra, base).

% GRA is parent to ashk_ah (along with rema)
% accessible(ashk_ah, gra).

Examples of GRA Content

% === GRA's unique position on some matter ===
rule(r_gra_specific_view).
makor(r_gra_specific_view, gra("yd:XX:Y")).
scope(r_gra_specific_view, gra).

asserts(gra, gra_specific_ruling(X)).

% If this differs from rema, ashk_ah may need to choose
% which parent's position to follow

When to Use Child Worlds

Use sefardi_yo When

  1. Yalkut Yosef modifies or clarifies Mechaber
  2. R' Ovadia Yosef has unique psak not in original SA
  3. Contemporary Sefardi practice differs from classical SA
% sefardi_yo inherits from mechaber
world(sefardi_yo).
accessible(sefardi_yo, mechaber).

% Follows Mechaber with R' Ovadia's clarifications
minhag_region(sefardi_yo, sefardi_edot_hamizrach).

Use ashk_mb When

  1. Mishnah Berurah rules differently from Rema
  2. Litvish Ashkenazi practice is stricter than general Ashkenazi
  3. Chofetz Chaim's specific stringencies apply
% ashk_mb inherits from rema
world(ashk_mb).
accessible(ashk_mb, rema).

% Notable: MB treats safek d_rabanan l'chumra
safek_policy(ashk_mb, d_rabanan, l_chumra).  % Stricter than base

minhag_region(ashk_mb, ashkenaz_litvish).

Use ashk_ah When

  1. Aruch HaShulchan rules differently from Rema or MB
  2. Russian/Lithuanian practice follows AH over MB
  3. More lenient than MB on rabbinic matters
% ashk_ah inherits from BOTH rema AND gra
world(ashk_ah).
accessible(ashk_ah, rema).
accessible(ashk_ah, gra).

% Standard safek rules (more lenient than MB)
safek_policy(ashk_ah, d_rabanan, l_kula).

minhag_region(ashk_ah, ashkenaz_russian).

Override Patterns

Pattern 1: Mechaber vs Rema

% Mechaber's position
scope(r_mechaber_pos, mechaber).
asserts(mechaber, position_a(X)).

% Rema overrides
scope(r_rema_pos, rema).
override(rema, position_a(X), position_b).
asserts(rema, position_b(X)).

% Result:
% - mechaber: position_a
% - sefardi_yo: inherits position_a
% - rema: position_b (override)
% - ashk_mb: inherits position_b
% - ashk_ah: inherits position_b
% - gra: neither (unless gra has own position)

Pattern 2: Child World Override

% Rema's position
scope(r_rema_pos, rema).
asserts(rema, lenient_ruling(X)).

% MB is stricter
scope(r_mb_strict, ashk_mb).
override(ashk_mb, lenient_ruling(X), strict_ruling).
asserts(ashk_mb, strict_ruling(X)).

% Result:
% - rema: lenient_ruling
% - ashk_ah: inherits lenient_ruling (from rema)
% - ashk_mb: strict_ruling (override)

Pattern 3: Diamond Inheritance (ashk_ah)

% ashk_ah inherits from both rema and gra
% If they disagree, ashk_ah must specify priority

% rema says X
asserts(rema, position_x(A)).

% gra says Y
asserts(gra, position_y(A)).

% ashk_ah follows gra on this topic
scope(r_ah_follows_gra, ashk_ah).
override(ashk_ah, position_x(A), position_y).  % Override rema's view
asserts(ashk_ah, position_y(A)).

World Selection Decision Tree

graph TD
    A[New Rule to Encode] --> B{Who stated it?}

    B -->|SA with no Rema gloss| C{Universal principle?}
    B -->|SA with Rema agreement| D[mechaber world]
    B -->|SA with Rema disagreement| E[mechaber + rema worlds]
    B -->|Rema addition| F[rema world]
    B -->|GRA unique view| G[gra world]
    B -->|Later Acharonim| H{Which tradition?}

    C -->|Yes - all agree| I[base world]
    C -->|No - Sefardi specific| D

    H -->|Sefardi| J[sefardi_yo world]
    H -->|MB/Litvish| K[ashk_mb world]
    H -->|AH/Russian| L[ashk_ah world]

    D --> M[Child worlds inherit]
    E --> N[Test both branches]
    F --> O[Ashkenazi children inherit]
    G --> P[ashk_ah may follow]

Common Scoping Mistakes

Mistake 1: Using Base for Tradition-Specific Rules

% WRONG - fish+dairy sakana is NOT universal
scope(r_bb_dag_sakana, base).
asserts(base, sakana(M)) :- is_dag_chalav_mixture(M).
% This would propagate to rema, which disagrees!

% CORRECT - scope to mechaber
scope(r_bb_dag_sakana, mechaber).
asserts(mechaber, sakana(M)) :- is_dag_chalav_mixture(M).

Mistake 2: Encoding in Wrong Parent

% WRONG - Rema ruling in mechaber world
scope(r_rema_specific, mechaber).  % Wrong world!
asserts(mechaber, ashkenazi_practice(X)).

% CORRECT - Rema ruling in rema world
scope(r_rema_specific, rema).
asserts(rema, ashkenazi_practice(X)).

Mistake 3: Missing Override in Child

% Parent world (rema) has position
scope(r_rema_lenient, rema).
asserts(rema, lenient(X)).

% WRONG - MB disagrees but no override
scope(r_mb_strict, ashk_mb).
asserts(ashk_mb, strict(X)).
% Problem: ashk_mb now has BOTH lenient(X) AND strict(X)!

% CORRECT - MB overrides rema
scope(r_mb_strict, ashk_mb).
override(ashk_mb, lenient(X), strict_position).
asserts(ashk_mb, strict(X)).

Mistake 4: Encoding Same Rule in Multiple Worlds

% WRONG - duplicating when inheritance works
scope(r_rule_mechaber, mechaber).
asserts(mechaber, some_ruling(X)).

scope(r_rule_sefardi, sefardi_yo).  % Unnecessary
asserts(sefardi_yo, some_ruling(X)).  % Inherited anyway

% CORRECT - only encode in parent
scope(r_rule_mechaber, mechaber).
asserts(mechaber, some_ruling(X)).
% sefardi_yo inherits automatically via accessible/2

Mistake 5: Forgetting Diamond Inheritance

% ashk_ah has TWO parents: rema and gra
% If they conflict, must resolve explicitly

% WRONG - assuming ashk_ah only inherits from rema
scope(r_some_rule, rema).
asserts(rema, position_a(X)).
% But gra also has a position!
scope(r_gra_rule, gra).
asserts(gra, position_b(X)).
% ashk_ah now has conflict!

% CORRECT - explicitly resolve in ashk_ah
% See: Machloket Handling for three-way disputes

File Organization Reference

World File Location
base mistaber/ontology/worlds/base.lp
mechaber mistaber/ontology/worlds/mechaber.lp
rema mistaber/ontology/worlds/rema.lp
gra mistaber/ontology/worlds/gra.lp
ashk_mb mistaber/ontology/worlds/ashk_mb.lp
ashk_ah mistaber/ontology/worlds/ashk_ah.lp
sefardi_yo mistaber/ontology/worlds/sefardi_yo.lp
Kripke rules mistaber/ontology/worlds/kripke_rules.lp
Corpus (shared) mistaber/ontology/corpus/yd_XX/base.lp

World Scoping Checklist

Before submitting:

  • [ ] Identified correct world based on source authority
  • [ ] Verified no Rema gloss before using base
  • [ ] Used mechaber for SA content (not base) when uncertain
  • [ ] Created override in child when differing from parent
  • [ ] Tested inheritance in child worlds
  • [ ] Resolved diamond inheritance for ashk_ah if applicable
  • [ ] Documented world selection reasoning in comments