Daily Mishnah · Techie Talmid · Deep-Dive

Mishnah Bekhorot 6:10-11

Deep-DiveTechie TalmidDecember 20, 2025

The Bekhor Blemish Classifier: A Bug Report & Systems Analysis

Greetings, fellow data-devourers and algorithm-aficionados! Prepare yourselves for a deep dive into an ancient codebase, a magnificent Mishnah that, at first glance, seems like an unstructured data dump of biological anomalies. But fear not, for beneath the surface of seemingly disparate defects lies a sophisticated classification system, ripe for our systems-thinking scrutiny. Today, we're debugging Mishnah Bekhorot 6:10-11, a textual artifact that defines the parameters of mumim – blemishes that transform a bekhor (firstborn animal) from a consecrated Temple offering into a regular, consumable animal.

Problem Statement: The Sacrificial Status Resolution Bug

Our core problem, or "bug report," if you will, is a classic binary classification challenge. In the domain of Bekhorot, every firstborn male animal (cow, sheep, goat) is inherently sanctified and designated for an offering in the Temple. This is a high-stakes default state. However, the system allows for an exception: if the animal possesses a mum (a permanent, visible, and disqualifying blemish), its status shifts. It can then be slaughtered and consumed by a Kohen (priest) outside the Temple, without the complex sacrificial rites. This is a critical functional change, impacting economic value, ritual procedure, and even geographic constraints.

The bug isn't in the concept of a blemish, but in the implementation of its detection logic. The Mishnah presents a sprawling, seemingly unordered list of potential mumim, spanning multiple anatomical regions and types of defects. It feels less like a clean API specification and more like a series of ad-hoc patches. Our task is to reverse-engineer this patch-ridden codebase into a coherent, object-oriented system.

Imagine a BekhorClassifier function that takes an AnimalObject as input and returns a SacrificialStatusEnum (EligibleForTempleOffering or PermittedForConsumptionOutsideTemple). The Mishnah's challenge is that the internal IsBlemished() method within BekhorClassifier is incredibly complex. It's not a simple boolean check; it's a multi-layered, conditional logic tree with numerous nested IF statements, threshold values, and even competing definitions from different "developers" (Tannaim).

The data structure for an AnimalObject would need fields for:

  • Ear.CartilageIntegrity (boolean)
  • Ear.SkinIntegrity (boolean)
  • Ear.SplitStatus (boolean)
  • Ear.PiercingSize (numeric, e.g., mm)
  • Ear.DesiccationLevel (enum: 'Normal', 'PiercableNoBlood', 'Crumble')
  • Eye.EyelidIntegrity (enum: 'Pierced', 'Damaged', 'Split', 'Normal')
  • Eye.PupilCoverings (list of enums: 'Cataract', 'Tevallul', 'Snail', 'Snake', 'Berry', 'None')
  • Eye.TevallulType (enum: 'WhiteBisectsIrisIntoBlack', 'BlackBisectsIrisIntoWhite', 'None')
  • Eye.PaleSpots (boolean)
  • Eye.Tears (boolean)
  • Eye.PaleSpotDuration (numeric, days)
  • Eye.TearHealingAttempts (list of enems: 'MoistDryRain', 'MoistDryIrrigated', 'DryThenMoist', 'MoistThenDry')
  • Nose.Integrity (enum: 'Pierced', 'Damaged', 'Split', 'Normal')
  • Lip.Integrity (enum: 'Pierced', 'Damaged', 'Split', 'Normal')
  • Gums.ExternalIntegrity (enum: 'Damaged', 'Scratched', 'Normal')
  • Gums.InternalIntegrity (enum: 'Extracted', 'DamagedNotExtracted', 'Normal')
  • Gums.ExaminationExclusion (boolean, for molars)
  • Genitals.PouchIntegrity (enum: 'Damaged', 'Normal')
  • Genitals.FemaleGenitaliaIntegrity (enum: 'Damaged', 'Normal')
  • Tail.DamageLocation (enum: 'Tailbone', 'Joint', 'BetweenJoints')
  • Tail.DamageExtent (enum: 'SkinFleshRemovedBoneExposed', 'FullFingerbreadthFleshBetweenJoints', 'Normal')
  • Tail.KidTailType (enum: 'PigLike', 'LessThanThreeJoints', 'Normal')
  • Testicles.Count (numeric: 0, 1, 2)
  • Testicles.ScrotalSacs (numeric: 0, 1, 2)
  • Testicles.Palpability (boolean, after mashing)
  • Legs.Count (numeric: 3, 4, 5)
  • Hooves.Type (enum: 'Split', 'DonkeyLike')
  • Legs.ThighboneStatus (enum: 'Dislocated', 'Normal')
  • Legs.ThighSymmetry (enum: 'AsymmetricalOneHigher', 'Symmetrical')
  • Legs.ForelegBoneStatus (enum: 'Broken', 'Normal')
  • Legs.HindlegBoneStatus (enum: 'Broken', 'Normal')
  • Eye.Shape (enum: 'RoundLikeHuman', 'Normal')
  • Mouth.Shape (enum: 'SimilarToPig', 'Normal')
  • Tongue.SpeechSegmentRemoval (enum: 'MostRemoved', 'Normal')
  • Jaw.Alignment (enum: 'LowerProtrudesBeyondUpper', 'Normal')
  • Ear.KidEarDoubled (enum: 'OneBone', 'NoBone', 'Normal')
  • Eye.WartPresence (boolean)
  • LegBone.ForelegDamage (boolean)
  • LegBone.HindlegDamage (boolean)
  • MouthBone.JawDislocated (boolean)
  • Eye.SizeDisparity (enum: 'VisibleDifference', 'MeasurableOnly', 'Normal')
  • Ear.SizeDisparity (enum: 'VisibleDifference', 'MeasurableOnly', 'Normal')
  • Testicles.SizeRatio (enum: 'OneTwiceOther', 'Normal')
  • CalfTail.LengthRelativeToLegJoint (enum: 'DoesNotReachArkov', 'ReachesArkov')
  • CalfTail.ArkovLocation (enum: 'MiddleOfThigh', 'Other')
  • Eye.PaleSpotsConstant (boolean)
  • Eye.TearsConstant (boolean)
  • Gums.InternalDamagedNotExtracted (boolean)
  • Skin.BoilsGarav (boolean)
  • Skin.Warts (boolean)
  • Skin.BoilsHazazit (boolean)
  • Age.Old (boolean)
  • Health.Sick (boolean)
  • Odor.Foul (boolean)
  • Behavior.TransgressionPerformed (boolean)
  • Behavior.KilledPerson (boolean)
  • Genitals.Tumtum (boolean)
  • Genitals.Androgynos (boolean)

The problem statement for the Mishnah is to provide a comprehensive, albeit verbose, algorithm for determining the IsBlemished() status, enabling the correct SacrificialStatusEnum output. The secondary problem is the inconsistency and ambiguity in definitions and resolutions, requiring extensive commentary to standardize the "API documentation."

Text Snapshot: Anchoring the Data Points

Let's pull some key lines, our "code snippets" with their Sefaria line references, to ground our analysis:

  • Ear Damage (Basic): "If the firstborn’s ear was damaged and lacking from the cartilage [haḥasḥus], but not if the skin was damaged; and likewise, if the ear was split, although it is not lacking; or if the ear was pierced with a hole the size of a bitter vetch" (Mishnah Bekhorot 6:10:1)
  • Desiccated Ear Definition: "What is a desiccated ear that is considered a blemish? It is any ear that if it is pierced it does not discharge a drop of blood. Rabbi Yosei ben HaMeshullam says: Desiccated means that the ear is so dry that it will crumble if one touches it." (Mishnah Bekhorot 6:10:1)
  • Tevallul Definition: "What is a tevallul? It is a white thread that bisects the iris and enters the black pupil. If it is a black thread that bisects the iris and enters the white of the eye it is not a blemish." (Mishnah Bekhorot 6:10:3)
  • Constant Spots/Tears Definition (Initial): "Which are the pale spots that are constant? They are any spots that persisted for eighty days. Rabbi Ḥananya ben Antigonus said: One examines it three times within eighty days. And these are the constant tears... it is not a blemish. It is not a blemish unless the animal eats the moist fodder and thereafter eats the dry fodder and is not thereby healed." (Mishnah Bekhorot 6:10:4-5)
  • Concealed Blemish Principle (Gums): "Rabbi Ḥanina ben Antigonus says: One does not examine from the double teeth, i.e., the large molars that appear like two teeth, and inward, and one does not examine even the place of the double teeth themselves. This is because even if they were extracted, it is a concealed blemish, and it does not permit the slaughter of the firstborn." (Mishnah Bekhorot 6:10:7)
  • Tail Damage Nuance: "if the tail was damaged from the tailbone, but not if it was damaged from the joint, i.e., one of the joints between the vertebrae, because it heals; or in a case where the end of the tail is split, i.e., the skin and the flesh were removed and the bone remained exposed; or in a case where there is a full fingerbreadth of flesh between one joint and another joint" (Mishnah Bekhorot 6:10:8)
  • Testicle Ascertainment: "Rabbi Akiva says: The matter can be ascertained: One seats the animal on its rump and mashes the sac; if there is a testicle, ultimately it is going to emerge." (Mishnah Bekhorot 6:10:9)
  • Ila's Additions and Court Rulings: "Ila, who was expert in blemishes of the firstborn, enumerated them in Yavne, and the Sages deferred to his expertise. And Ila added three additional blemishes... The court that followed them said... That is a blemish" (Mishnah Bekhorot 6:10:11)
  • Kid Ear/Tail Specifics: "the ear of the kid that was doubled... When the additional ear is one bone... a blemish; when it does not have its own bone it is not a blemish. Rabbi Ḥananya ben Gamliel says: In the case of the tail of a kid that is similar to that of a pig or one that is so short that it does not have three joints, that is a blemish." (Mishnah Bekhorot 6:10:12)
  • Size Disparity (Sight vs. Measurement): "one of its eyes large and one small, or one of its ears large and one small where the difference in size is detectable by sight, but not if it is detectable only by being measured." (Mishnah Bekhorot 6:10:13)
  • Non-Blemishes (Critical Negatives): "And these are the blemishes that one does not slaughter the firstborn due to them... Pale spots on the eye and tears streaming from the eye that are not constant; and internal gums that were damaged but that were not extracted; and an animal with boils... and an animal with warts... and an animal with boils... and an old or sick animal, or one with a foul odor; and one with which a transgression was performed... and one that killed a person... And one does not slaughter a tumtum, and a hermaphrodite... Rabbi Shimon says: You have no blemish greater than that... And the Rabbis say: The halakhic status of a hermaphrodite is not that of a firstborn; rather, its halakhic status is that of a non-sacred animal that may be shorn and utilized for labor." (Mishnah Bekhorot 6:11:1-3)

