Skip to content

Predicate Registry (base.yaml)

Overview

The predicate registry (mistaber/dsl/vocabulary/base.yaml) is the canonical specification of all valid predicates in Mistaber. It serves as:

  1. Type System: Defines predicate signatures with sort constraints
  2. Vocabulary Reference: Documents Hebrew terminology and English meanings
  3. CWA/OWA Classification: Specifies closed vs. open world assumption
  4. Enumeration Values: Lists valid constants for classification sorts

File Structure

sorts:        # Domain types (29 sorts)
predicates:   # Predicate definitions (69 predicates)
enumerations: # Valid enum values (12 categories)
metadata:     # Version and documentation

Sorts Definition

Sorts are domain types that constrain predicate arguments.

Physical Domain Sorts

Sort Description Example Values
food Food items chicken, beef, milk
vessel Cooking vessels pot1, pan2
mixture Combined substances m1, stew
action Physical actions cook1, eat1
agent Entities performing actions person1
time_point Temporal instants t1, t2
location Physical places kitchen, table
quantity Numeric measurements 60, 100

Normative Domain Sorts

Sort Description Example Values
issue Halachic scenarios issue_basar_bechalav
ruling Determinations (Phase 2) Reserved
rule_id Rule identifiers r_basar_bechalav
source_ref Citations sa("YD:87:1")
posek Authorities mechaber, rema
world Possible worlds base, ashkenaz
policy Configurations (Phase 2) Reserved

Classification Sorts (Enumerated)

Sort Valid Values Example
food_category basar, chalav, parve, ... food_type(X, basar)
action_type achiila, bishul, hanaah action_type(A, achiila)
context ctx_normal, ctx_hefsed, ctx_shaat_hadchak Context argument
madrega_type d_oraita, d_rabanan, minhag, chumra madrega(R, d_oraita)
status_type assur, mutar, chiyuv, ... status(F, assur)
temp_status tzonen, cham, roteiach temp_status(F, cham)
kli_status kli_rishon, kli_sheni, kli_shlishi kli_status(V, kli_rishon)
shiur_type k_zayit, k_beitza, shishim, ... shiur_type(F, k_zayit)

Predicate Definition Format

Each predicate entry contains:

- name: forbidden
  arity: 4
  signature: [world, action_type, food, context]
  hebrew: "אסור"
  english: "Action on food is prohibited"
  cwa: false
  derived: true
  note: "Open world - derived from rules"
Field Required Description
name Yes Predicate name (lowercase)
arity Yes Number of arguments
signature Yes List of sort names for each position
hebrew No Hebrew terminology
english No English description
cwa Yes True = Closed World, False = Open World
derived No True if derived from other predicates
mandatory No True if must be specified in every program
note No Additional documentation

Predicate Categories

Sort Membership Predicates (CWA)

Declare what entities exist:

- name: is_food
  arity: 1
  signature: [food]
  cwa: true

- name: is_vessel
  arity: 1
  signature: [vessel]
  cwa: true

- name: is_mixture
  arity: 1
  signature: [mixture]
  cwa: true

Usage: is_food(chicken)., vessel(pot1).

Food Classification Predicates

- name: food_type
  arity: 2
  signature: [food, food_category]
  cwa: true
  note: "Target of surface syntax expansion"

- name: food_cat
  arity: 2
  signature: [food, food_category]
  cwa: true
  note: "Alias for food_type"

Usage: food_type(chicken, of)., food_type(milk, chalav).

Normative Predicates (OWA, Derived)

- name: forbidden
  arity: 4
  signature: [world, action_type, food, context]
  cwa: false
  derived: true

- name: permitted
  arity: 4
  signature: [world, action_type, food, context]
  cwa: false
  derived: true

- name: safek
  arity: 1
  signature: [food]
  cwa: false

Usage: forbidden(W, achiila, M, ctx_normal) :- ...

Important: These predicates require @makor citation when used in rules.

Source Attribution Predicates

- name: makor
  arity: 2
  signature: [food, source_ref]
  cwa: true
  mandatory: true

- name: cites
  arity: 2
  signature: [rule_id, source_ref]
  cwa: true
  mandatory: true

Usage: makor(r_basar_bechalav, sa("YD:87:1")).

Madrega Predicates

- name: madrega
  arity: 2
  signature: [food, madrega_type]
  cwa: true
  note: "Every issur must have a madrega"

- name: is_d_oraita
  arity: 1
  signature: [food]
  cwa: false

- name: is_d_rabanan
  arity: 1
  signature: [food]
  cwa: false

Vessel (Kli) Predicates

- name: kli_status
  arity: 2
  signature: [vessel, kli_status]
  cwa: true

- name: in_vessel
  arity: 2
  signature: [food, vessel]
  cwa: true

- name: absorbed_in_vessel
  arity: 2
  signature: [food, vessel]
  cwa: false

Temporal Predicates

- name: before
  arity: 2
  signature: [time_point, time_point]
  cwa: false

- name: during
  arity: 2
  signature: [action, time_point]
  cwa: true

- name: at_time
  arity: 2
  signature: [food, time_point]
  cwa: false

Temperature Predicates

- name: temp_status
  arity: 2
  signature: [food, temp_status]
  cwa: true

- name: is_tzonen
  arity: 1
  signature: [food]
  cwa: false