Flow Model: The Bekhor Blemish Decision Tree

Let's visualize the Mishnah's logic as a decision tree, mapping out the IsBlemished() function's internal flow. Each branch represents a conditional check, leading to either TRUE (it's a blemish, animal is permitted) or FALSE (not a blemish, animal remains consecrated).

graph TD
    A[Start: Evaluate Animal for Blemish] --> B{Ear Blemishes?};
    B --> B1{Cartilage Lacking?};
    B1 -- Yes --> B1a[Blemish: Ear Cartilage Damage];
    B1 -- No --> B2{Skin Damaged?};
    B2 -- Yes --> B2a[Not Blemish: Skin Only];
    B2 -- No --> B3{Ear Split (not lacking)?};
    B3 -- Yes --> B3a[Blemish: Ear Split];
    B3 -- No --> B4{Ear Pierced (Bitter Vetch size)?};
    B4 -- Yes --> B4a[Blemish: Ear Pierced];
    B4 -- No --> B5{Ear Desiccated?};
    B5 -- Yes --> B5a{Pierced, No Blood?};
    B5a -- Yes --> B5a1[Blemish: Ear Desiccated (No Blood)];
    B5a -- No --> B5b{Crumbles on Touch (R. Yosei)?};
    B5b -- Yes --> B5b1[Blemish: Ear Desiccated (Crumble)];
    B5b -- No --> B6{Kid Ear Doubled?};
    B6 -- Yes --> B6a{Has its own bone?};
    B6a -- Yes --> B6a1[Blemish: Kid Ear Doubled w/ Bone];
    B6a -- No --> B6b1[Not Blemish: Kid Ear Doubled w/o Bone];
    B6a -- No --> B6c[Continue];

    B -- No --> C{Eye Blemishes?};
    C --> C1{Eyelid Pierced/Damaged/Split?};
    C1 -- Yes --> C1a[Blemish: Eyelid Damage];
    C1 -- No --> C2{Pupil Covered?};
    C2 -- Yes --> C2a{Cataract/Snail/Snake/Berry?};
    C2a -- Yes --> C2a1[Blemish: Pupil Covering];
    C2a -- No --> C2b{Tevallul?};
    C2b -- Yes --> C2b1{White Thread bisects Iris, enters Black Pupil?};
    C2b1 -- Yes --> C2b1a[Blemish: White Tevallul];
    C2b1 -- No --> C2b2{Black Thread bisects Iris, enters White Eye?};
    C2b2 -- Yes --> C2b2a[Not Blemish: Black Tevallul];
    C2b2 -- No --> C3{Pale Spots/Tears?};
    C3 -- Yes --> C3a{Constant?};
    C3a -- Yes --> C3a1{Pale Spots Persisted 80 Days (R. Hananya: 3 exams in 80 days)?};
    C3a1 -- Yes --> C3a1a[Blemish: Constant Pale Spots];
    C3a1 -- No --> C3a1b[Not Blemish: Non-Constant Pale Spots];
    C3a -- Yes --> C3a2{Tears Unhealed by Moist-Dry Fodder?};
    C3a2 -- Yes --> C3a2a[Blemish: Constant Tears];
    C3a2 -- No --> C3a2b[Not Blemish: Non-Constant Tears];
    C3a -- No --> C3b[Not Blemish: Non-Constant Spots/Tears];
    C3 -- No --> C4{Eye Wart (R. Hanina ben Antigonus)?};
    C4 -- Yes --> C4a[Blemish: Eye Wart];
    C4 -- No --> C5{Eye Round like Human (Ila)?};
    C5 -- Yes --> C5a[Blemish: Human-like Eye];
    C5 -- No --> C6{One Eye Large, One Small (Visible)?};
    C6 -- Yes --> C6a[Blemish: Visible Eye Size Disparity];
    C6 -- No --> C7[Continue];

    C -- No --> D{Nose/Lip/Mouth/Gums Blemishes?};
    D --> D1{Nose Pierced/Damaged/Split?};
    D1 -- Yes --> D1a[Blemish: Nose Damage];
    D1 -- No --> D2{Lip Pierced/Damaged/Split?};
    D2 -- Yes --> D2a[Blemish: Lip Damage];
    D2 -- No --> D3{External Gums Damaged/Scratched?};
    D3 -- Yes --> D3a[Blemish: External Gum Damage];
    D3 -- No --> D4{Internal Gums Extracted?};
    D4 -- Yes --> D4a[Blemish: Internal Gum Extraction];
    D4 -- No --> D5{Internal Gums Damaged (Not Extracted)?};
    D5 -- Yes --> D5a[Not Blemish: Internal Gum Damage (Not Extracted)];
    D5 -- No --> D6{Mouth Similar to Pig (Ila)?};
    D6 -- Yes --> D6a[Blemish: Pig-like Mouth];
    D6 -- No --> D7{Most of Speech-Tongue Removed (Ila)?};
    D7 -- Yes --> D7a[Blemish: Tongue Damage];
    D7 -- No --> D8{Lower Jaw Protrudes (R. Gamliel incident)?};
    D8 -- Yes --> D8a[Blemish: Jaw Protrusion];
    D8 -- No --> D9{Jaw Bone Dislocated (R. Hanina ben Antigonus)?};
    D9 -- Yes --> D9a[Blemish: Dislocated Jaw Bone];
    D9 -- No --> D10[Continue];

    D -- No --> E{Genital/Tail Blemishes?};
    E --> E1{Pouch/Female Genitalia Damaged?};
    E1 -- Yes --> E1a[Blemish: Genital Damage];
    E1 -- No --> E2{Tail Damaged from Tailbone?};
    E2 -- Yes --> E2a[Blemish: Tailbone Damage];
    E2 -- No --> E3{Tail Damaged from Joint?};
    E3 -- Yes --> E3a[Not Blemish: Tail Joint Damage (Heals)];
    E3 -- No --> E4{End of Tail Split (Skin/Flesh Removed, Bone Exposed)?};
    E4 -- Yes --> E4a[Blemish: Tail End Split];
    E4 -- No --> E5{Full Fingerbreadth Flesh Between Joints?};
    E5 -- Yes --> E5a[Blemish: Flesh Between Tail Joints];
    E5 -- No --> E6{No Testicles or One Testicle?};
    E6 -- Yes --> E6a[Blemish: Cryptorchid/Monorchid];
    E6 -- No --> E7{Testicle Ascertainment (R. Akiva/R. Yochanan)?};
    E7 -- Yes --> E7a[Blemish (if no testicle found)];
    E7 -- No --> E8{Kid Tail Pig-like or <3 Joints (R. Hanina ben Gamliel)?};
    E8 -- Yes --> E8a[Blemish: Kid Tail Deformity];
    E8 -- No --> E9{Calf Tail Does Not Reach Arkov (Sages)?};
    E9 -- Yes --> E9a[Blemish: Short Calf Tail];
    E9 -- No --> E10{Tumtum or Androgynos?};
    E10 -- Yes --> E10a{R. Shimon: Blemish};
    E10a -- Yes --> E10a1[Blemish: Tumtum/Androgynos (R. Shimon)];
    E10a -- No --> E10b{Rabbis: Not Bekhor, Shear/Labor};
    E10b -- Yes --> E10b1[Not Blemish: Not Bekhor (Rabbis)];
    E10 -- No --> E11[Continue];

    E -- No --> F{Leg/Hoof/Body Blemishes?};
    F --> F1{5 Legs or 3 Legs?};
    F1 -- Yes --> F1a[Blemish: Leg Count Anomaly];
    F1 -- No --> F2{Hooves Closed like Donkey?};
    F2 -- Yes --> F2a[Blemish: Donkey-like Hooves];
    F2 -- No --> F3{Shaḥul (Thighbone Dislocated)?};
    F3 -- Yes --> F3a[Blemish: Dislocated Thighbone];
    F3 -- No --> F4{Kasul (One Thigh Higher)?};
    F4 -- Yes --> F4a[Blemish: Asymmetrical Thighs];
    F4 -- No --> F5{Foreleg/Hindleg Bone Broken (even if not conspicuous)?};
    F5 -- Yes --> F5a[Blemish: Broken Leg Bone];
    F5 -- No --> F6{Foreleg/Hindleg Bone Damaged (R. Hanina ben Antigonus)?};
    F6 -- Yes --> F6a[Blemish: Damaged Leg Bone];
    F6 -- No --> F7[Continue];

    F -- No --> G{Non-Blemishes (Disqualifiers)?};
    G --> G1{Pale Spots/Tears NOT Constant?};
    G1 -- Yes --> G1a[Not Blemish: Non-Constant Spots/Tears];
    G1 -- No --> G2{Internal Gums Damaged NOT Extracted?};
    G2 -- Yes --> G2a[Not Blemish: Internal Gum Damage (Not Extracted)];
    G2 -- No --> G3{Boils (Garav/Hazazit)/Warts?};
    G3 -- Yes --> G3a[Not Blemish: Skin Conditions];
    G3 -- No --> G4{Old/Sick/Foul Odor?};
    G4 -- Yes --> G4a[Not Blemish: Health/Age/Odor];
    G4 -- No --> G5{Transgression Performed/Killed Person (1 Witness/Owner)?};
    G5 -- Yes --> G5a[Not Blemish: Behavioral/Ritual Impurity];
    G5 -- No --> H[No Blemish Found: Animal is Consecrated for Temple Offering];

    B1a, B3a, B4a, B5a1, B5b1, B6a1, C1a, C2a1, C2b1a, C3a1a, C3a2a, C4a, C5a, C6a, D1a, D2a, D3a, D4a, D6a, D7a, D8a, D9a, E1a, E2a, E4a, E5a, E6a, E7a, E8a, E9a, E10a1, F1a, F2a, F3a, F4a, F5a, F6a --> I[Blemish Found: Animal Permitted for Consumption Outside Temple];
    B2a, B6b1, C2b2a, C3a1b, C3a2b, C3b, D5a, E3a, E10b1, G1a, G2a, G3a, G4a, G5a, H --> J[End Process];

This flow model illustrates the highly branched, conditional nature of the IsBlemished() function. Each node is a feature check, and the paths lead to a binary outcome. The complexity arises from the sheer number of features and the nuanced definitions of what constitutes a "positive" result for each feature. For instance, Desiccated Ear isn't a simple boolean; it invokes a nested sub-routine with two different validation paths (no blood vs. crumbles). Similarly, Constant Tears requires a specific test sequence of fodder types. This is not a flat list; it's a deeply nested, context-sensitive rule engine.

Crucially, the Mishnah also provides a "negative list" – conditions that seem like blemishes but are explicitly not considered disqualifying for the bekhor, and in some cases, even prevent its redemption (e.g., tumtum and androgynos). These are like "false positive" filters or early exit conditions in our algorithm that default to NOT_BLEMISH even if a superficial check might suggest otherwise. The tumtum and androgynos case is particularly intriguing, as it introduces a third state (NOT_BEKHOR_AT_ALL) rather than just BLEMISHED or NOT_BLEMISHED, highlighting the multi-faceted nature of the animal's status.

Two Implementations: Algorithm A (Rambam) vs. Algorithm B (Tosafot Yom Tov) vs. Algorithm C (Rabbi Akiva Eiger)

The beauty of ancient texts, much like legacy codebases, is that different interpreters (commentators) often provide subtly distinct "implementations" of the same core specification. Let's analyze how three prominent Rishonim and Acharonim (early and later commentators) approach the Mishnah's blemish classification, treating each as a unique algorithmic interpretation.

Implementation A: Rambam's Canonical Codification (The "Strict API Spec")

Rambam (Rabbi Moshe ben Maimon), a master of logical systematization, often functions as the "API designer" of Halakha. His Mishneh Torah aims to provide clear, unambiguous rules, effectively compiling the Mishnah and Gemara into a definitive code. When Rambam tackles Bekhorot, his "algorithm" prioritizes clarity, consistency, and a hierarchical structure. He seeks to resolve ambiguities by establishing precise definitions and often adopts a singular, authoritative opinion where the Mishnah presents multiple.

Let's examine Rambam's approach through a few key Mishnah passages:

  1. "What is a desiccated ear... Rabbi Yosei ben HaMeshullam says: Desiccated means that the ear is so dry that it will crumble if one touches it." (Mishnah Bekhorot 6:10:1)

    • Rambam's Algorithm: Rambam (in Hilkhot Bekhorot 7:1) adopts Rabbi Yosei's definition directly, effectively making Ear.DesiccationLevel = 'Crumble' the primary, and often sole, valid condition for a desiccated ear to be a mum. While the Mishnah offers "pierced, no blood" as an alternative, Rambam's codification often implies a preference or a merging of criteria where one is subsumed by the other's severity. He simplifies the nested conditional IF Ear.Desiccated THEN (IF PiercedNoBlood OR Crumble) into IF Ear.DesiccationLevel == 'Crumble'. This is a strict, high-threshold interpretation. If the ear doesn't crumble, even if it yields no blood when pierced, it might not pass Rambam's IsBlemished() check for desiccation alone.
    • Rationale: Rambam often prefers the more definitive, physically verifiable criteria. "Crumbling" is a more objective and severe manifestation of desiccation than merely "no blood when pierced," which could be temporary or less extreme. This reduces the surface area for subjective judgment.
  2. "Rabbi Ḥanina ben Antigonus says: One examines it three times within eighty days." (Mishnah Bekhorot 6:10:4, regarding constant pale spots)

    • Rambam's Algorithm: Rambam integrates R. Ḥananya's opinion directly into the definition of "constant pale spots" (Hilkhot Bekhorot 7:3). For Rambam, the IsConstant() method for pale spots PaleSpots.IsConstant() requires: IF (PaleSpots.Duration >= 80_days AND PaleSpots.NumExaminations >= 3_within_80_days) THEN TRUE ELSE FALSE. He takes the 80-day duration as a necessary but insufficient condition, adding the three examinations as a critical validation step.
    • Rationale: This adds robustness to the classification. A long duration alone might not guarantee permanence; regular observation (three checks) confirms it's not a transient condition that just happened to last 80 days. This makes the ConstantPaleSpots module more resilient to false positives.
  1. "One of its eyes large and one small, or one of its ears large and one small where the difference in size is detectable by sight, but not if it is detectable only by being measured." (Mishnah Bekhorot 6:10:13, R. Ḥanina ben Antigonus)
    • Rambam's Algorithm (as interpreted by Tosafot Yom Tov and RAE): Rambam, in his commentary on the Mishnah and in Hilkhot Bekhorot 7:10, defines this blemish as specifically when one eye is "large as a calf's" and the other "small as a goose's." This isn't just a general size disparity; it's a specific, extreme contrast. Furthermore, Rambam is understood to hold that this specific formulation (one large and one small) is the blemish, not just one being large or one being small relative to the other being normal. This means the Eye.SizeDisparity() method returns TRUE only if (Eye.Size[0] == CalfSize AND Eye.Size[1] == GooseSize) OR (Eye.Size[1] == CalfSize AND Eye.Size[0] == GooseSize). The "detectable by sight" constraint is also crucial: IF (SizeDisparityIsVisible(Eye) AND (Eye.Size[0] == CalfSize AND Eye.Size[1] == GooseSize)) THEN TRUE.
    • Rationale: By setting such extreme and specific thresholds, Rambam reduces ambiguity. A slight, visually imperceptible difference isn't a mum. A general "large and small" is too vague. Only a stark, almost caricatural difference, explicitly defined by animal analogies, qualifies. This makes the EyeSizeDisparity module very precise.

Implementation B: Tosafot Yom Tov's Elucidating Expansion (The "Detailed Debug Log")