- name: is_cham
  arity: 1
  signature: [food]
  cwa: false

- name: is_roteiach
  arity: 1
  signature: [food]
  cwa: false

Shiur (Measurement) Predicates

- name: shiur_type
  arity: 2
  signature: [food, shiur_type]
  cwa: true

- name: has_shiur
  arity: 3
  signature: [food, shiur_type, quantity]
  cwa: true

- name: ratio
  arity: 3
  signature: [mixture, food, integer]
  cwa: true

- name: noten_taam
  arity: 2
  signature: [food, food]
  cwa: false

Action Predicates

- name: performed
  arity: 3
  signature: [agent, action, food]
  cwa: true

- name: achiila
  arity: 2
  signature: [agent, food]
  cwa: true

- name: bishul
  arity: 3
  signature: [agent, food, food]
  cwa: true

- name: hanaah
  arity: 2
  signature: [agent, food]
  cwa: true

World Structure (Modal Logic)

- name: accessible
  arity: 2
  signature: [world, world]
  cwa: false
  note: "For deontic and counterfactual reasoning"

- name: actual_world
  arity: 1
  signature: [world]
  cwa: true
  mandatory: true

- name: holds_in
  arity: 2
  signature: [food, world]
  cwa: false

Safek (Doubt) Handling

- name: safek
  arity: 1
  signature: [food]
  cwa: false

- name: safek_d_oraita
  arity: 1
  signature: [food]
  cwa: false
  note: "Biblical doubt - treat stringently"

- name: safek_d_rabanan
  arity: 1
  signature: [food]
  cwa: false
  note: "Rabbinic doubt - treat leniently"

- name: sfek_sfeika
  arity: 1
  signature: [food]
  cwa: false
  note: "Double doubt - compound uncertainty"

Enumerations

Complete lists of valid values for classification sorts:

action_type

action_type:
  - achiila      # Eating
  - bishul       # Cooking
  - hanaah       # Benefit/use
  - melicha      # Salting
  - kavush       # Pickling
  - netila       # Washing/handling

food_category

food_category:
  - maakhal      # Generic food
  - basar        # Meat
  - chalav       # Dairy
  - parve        # Neutral
  - beheima      # Domesticated animal
  - chaya        # Wild animal
  - of           # Poultry
  - dag          # Fish
  - mashkeh      # Liquid
  - tavlin       # Spice
  - yayin        # Wine
  - dagan        # Grain
  - yerek        # Vegetable
  - peri         # Fruit
  - ofeh         # Baked goods

madrega_type

madrega_type:
  - d_oraita     # Biblical (Torah law)
  - d_rabanan    # Rabbinic decree
  - minhag       # Custom
  - chumra       # Stringency

context

context:
  - ctx_normal         # Normal circumstances
  - ctx_hefsed         # Significant loss
  - ctx_shaat_hadchak  # Emergency
  - ctx_choleh         # Sick person
  - ctx_pikuach_nefesh # Life-threatening

shiur_type

shiur_type:
  - k_zayit      # Olive volume (~30ml)
  - k_beitza     # Egg volume (~55ml)
  - shishim      # 60:1 ratio
  - mashehu      # Any amount
  - rov          # Majority
  - noten_taam   # Taste-imparting

CWA vs OWA

Closed World Assumption (CWA)

  • Definition: If not stated, it's false
  • Used for: Facts, classifications, structural data
  • Examples: is_food, food_type, madrega, contains
% CWA: if not declared, food doesn't exist
is_food(chicken).  % chicken exists
% beef is NOT a food (no declaration)

Open World Assumption (OWA)

  • Definition: Absence doesn't imply falsity
  • Used for: Derived conclusions, normative determinations
  • Examples: permitted, forbidden, safek
% OWA: not knowing if something is forbidden
% doesn't mean it's permitted
forbidden(W, achiila, M, C) :- ...

Type Checker Warning: Negating OWA predicates generates a warning because it can lead to unsafe permissiveness.

Using the Registry in Python

from mistaber.dsl.vocabulary import PredicateRegistry
from pathlib import Path

# Load registry
registry = PredicateRegistry.load(
    Path("mistaber/dsl/vocabulary/base.yaml")
)

# Check if predicate exists
pred = registry.get_predicate("food_type")
print(pred.arity)        # 2
print(pred.signature)    # ['food', 'food_category']
print(pred.cwa)          # True

# Check if value is valid for sort
valid = "basar" in registry.get_enum_values("food_category")
print(valid)             # True

# Get all OWA predicates
owa_preds = [p for p in registry.predicates if not p.cwa]

Adding New Predicates

  1. Add entry to predicates section in base.yaml
  2. Specify all required fields (name, arity, signature, cwa)
  3. Add to appropriate sort if new type needed
  4. Add to enumerations if new enum values needed
  5. Update tests in tests/dsl/test_type_checker.py

Example:

- name: new_predicate
  arity: 2
  signature: [food, new_sort]
  hebrew: "חדש"
  english: "New predicate description"
  cwa: true
  note: "Added for feature X"

Metadata

metadata:
  version: "1.0.0"
  phase: 1
  last_updated: "2026-01-15"
  description: "Canonical predicate registry for Mistaber Phase 1"

The metadata section tracks version information and documents the registry's purpose.