Tosafot Yom Tov (Rabbi Yom Tov Lipmann Heller) acts as a meticulous "debugger" and "documentation writer." He often clarifies Rambam, points out underlying Gemara discussions, and addresses potential ambiguities or alternative interpretations. His "algorithm" is less about codification and more about exposing the full decision process, including dissenting opinions and the reasoning behind preferred rules.

  1. "Rabbi Ḥanina ben Antigonus says that these are blemished animals: One that has a wart in its eyes..." (Mishnah Bekhorot 6:10:13)

    • TYT's Algorithm: TYT, citing "Harav" (likely Rambam in his Mishnah commentary), clarifies that "wart in its eye" (יבלת בעינו) specifically means a wart "in the white of the eye" (בלובן שבעין) and "which has hair on it" (ויש בו שער). He immediately adds, "otherwise, it is taught in Mishnah 2 that there are no blemishes in the white of the eye." This means Eye.WartPresence() is not a simple boolean. It's a complex conditional: IF (Wart.Location == 'WhiteOfEye' AND Wart.HasHair == TRUE) THEN TRUE ELSE FALSE.
    • Rationale: TYT's algorithm here shows a cross-referencing feature. It integrates knowledge from other parts of the codebase (Mishnah Bekhorot 6:2) to refine the definition of a mum. A wart in the white of the eye alone would be a false positive according to general rules. The presence of hair transforms it into a true mum, indicating a more severe or unnatural growth. This is like a patch that fixes a generalized rule (NoBlemishesInWhiteOfEye) with a specific exception (WartWithHairInWhiteOfEye).
  2. "One of its eyes large and one small..." (Mishnah Bekhorot 6:10:13, R. Ḥanina ben Antigonus)

    • TYT's Algorithm (Contrasting with Rambam): TYT delves into the "one eye large and one small" debate. He explicitly states that if both eyes are large or both are small, it's not a blemish (IF (Eye.Size[0] == Eye.Size[1] == Large) OR (Eye.Size[0] == Eye.Size[1] == Small) THEN NOT_BLEMISH). Why? Because "it is due to excessive health or excessive emaciation." This suggests a systemic, symmetrical condition, not a localized defect. The blemish arises specifically from asymmetry: IF (Eye.Size[0] != Eye.Size[1]) THEN (IF (Eye.Size[0] == Large AND Eye.Size[1] == Small) OR (Eye.Size[0] == Small AND Eye.Size[1] == Large)) THEN Blemish. He further explains that if the disparity were due to general health/emaciation, both should be affected symmetrically. Therefore, asymmetry implies a specific, localized defect.
    • Rationale: TYT's logic adds an SymmetryCheck() method to the EyeSizeDisparity module. It distinguishes between systemic conditions (not mumim) and localized defects (mumim). He then engages with the Kessef Mishneh (KM) who claims the Rabbis, not R. Hanina, said this, and that Rambam rules like the Rabbis. TYT argues against KM, suggesting that Rambam does rule like R. Hanina in many cases, and that the Mishnah's context supports R. Hanina. This is a complex interpretation of authorial intent and ruling precedence within the "codebase," affecting which "developer's" function is called. He points out Rambam's consistency in adopting R. Hanina's other rulings on warts and bone damage. This shows TYT's algorithm includes a RulePrecedenceResolver() module.

Implementation C: Rabbi Akiva Eiger's Nuanced Parsing (The "Syntax Analyzer")

Rabbi Akiva Eiger (RAE) is famous for his analytical rigor, often identifying subtle ambiguities in textual phrasing that other commentators might overlook. He's like a "syntax analyzer" or "semantic parser," dissecting the precise meaning of each word to find hidden logical branches.

  1. "One of its eyes large and one small..." (Mishnah Bekhorot 6:10:13, R. Ḥanina ben Antigonus)
    • RAE's Algorithm: RAE, in his notes, critically examines the phrasing "one large and one small." He notes that prima facie (בפשוטו נראה), this could mean "one large and the other normal" OR "one small and the other normal." This would be a simple OR condition: IF (Eye.Size[0] == Large AND Eye.Size[1] == Normal) OR (Eye.Size[0] == Normal AND Eye.Size[1] == Small) THEN Blemish. He points out that Rashi seems to interpret it this way. However, RAE then contrasts this with Rambam, his Mishnah commentary, his Mishneh Torah, and the Tur, all of whom consistently phrase it as "one eye large like a calf's and the other small like a goose's" (שתהא עינו א' גדולה כשל עגל והשנייה קטנה כשל אווז).
    • Rationale: RAE highlights a crucial parsing difference. The Mishnah's original Hebrew "עינו אחת גדולה ואחת קטנה" could be read distributively ("one is large, and one is small" – implying potentially two independent conditions relative to a norm) or conjunctively ("one is large and the other is small" – implying a specific, simultaneous two-sided anomaly). Rambam's interpretation, according to RAE, opts for the conjunctive, more stringent definition. This means Rambam's EyeSizeDisparity module has a stricter input requirement. RAE's contribution is to articulate this ambiguity, effectively debugging a potential parsing error in the MishnahTextParser component. His algorithm involves a SemanticAmbiguityResolver() that analyzes textual structure to determine the most likely intended logical operation (AND vs. OR).

Implementation D: Mishnat Eretz Yisrael's Lexical Re-evaluation (The "Linguistic Refactor")

Mishnat Eretz Yisrael (MEI) often provides a more modern, philological, and text-critical approach. This is akin to a "linguistic refactor" or a "code archaeology" project, where the very meaning of the keywords is re-examined, potentially altering the entire interpretation of a blemish's definition.

  1. "ושנפגם עצם ידו... ושנפסק עצמו שבפיו" (Mishnah Bekhorot 6:10:13, R. Ḥanina ben Antigonus)
    • MEI's Algorithm: MEI notes that later printings often "corrected" the word "שניפקס" (sh'nifkas) to "שנפגם" (sh'nifgam - damaged/lacking) or "ושנפסק" (sh'nifsek - cut/severed). However, MEI's analysis, informed by manuscript evidence and linguistic research (citing Lieberman on Greek pekos meaning hair or membrane), suggests "פקס" could mean "to remove hair" or "to remove a membrane/skin."
    • If "פקס" means "remove hair": The blemish for "bone of its foreleg/hindleg" would not be a physical break/damage to the bone itself, but rather "bones of the legs covered with wool, contrary to the normal state where bones are almost completely smooth." Similarly, for the "bone of its mouth," it could mean "hair growing inside the mouth."
    • MEI's Revised BoneBlemishClassifier:
      • IF (Bone.Location == 'Leg' AND Bone.IsCoveredWithWool == TRUE AND NormalState.LegBonesAreSmooth == TRUE) THEN Blemish.
      • IF (Bone.Location == 'Mouth' AND Bone.HasInternalHairGrowth == TRUE) THEN Blemish.
    • Rationale: This is a radical reinterpretation. Instead of a structural integrity check (Bone.IsBroken or Bone.IsDamaged), MEI proposes a surface condition check (Bone.HasAbnormalHair/Wool). This fundamentally changes the BoneBlemish module's input parameters and its internal logic. It moves from a "physical trauma" model to an "abnormal growth/texture" model. This highlights how a single word's interpretation can completely refactor an entire section of the algorithm, leading to vastly different IsBlemished() outcomes. MEI's approach reminds us that the "data dictionary" (the meaning of Mishnaic terms) is not always static and can undergo significant redefinition based on new linguistic insights. It introduces a LexicalReconstructor() component to the system.

Comparison Summary:

| Feature/Blemish | Rambam (Algorithm A - Strict API) ``` graph TD A[Start: Evaluate Animal for Blemish] --> B{Ear Blemishes?}; B --> B1{Cartilage Lacking?}; B1 -- Yes --> B1a[Blemish: Ear Cartilage Damage]; B1 -- No --> B2{Skin Damaged?}; B2 -- Yes --> B2a[Not Blemish: Skin Only]; B2 -- No --> B3{Ear Split (not lacking)?}; B3 -- Yes --> B3a[Blemish: Ear Split]; B3 -- No --> B4{Ear Pierced (Bitter Vetch size)?}; B4 -- Yes --> B4a[Blemish: Ear Pierced]; B4 -- No --> B5{Ear Desiccated?}; B5 -- Yes --> B5a{Pierced, No Blood?}; B5a -- Yes --> B5a1[Blemish: Ear Desiccated (No Blood)]; B5a -- No --> B5b{Crumbles on Touch (R. Yosei)?}; B5b -- Yes --> B5b1[Blemish: Ear Desiccated (Crumble)]; B5b -- No --> B6{Kid Ear Doubled?}; B6 -- Yes --> B6a{Has its own bone?}; B6a -- Yes --> B6a1[Blemish: Kid Ear Doubled w/ Bone]; B6a -- No --> B6b1[Not Blemish: Kid Ear Doubled w/o Bone]; B6a -- No --> B6c[Continue];

B -- No --> C{Eye Blemishes?};
C --> C1{Eyelid Pierced/Damaged/Split?};
C1 -- Yes --> C1a[Blemish: Eyelid Damage];
C1 -- No --> C2{Pupil Covered?};
C2 -- Yes --> C2a{Cataract/Snail/Snake/Berry?};
C2a -- Yes --> C2a1[Blemish: Pupil Covering];
C2a -- No --> C2b{Tevallul?};
C2b -- Yes --> C2b1{White Thread bisects Iris, enters Black Pupil?};
C2b1 -- Yes --> C2b1a[Blemish: White Tevallul];
C2b1 -- No --> C2b2{Black Thread bisects Iris, enters White Eye?};
C2b2 -- Yes --> C2b2a[Not Blemish: Black Tevallul];
C2b2 -- No --> C3{Pale Spots/Tears?};
C3 -- Yes --> C3a{Constant?};
C3a -- Yes --> C3a1{Pale Spots Persisted 80 Days (R. Hananya: 3 exams in 80 days)?};
C3a1 -- Yes --> C3a1a[Blemish: Constant Pale Spots];
C3a1 -- No --> C3a1b[Not Blemish: Non-Constant Pale Spots];
C3a -- Yes --> C3a2{Tears Unhealed by Moist-Dry Fodder?};
C3a2 -- Yes --> C3a2a[Blemish: Constant Tears];
C3a2 -- No --> C3a2b[Not Blemish: Non-Constant Tears];
C3a -- No --> C3b[Not Blemish: Non-Constant Spots/Tears];
C3 -- No --> C4{Eye Wart (R. Hanina ben Antigonus)?};
C4 -- Yes --> C4a[Blemish: Eye Wart];
C4 -- No --> C5{Eye Round like Human (Ila)?};
C5 -- Yes --> C5a[Blemish: Human-like Eye];
C5 -- No --> C6{One Eye Large, One Small (Visible)?};
C6 -- Yes --> C6a[Blemish: Visible Eye Size Disparity];
C6 -- No --> C7[Continue];

C -- No --> D{Nose/Lip/Mouth/Gums Blemishes?};
D --> D1{Nose Pierced/Damaged/Split?};
D1 -- Yes --> D1a[Blemish: Nose Damage];
D1 -- No --> D2{Lip Pierced/Damaged/Split?};
D2 -- Yes --> D2a[Blemish: Lip Damage];
D2 -- No --> D3{External Gums Damaged/Scratched?};
D3 -- Yes --> D3a[Blemish: External Gum Damage];
D3 -- No --> D4{Internal Gums Extracted?};
D4 -- Yes --> D4a[Blemish: Internal Gum Extraction];
D4 -- No --> D5{Internal Gums Damaged (Not Extracted)?};
D5 -- Yes --> D5a[Not Blemish: Internal Gum Damage (Not Extracted)];
D5 -- No --> D6{Mouth Similar to Pig (Ila)?};
D6 -- Yes --> D6a[Blemish: Pig-like Mouth];
D6 -- No --> D7{Most of Speech-Tongue Removed (Ila)?};
D7 -- Yes --> D7a[Blemish: Tongue Damage];
D7 -- No --> D8{Lower Jaw Protrudes (R. Gamliel incident)?};
D8 -- Yes --> D8a[Blemish: Jaw Protrusion];
D8 -- No --> D9{Jaw Bone Dislocated (R. Hanina ben Antigonus)?};
D9 -- Yes --> D9a[Blemish: Dislocated Jaw Bone];
D9 -- No --> D10[Continue];

D -- No --> E{Genital/Tail Blemishes?};
E --> E1{Pouch/Female Genitalia Damaged?};
E1 -- Yes --> E1a[Blemish: Genital Damage];
E1 -- No --> E2{Tail Damaged from Tailbone?};
E2 -- Yes --> E2a[Blemish: Tailbone Damage];
E2 -- No --> E3{Tail Damaged from Joint?};
E3 -- Yes --> E3a[Not Blemish: Tail Joint Damage (Heals)];
E3 -- No --> E4{End of Tail Split (Skin/Flesh Removed, Bone Exposed)?};
E4 -- Yes --> E4a[Blemish: Tail End Split];
E4 -- No --> E5{Full Fingerbreadth Flesh Between Joints?};
E5 -- Yes --> E5a[Blemish: Flesh Between Tail Joints];
E5 -- No --> E6{No Testicles or One Testicle?};
E6 -- Yes --> E6a[Blemish: Cryptorchid/Monorchid];
E6 -- No --> E7{Testicle Ascertainment (R. Akiva/R. Yochanan)?};
E7 -- Yes --> E7a[Blemish (if no testicle found)];
E7 -- No --> E8{Kid Tail Pig-like or <3 Joints (R. Hanina ben Gamliel)?};
E8 -- Yes --> E8a[Blemish: Kid Tail Deformity];
E8 -- No --> E9{Calf Tail Does Not Reach Arkov (Sages)?};
E9 -- Yes --> E9a[Blemish: Short Calf Tail];
E9 -- No --> E10{Tumtum or Androgynos?};
E10 -- Yes --> E10a{R. Shimon: Blemish};
E10a -- Yes --> E10a1[Blemish: Tumtum/Androgynos (R. Shimon)];
E10a -- No --> E10b{Rabbis: Not Bekhor, Shear/Labor};
E10b -- Yes --> E10b1[Not Blemish: Not Bekhor (Rabbis)];
E10 -- No --> E11[Continue];

E -- No --> F{Leg/Hoof/Body Blemishes?};
F --> F1{5 Legs or 3 Legs?};
F1 -- Yes --> F1a[Blemish: Leg Count Anomaly];
F1 -- No --> F2{Hooves Closed like Donkey?};
F2 -- Yes --> F2a[Blemish: Donkey-like Hooves];
F2 -- No --> F3{Shaḥul (Thighbone Dislocated)?};
F3 -- Yes --> F3a[Blemish: Dislocated Thighbone];
F3 -- No --> F4{Kasul (One Thigh Higher)?};
F4 -- Yes --> F4a[Blemish: Asymmetrical Thighs];
F4 -- No --> F5{Foreleg/Hindleg Bone Broken (even if not conspicuous)?};
F5 -- Yes --> F5a[Blemish: Broken Leg Bone];
F5 -- No --> F6{Foreleg/Hindleg Bone Damaged (R. Hanina ben Antigonus)?};
F6 -- Yes --> F6a[Blemish: Damaged Leg Bone];
F6 -- No --> F7[Continue];

F -- No --> G{Non-Blemishes (Disqualifiers)?};
G --> G1{Pale Spots/Tears NOT Constant?};
G1 -- Yes --> G1a[Not Blemish: Non-Constant Spots/Tears];
G1 -- No --> G2{Internal Gums Damaged NOT Extracted?};
G2 -- Yes --> G2a[Not Blemish: Internal Gum Damage (Not Extracted)];
G2 -- No --> G3{Boils (Garav/Hazazit)/Warts?};
G3 -- Yes --> G3a[Not Blemish: Skin Conditions];
G3 -- No --> G4{Old/Sick/Foul Odor?};
G4 -- Yes --> G4a[Not Blemish: Health/Age/Odor];
G4 -- No --> G5{Transgression Performed/Killed Person (1 Witness/Owner)?};
G5 -- Yes --> G5a[Not Blemish: Behavioral/Ritual Impurity];
G5 -- No --> H[No Blemish Found: Animal is Consecrated for Temple Offering];

B1a, B3a, B4a, B5a1, B5b1, B6a1, C1a, C2a1, C2b1a, C3a1a, C3a2a, C4a, C5a, C6a, D1a, D2a, D3a, D4a, D6a, D7a, D8a, D9a, E1a, E2a, E4a, E5a, E6a, E7a, E8a, E9a, E10a1, F1a, F2a, F3a, F4a, F5a, F6a --> I[Blemish Found: Animal Permitted for Consumption Outside Temple];
B2a, B6b1, C2b2a, C3a1b, C3a2b, C3b, D5a, E3a, E10b1, G1a, G2a, G3a, G4a, G5a, H --> J[End Process];

| Interpreter (Algorithm) | Strengths                                                                | Weaknesses                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         ```

graph TD A[Start: Evaluate Bekhor for Blemish] --> B{Ear Blemishes?}; B --> B1{Cartilage Lacking?}; B1 -- Yes --> B1a[Blemish: Ear Cartilage Damage - M 6:10:1]; B1 -- No --> B2{Skin Damaged?}; B2 -- Yes --> B2a[Not Blemish: Skin Only - M 6:10:1]; B2 -- No --> B3{Ear Split (not lacking)?}; B3 -- Yes --> B3a[Blemish: Ear Split - M 6:10:1]; B3 -- No --> B4{Ear Pierced (Bitter Vetch size)?}; B4 -- Yes --> B4a[Blemish: Ear Pierced - M 6:10:1]; B4 -- No --> B5{Ear Desiccated?}; B5 -- Yes --> B5a{Pierced, No Blood?}; B5a -- Yes --> B5a1[Blemish: Ear Desiccated (No Blood) - M 6:10:1]; B5a -- No --> B5b{Crumbles on Touch (R. Yosei)?}; B5b -- Yes --> B5b1[Blemish: Ear Desiccated (Crumble) - M 6:10:1]; B5b -- No --> B6{Kid Ear Doubled?}; B6 -- Yes --> B6a{Has its own bone?}; B6a -- Yes --> B6a1[Blemish: Kid Ear Doubled w/ Bone - M 6:10:12]; B6a -- No --> B6b1[Not Blemish: Kid Ear Doubled w/o Bone - M 6:10:12]; B6a -- No --> B6c[Continue];

B -- No --> C{Eye Blemishes?};
C --> C1{Eyelid Pierced/Damaged/Split?};
C1 -- Yes --> C1a[Blemish: Eyelid Damage - M 6:10:2];
C1 -- No --> C2{Pupil Covered?};
C2 -- Yes --> C2a{Cataract/Snail/Snake/Berry?};
C2a -- Yes --> C2a1[Blemish: Pupil Covering - M 6:10:2];
C2a -- No --> C2b{Tevallul?};
C2b -- Yes --> C2b1{White Thread bisects Iris, enters Black Pupil?};
C2b1 -- Yes --> C2b1a[Blemish: White Tevallul - M 6:10:3];
C2b1 -- No --> C2b2{Black Thread bisects Iris, enters White Eye?};
C2b2 -- Yes --> C2b2a[Not Blemish: Black Tevallul - M 6:10:3];
C2b2 -- No --> C3{Pale Spots/Tears?};
C3 -- Yes --> C3a{Constant?};
C3a -- Yes --> C3a1{Pale Spots Persisted 80 Days (R. Hananya: 3 exams in 80 days)?};
C3a1 -- Yes --> C3a1a[Blemish: Constant Pale Spots - M 6:10:4];
C3a1 -- No --> C3a1b[Not Blemish: Non-Constant Pale Spots - M 6:11:1];
C3a -- Yes --> C3a2{Tears Unhealed by Moist-Dry Fodder (specifically Moist then Dry)?};
C3a2 -- Yes --> C3a2a[Blemish: Constant Tears - M 6:10:5];
C3a2 -- No --> C3a2b[Not Blemish: Non-Constant Tears - M 6:11:1];
C3a -- No --> C3b[Not Blemish: Non-Constant Spots/Tears - M 6:11:1];
C3 -- No --> C4{Eye Wart (R. Hanina ben Antigonus)?};
C4 -- Yes --> C4a[Blemish: Eye Wart - M 6:10:13, TYT 6:10:1];
C4 -- No --> C5{Eye Round like Human (Ila)?};
C5 -- Yes --> C5a[Blemish: Human-like Eye - M 6:10:11];
C5 -- No --> C6{One Eye Large, One Small (Visible)?};
C6 -- Yes --> C6a[Blemish: Visible Eye Size Disparity - M 6:10:13, TYT 6:10:4, RAE 6:10:1];
C6 -- No --> C7[Continue];

C -- No --> D{Nose/Lip/Mouth/Gums Blemishes?};
D --> D1{Nose Pierced/Damaged/Split?};
D1 -- Yes --> D1a[Blemish: Nose Damage - M 6:10:6];
D1 -- No --> D2{Lip Pierced/Damaged/Split?};
D2 -- Yes --> D2a[Blemish: Lip Damage - M 6:10:6];
D2 -- No --> D3{External Gums Damaged/Scratched?};
D3 -- Yes --> D3a[Blemish: External Gum Damage - M 6:10:7];
D3 -- No --> D4{Internal Gums Extracted?};
D4 -- Yes --> D4a[Blemish: Internal Gum Extraction - M 6:10:7];
D4 -- No --> D5{Internal Gums Damaged (Not Extracted)?};
D5 -- Yes --> D5a[Not Blemish: Internal Gum Damage (Not Extracted) - M 6:11:1];
D5 -- No --> D6{Mouth Similar to Pig (Ila)?};
D6 -- Yes --> D6a[Blemish: Pig-like Mouth - M 6:10:11];
D6 -- No --> D7{Most of Speech-Tongue Removed (Ila)?};
D7 -- Yes --> D7a[Blemish: Tongue Damage - M 6:10:11];
D7 -- No --> D8{Lower Jaw Protrudes (R. Gamliel incident)?};
D8 -- Yes --> D8a[Blemish: Jaw Protrusion - M 6:10:12];
D8 -- No --> D9{Jaw Bone Dislocated (R. Hanina ben Antigonus)?};
D9 -- Yes --> D9a[Blemish: Dislocated Jaw Bone - M 6:10:13];
D9 -- No --> D10[Continue];

D -- No --> E{Genital/Tail Blemishes?};
E --> E1{Pouch/Female Genitalia Damaged?};
E1 -- Yes --> E1a[Blemish: Genital Damage - M 6:10:8];
E1 -- No --> E2{Tail Damaged from Tailbone?};
E2 -- Yes --> E2a[Blemish: Tailbone Damage - M 6:10:8];
E2 -- No --> E3{Tail Damaged from Joint?};
E3 -- Yes --> E3a[Not Blemish: Tail Joint Damage (Heals) - M 6:10:8];
E3 -- No --> E4{End of Tail Split (Skin/Flesh Removed, Bone Exposed)?};
E4 -- Yes --> E4a[Blemish: Tail End Split - M 6:10:8];
E4 -- No --> E5{Full Fingerbreadth Flesh Between Joints?};
E5 -- Yes --> E5a[Blemish: Flesh Between Tail Joints - M 6:10:8];
E5 -- No --> E6{No Testicles or One Testicle?};
E6 -- Yes --> E6a[Blemish: Cryptorchid/Monorchid - M 6:10:9];
E6 -- No --> E7{Testicle Ascertainment (R. Akiva/R. Yochanan incident)?};
E7 -- Yes --> E7a[Blemish (if no testicle found attached to loins) - M 6:10:9];
E7 -- No --> E8{Kid Tail Pig-like or <3 Joints (R. Hanina ben Gamliel)?};
E8 -- Yes --> E8a[Blemish: Kid Tail Deformity - M 6:10:12];
E8 -- No --> E9{Calf Tail Does Not Reach Arkov (Sages)?};
E9 -- Yes --> E9a[Blemish: Short Calf Tail - M 6:10:14];
E9 -- No --> E10{Tumtum or Androgynos?};
E10 -- Yes --> E10a{R. Shimon: Blemish - M 6:11:3};
E10a -- Yes --> E10a1[Blemish: Tumtum/Androgynos (R. Shimon)];
E10a -- No --> E10b{Rabbis: Not Bekhor, Shear/Labor - M 6:11:3};
E10b -- Yes --> E10b1[Not Blemish: Not Bekhor (Rabbis)];
E10 -- No --> E11[Continue];

E -- No --> F{Leg/Hoof/Body Blemishes?};
F --> F1{5 Legs or 3 Legs?};
F1 -- Yes --> F1a[Blemish: Leg Count Anomaly - M 6:10:10];
F1 -- No --> F2{Hooves Closed like Donkey?};
F2 -- Yes --> F2a[Blemish: Donkey-like Hooves - M 6:10:10];
F2 -- No --> F3{Shaḥul (Thighbone Dislocated)?};
F3 -- Yes --> F3a[Blemish: Dislocated Thighbone - M 6:10:10];
F3 -- No --> F4{Kasul (One Thigh Higher)?};
F4 -- Yes --> F4a[Blemish: Asymmetrical Thighs - M 6:10:10];
F4 -- No --> F5{Foreleg/Hindleg Bone Broken (even if not conspicuous)?};
F5 -- Yes --> F5a[Blemish: Broken Leg Bone - M 6:10:10];
F5 -- No --> F6{Foreleg/Hindleg Bone Damaged (R. Hanina ben Antigonus, per TYT)?};
F6 -- Yes --> F6a[Blemish: Damaged Leg Bone - M 6:10:13, TYT 6:10:2];
F6 -- No --> F7[Continue];

F -- No --> G{Non-Blemishes (Explicitly NOT mumim)?};
G --> G1{Pale Spots/Tears NOT Constant?};
G1 -- Yes --> G1a[Not Blemish: Non-Constant Spots/Tears - M 6:11:1];
G1 -- No --> G2{Internal Gums Damaged NOT Extracted?};
G2 -- Yes --> G2a[Not Blemish: Internal Gum Damage (Not Extracted) - M 6:11:2];
G2 -- No --> G3{Boils (Garav/Hazazit)/Warts?};
G3 -- Yes --> G3a[Not Blemish: Skin Conditions - M 6:11:2];
G3 -- No --> G4{Old/Sick/Foul Odor?};
G4 -- Yes --> G4a[Not Blemish: Health/Age/Odor - M 6:11:2];
G4 -- No --> G5{Transgression Performed/Killed Person (1 Witness/Owner)?};
G5 -- Yes --> G5a[Not Blemish: Behavioral/Ritual Impurity - M 6:11:2];
G5 -- No --> H[No Blemish Found: Animal is Consecrated for Temple Offering];

B1a, B3a, B4a, B5a1, B5b1, B6a1, C1a, C2a1, C2b1a, C3a1a, C3a2a, C4a, C5a, C6a, D1a, D2a, D3a, D4a, D6a, D7a, D8a, D9a, E1a, E2a, E4a, E5a, E6a, E7a, E8a, E9a, E10a1, F1a, F2a, F3a, F4a, F5a, F6a --> I[Blemish Found: Animal Permitted for Consumption Outside Temple];
B2a, B6b1, C2b2a, C3a1b, C3a2b, C3b, D5a, E3a, E10b1, G1a, G2a, G3a, G4a, G5a, H --> J[End Process];

The flow model now includes precise Sefaria line references for each decision node, making it a fully traceable system.

### Edge Cases: Stress Testing the Blemish Classifier

A robust system needs to handle edge cases – inputs that challenge the boundaries of the defined logic. Let's explore several scenarios that might break a naive interpretation of the Mishnah's `IsBlemished()` function, along with their expected outputs according to a nuanced understanding.

#### 1. The 79-Day Eye Spot Conundrum

*   **Input:** An animal presents with pale spots in its eye. It is observed diligently. The spots persist for exactly 79 days. On the 79th day, the owner, anticipating the 80-day threshold, has it examined for the third time. The spots are still present.
*   **Naïve Logic:** `IF (PaleSpots.Duration >= 80_days) THEN Blemish`. A naive implementation would simply check the duration. Since 79 < 80, it would output `NOT_BLEMISH`.
*   **Mishnah's Logic (Mishnah Bekhorot 6:10:4):** The Mishnah states, "Which are the pale spots that are constant? They are any spots that persisted for eighty days." Rabbi Ḥananya ben Antigonus adds: "One examines it three times within eighty days."
    *   **Algorithm Trace:**
        1.  `PaleSpots.Exists = TRUE`.
        2.  Check for constancy: `PaleSpots.IsConstant()`.
        3.  `PaleSpots.Duration = 79`.
        4.  `PaleSpots.NumExaminations = 3`.
        5.  `IF (PaleSpots.Duration >= 80_days)` evaluates to `FALSE`.
        6.  The condition `PaleSpots.NumExaminations >= 3_within_80_days` is also met, but it's a *secondary* condition that refines the 80-day rule, not a replacement. The primary condition of "persisted for eighty days" is not met.
    *   **Expected Output:** `NOT_BLEMISH`. Even with three examinations, the *duration* threshold of 80 full days is a hard requirement. The additional condition from R. Ḥananya is a *refinement* (ensuring it's truly constant *within* that 80-day period), not an alternative path to constancy if the duration itself is insufficient. This highlights the boolean `AND` relationship between the duration and examination count.

#### 2. The Measured-But-Invisible Eye/Ear Disparity

*   **Input:** An animal has one eye that is measurably 10% larger than the other, or one ear that is measurably 5% smaller. However, to the naked, untrained eye, the difference is completely imperceptible. A trained expert using precise instruments confirms the disparity.
*   **Naïve Logic:** `IF (Eye.Size[0] != Eye.Size[1]) THEN Blemish`. A naive system might flag any measurable difference as a blemish.
*   **Mishnah's Logic (Mishnah Bekhorot 6:10:13):** "one of its eyes large and one small, or one of its ears large and one small where the difference in size is detectable **by sight, but not** if it is detectable only **by being measured.**"
    *   **Algorithm Trace:**
        1.  `Eye.SizeDisparity.Exists = TRUE` (based on measurement).
        2.  Check `Eye.SizeDisparity.IsVisible()`. This method specifically checks if the difference can be perceived without instruments.
        3.  `Eye.SizeDisparity.IsVisible()` evaluates to `FALSE` in this scenario.
        4.  The final conditional for this blemish requires `AND (Eye.SizeDisparity.IsVisible() == TRUE)`.
    *   **Expected Output:** `NOT_BLEMISH`. The Mishnah explicitly includes a crucial visibility constraint. A blemish must be *conspicuous* (גלוי). A difference detectable only by measurement, however real, is insufficient to disqualify the *bekhor*. This emphasizes the importance of the blemish's observable nature for its halakhic impact. It's not just a physical defect, but a *visible* one.

#### 3. The Concealed Testicle That Can't Be Mashed Out

*   **Input:** An animal appears to have only one scrotal sac, suggesting monorchidism. Following Rabbi Akiva's procedure (Mishnah Bekhorot 6:10:9), the animal is seated on its rump, and the sac is mashed. No second testicle emerges. However, a post-slaughter examination reveals a second, fully formed testicle firmly attached deep within the loin, completely inaccessible and undetectable by palpation or external manipulation.
*   **Naïve Logic:** `IF (Testicles.Count < 2) THEN Blemish`. A naive check would simply count visible testicles. Rabbi Akiva's method adds a layer: `IF (Testicles.Count < 2 OR Testicles.CanBePalpated < 2) THEN Blemish`.
*   **Mishnah's Logic (Mishnah Bekhorot 6:10:9):** "Rabbi Akiva says: One seats the animal on its rump and mashes the sac; if there is a testicle, ultimately it is going to emerge. There was an incident where one mashed the sac and the testicle did not emerge. Then, the animal was slaughtered and the testicle was discovered attached to the loins. And Rabbi Akiva permitted... and Rabbi Yoḥanan ben Nuri prohibited."
    *   **Algorithm Trace (R. Akiva's branch):**
        1.  `Testicles.VisibleCount = 1`.
        2.  `Testicles.AscertainmentProcedure(Animal)`.
        3.  `Testicles.EmergenceAfterMashing = FALSE`.
        4.  R. Akiva's ruling: `IF (Testicles.EmergenceAfterMashing == FALSE) THEN Blemish`. The fact that it was *found* later attached to the loins is irrelevant to R. Akiva's initial determination *before* slaughter. The `IsBlemished()` function is evaluated at the time of the *bekhor*'s status determination for consumption, not post-mortem.
    *   **Algorithm Trace (R. Yoḥanan ben Nuri's branch):**
        1.  `Testicles.VisibleCount = 1`.
        2.  `Testicles.AscertainmentProcedure(Animal)`.
        3.  `Testicles.EmergenceAfterMashing = FALSE`.
        4.  However, R. Yoḥanan ben Nuri's implicit logic holds that `IF (Testicles.ActualCount < 2) THEN Blemish`. If a testicle *exists*, even if concealed, the animal is not monorchid. The `IsBlemished()` function should reflect the *actual* physiological state, not just the detectable one.
    *   **Expected Output:** This is a classic `AmbiguousResult` due to a difference in underlying philosophical assumptions (detectability vs. actuality). According to Rabbi Akiva, it *is* a blemish because the testicle did not emerge, fulfilling his criterion. According to Rabbi Yoḥanan ben Nuri, it is *not* a blemish because the testicle *was* present, even if hidden. The Mishnah presents this as a disagreement, meaning the final `SacrificialStatusEnum` would depend on which authority's `IsBlemished()` implementation is followed. This demonstrates that even with well-defined steps, the interpretation of what constitutes a "valid" input state can differ.

#### 4. The Tail Damaged *Between* Joints, Less Than a Fingerbreadth

*   **Input:** An animal's tail has a segment of skin and flesh removed *between* two vertebrae (not at the tailbone and not directly at a joint). The exposed bone segment is short, less than a full fingerbreadth in length.
*   **Naïve Logic:** `IF (Tail.BoneExposed == TRUE) THEN Blemish`. A naive system might just look for bone exposure. Or, if it sees "between joints," it might automatically apply the "full fingerbreadth" rule without checking the length.
*   **Mishnah's Logic (Mishnah Bekhorot 6:10:8):** "the tail was damaged from the tailbone, but not if it was damaged from the joint... or in a case where the end of the tail is split, i.e., the skin and the flesh were removed and the bone remained exposed; or in a case where there is a full fingerbreadth of flesh between one joint and another joint."
    *   **Algorithm Trace:**
        1.  `Tail.DamageLocation != 'Tailbone'` (so not the first condition).
        2.  `Tail.DamageLocation != 'Joint'` (so not the "not a blemish" condition).
        3.  Is it "end of the tail split, skin/flesh removed, bone exposed?" The damage is *between* joints, not necessarily the *end*. This condition is likely `FALSE`.
        4.  Is it "a full fingerbreadth of flesh between one joint and another joint?" This refers to an *excess* of flesh, not a *lack* or exposed bone. This condition is also `FALSE`.
    *   **Interpretation of the Mishnah:** The Mishnah lists specific, distinct conditions for tail blemishes. Damage *from* the tailbone is a blemish. Damage *from* a joint is *not* a blemish (because it heals). Exposed bone at the *end* of the tail is a blemish. An *excess* of flesh between joints (a full fingerbreadth) is a blemish. The input scenario (exposed bone *between* joints, *less than* a fingerbreadth) does not fit any of the *positive* blemish definitions. The "damaged from the joint" rule implies healing, but this is bone exposure, not just damage. The Mishnah does not explicitly cover this exact scenario. However, the general principle of *mumim* often requires a significant, permanent, and visible defect that impacts the animal's "perfection." Exposed bone is severe, but the Mishnah is specific about *where* and *how*. Without an explicit inclusion, and given the healing nature of joint damage, this would likely *not* be considered a blemish unless it falls under a broader, unstated principle of significant bone exposure. Given the strictness of the *bekhor* laws, we default to `NOT_BLEMISH` if not explicitly included.
    *   **Expected Output:** `NOT_BLEMISH`. This scenario falls through the cracks of the explicit definitions. The principle of *kol mum she'eino galuy eino mum* (any blemish that is not visible is not a blemish) and the specificity of the listed *mumim* would generally lead to leniency when a condition isn't explicitly defined as a *mum*.

#### 5. The Androgynous Animal with Ambiguous Genitalia

*   **Input:** An animal is born as an *androgynos* (hermaphrodite), possessing both male and female sexual organs.
*   **Naïve Logic:** `IF (Genitals.Androgynos == TRUE) THEN Blemish`. Given that many genital defects are blemishes, a naive approach might classify this as one.
*   **Mishnah's Logic (Mishnah Bekhorot 6:11:3):** "And one does not slaughter a *tumtum*, whose sexual organs are concealed, and a hermaphrodite [<i>ve'anderoginos</i>], which has both male and female sexual organs, neither in the Temple nor in the rest of the country. Rabbi Shimon says: You have no blemish greater than that, and it may be slaughtered. And the Rabbis say: The halakhic status of a hermaphrodite is not that of a firstborn; rather, its halakhic status is that of a non-sacred animal that may be shorn and utilized for labor."
    *   **Algorithm Trace (R. Shimon's branch):**
        1.  `Genitals.Androgynos = TRUE`.
        2.  R. Shimon's `IsBlemished()`: `IF (Genitals.Androgynos == TRUE) THEN Blemish`. He sees it as the ultimate blemish, allowing slaughter.
    *   **Algorithm Trace (Rabbis' branch):**
        1.  `Genitals.Androgynos = TRUE`.
        2.  Rabbis' `IsBlemished()`: `IF (Genitals.Androgynos == TRUE) THEN Result = NOT_BEKHOR`. They argue it's not a blemish that permits consumption *as a firstborn*, but rather that the animal fundamentally lacks the identity of a *bekhor* due to its ambiguous gender. Therefore, it's treated as a regular, non-sacred animal from the outset.
    *   **Expected Output:** Another `AmbiguousResult`, but with a critical distinction. Rabbi Shimon considers it a blemish that *permits* the firstborn. The Rabbis, however, introduce a `StatusRefactor` at a higher level: the animal is not a *bekhor* at all. This means its status is *not* `BlemishedBekhor`, but `NonSacredAnimal`. This is a system-level reclassification, not just a blemish assessment. This highlights that some "edge cases" don't just test the blemish function, but challenge the very input type (`AnimalObject` must be a valid `Bekhor` instance).

These edge cases demonstrate the Mishnah's nuanced, sometimes contradictory, and often highly specific nature. They underscore the need for precise interpretation and highlight areas where different "algorithms" (commentators) provide distinct solutions based on their understanding of underlying principles.

### Refactor: Introducing a Blemish Ontology and Conspicuousness Threshold

The Mishnah, as presented, reads like a flat list of features. While our decision tree organizes it, the underlying logic still feels like a series of `if-then` statements rather than a unified theory of *mumim*. To refactor this system for better clarity, maintainability, and extensibility, I propose the introduction of a `BlemishOntology` class and a `ConspicuousnessThreshold` meta-rule.

#### 1. The Blemish Ontology: Categorizing Defects

Instead of a monolithic list, we should categorize *mumim* based on their fundamental nature. This allows for more generalized rules and reduces redundancy. Our `BlemishOntology` could have three primary axes, with sub-categories:

*   **I. Structural Integrity Defects (`StructuralIntegrityBlemish`)**: These are physical breaks, missing parts, or abnormal formations.
    *   `MissingComponent`: Ear cartilage lacking (Mishnah Bekhorot 6:10:1), no testicles (Mishnah Bekhorot 6:10:9), most of speech-tongue removed (Mishnah Bekhorot 6:10:11).
    *   `Deformation`: Ear split (Mishnah Bekhorot 6:10:1), eyelid split (Mishnah Bekhorot 6:10:2), hooves closed like a donkey (Mishnah Bekhorot 6:10:10), lower jaw protrudes (Mishnah Bekhorot 6:10:12), kid tail pig-like (Mishnah Bekhorot 6:10:12).
    *   `BoneDamage`: Foreleg/hindleg bone broken (Mishnah Bekhorot 6:10:10), jaw bone dislocated (Mishnah Bekhorot 6:10:13).
    *   `AbnormalGrowth`: Tevallul (Mishnah Bekhorot 6:10:3), snail/snake/berry growths in eye (Mishnah Bekhorot 6:10:2), doubled kid ear with bone (Mishnah Bekhorot 6:10:12).

*   **II. Functional Impairment Defects (`FunctionalImpairmentBlemish`)**: These relate to a decline in normal biological function.
    *   `SensoryImpairment`: Desiccated ear (Mishnah Bekhorot 6:10:1 – implies loss of normal tissue function), eye covered by cataract (Mishnah Bekhorot 6:10:2 – vision impairment).
    *   `LocomotionImpairment`: 3 or 5 legs (Mishnah Bekhorot 6:10:10), thighbone dislocated (Mishnah Bekhorot 6:10:10), one thigh higher (Mishnah Bekhorot 6:10:10).

*   **III. Permanent Physiological Anomalies (`PermanentAnomalyBlemish`)**: These are conditions that are abnormal, persistent, and not necessarily "damage" in the acute sense.
    *   `ChronicCondition`: Constant pale spots (Mishnah Bekhorot 6:10:4), constant tears (Mishnah Bekhorot 6:10:5).
    *   `Disproportion`: One eye large, one small (Mishnah Bekhorot 6:10:13), one ear large, one small (Mishnah Bekhorot 6:10:13).

This ontology would allow us to write more generic validators. For instance, any `StructuralIntegrityBlemish` that is `MissingComponent` would likely be a *mum* unless explicitly excluded. It also helps to understand *why* certain conditions (like "old or sick" - Mishnah Bekhorot 6:11:2) are *not* blemishes: they represent `TransientHealthCondition` or `AgeRelatedDegeneration`, which fall outside our defined `BlemishOntology` categories of permanent, structural, or functional defects.

#### 2. The Conspicuousness Threshold: A Meta-Rule

The Mishnah repeatedly hints at the idea that a *mum* must be *visible* (גלוי). The "detectable by sight, but not if detectable only by measurement" rule for eye/ear size (Mishnah Bekhorot 6:10:13) is a prime example. The exclusion of "internal gums that were damaged but not extracted" (Mishnah Bekhorot 6:11:2) and "one does not examine from the double teeth, and inward" (Mishnah Bekhorot 6:10:7) further solidifies this.

My proposed refactor would introduce a `ConspicuousnessThreshold` meta-rule:

```python
class BlemishRuleEngine:
    def evaluate(self, animal: AnimalObject) -> SacrificialStatusEnum:
        # Step 1: Check for Non-Bekhor Status (e.g., Androgynos as per Rabbis)
        if self.is_non_bekhor_condition(animal):
            return SacrificialStatusEnum.NON_SACRED_ANIMAL

        # Step 2: Check for Explicit Non-Blemishes
        if self.is_explicitly_not_blemish(animal):
            return SacrificialStatusEnum.ELIGIBLE_FOR_TEMPLE_OFFERING

        # Step 3: Apply Blemish Ontology Checks with Conspicuousness Threshold
        for blemish_category in [StructuralIntegrityBlemish, FunctionalImpairmentBlemish, PermanentAnomalyBlemish]:
            if self.check_category(animal, blemish_category):
                if self.meets_conspicuousness_threshold(animal, blemish_category):
                    return SacrificialStatusEnum.PERMITTED_FOR_CONSUMPTION_OUTSIDE_TEMPLE
        
        # Default: No blemish found
        return SacrificialStatusEnum.ELIGIBLE_FOR_TEMPLE_OFFERING

    def meets_conspicuousness_threshold(self, animal, blemish_type) -> bool:
        # This function would encapsulate rules like:
        # - "detectable by sight, not just measurement"
        # - "not concealed internally"
        # - "visible externally"
        # ...and apply them universally to all blemish types.
        # For example, if a "StructuralIntegrityBlemish.BoneDamage" is deep inside, it fails this threshold.
        pass

    # ... other helper methods for is_non_bekhor_condition and is_explicitly_not_blemish

This ConspicuousnessThreshold would serve as a universal filter. Any defect, no matter how severe, would only qualify as a mum if it passed this visibility test. This clarifies the logic for concealed blemishes and those only detectable by instrumentation. It's not that the defect isn't "real," but that the halakhic system for bekhorot only recognizes visible imperfections as disqualifying mumim.

Benefits of this Refactor:

  1. Clarity: It provides a conceptual framework for understanding the diverse list of mumim, moving beyond enumeration to categorization.
  2. Maintainability: New blemishes (or newly understood ones, like Ila's additions) can be more easily integrated by classifying them within the ontology and checking against the universal ConspicuousnessThreshold.
  3. Extensibility: If the system needs to define new types of mumim in the future (e.g., for other types of offerings or in different contexts), the ontology provides a structured way to do so.
  4. Reduced Redundancy: Instead of repeating "must be visible" or "not internal" for every rule, the ConspicuousnessThreshold becomes a single, overarching constraint applied to all potential mumim. This is a classic DRY (Don't Repeat Yourself) principle from software engineering.

This refactoring elevates the Mishnah's raw data into a more object-oriented, principled system, making its logic both more elegant and more robust.

Takeaway: The Elegance of Ancient Algorithms

Our deep dive into Mishnah Bekhorot 6:10-11 reveals a profound truth: the world of Halakha is not merely a collection of arcane rules, but a sophisticated, often implicitly algorithmic system designed to process complex inputs and yield precise outputs. The Mishnah here functions as an intricate classification algorithm, complete with feature definitions, threshold values, conditional logic, and even a "negative list" of non-qualifying conditions.

The different commentators – Rambam, Tosafot Yom Tov, Rabbi Akiva Eiger, and Mishnat Eretz Yisrael – aren't just memorizing; they're acting as systems architects, reverse-engineering the source code, documenting its API, debugging ambiguities, and even proposing lexical refactors. Their debates are not just academic squabbles but critical discussions about the precise implementation details, parameter definitions, and logical flow of the ancient "Bekhor Blemish Classifier."

What we learn from this isn't just about firstborn animals, but about the enduring human quest to codify reality, to transform the messy analog world into discrete, actionable digital states. The Mishnah, in its delightful geekiness, reminds us that even millennia ago, our sages were building robust, albeit organic, expert systems, designed to navigate the complexities of ritual law with precision and intellectual rigor. It's a testament to the timeless elegance of well-structured thought, a spiritual algorithm that continues to compute, adapt, and inspire.