Daily Rambam · Techie Talmid · On-Ramp

Mishneh Torah, Testimony 2

On-RampTechie TalmidDecember 11, 2025

Greetings, fellow data architects and logic enthusiasts! Your resident nerd-joy educator is here to debug some ancient code with you. Today, we're diving deep into the Mishneh Torah, Rabbi Moshe ben Maimon's monumental halachic API, specifically within the Testimony module, to unpack a fascinating function that handles witness validation. Get ready to trace some execution paths!

Problem Statement

Imagine you're designing a high-stakes judicial system. Your primary input is human testimony, notoriously prone to inconsistencies, memory gaps, and sometimes, outright fabrication. How do you, as a system architect, process divergent data streams from multiple human "sensors" (witnesses) and determine if their combined output is "valid" enough to trigger a critical state change – say, a conviction?

The core "bug report" in this sugya (Mishneh Torah, Testimony 2) is precisely this: How do we parse and validate witness data when there are discrepancies or missing fields? Is a missing data point a fatal error? Is a minor disagreement a system crash? The system needs to be robust, fair, and, crucially, disprovable – ensuring that if witnesses are lying, their falsehood can be exposed. Maimonides provides a sophisticated, multi-tiered data validation schema, differentiating between various types of "input fields" and their respective error-handling protocols. It's a masterclass in conditional logic and data integrity!

Text Snapshot

Let's pull the relevant lines from our source code, Mishneh Torah, Testimony 2, with the Steinsaltz commentary providing our inline documentation:

What is the difference between the chakirot and the derishot and the bedikot? With regard to the chakirot and the derishot, if one witness gave specific testimony and the second said: "I do not know," their testimony is of no consequence. With regard to the bedikot, by contrast, even if both of them say: "I don't know," their testimony is allowed to stand. If, however, they contradict each other, even with regard to the bedikot, their testimony is nullified.

(Steinsaltz on Mishneh Torah, Testimony 2:1:1: The investigation of witnesses includes the seven chakirot where witnesses are questioned precisely where and when the act was done, and the derishot in questions dealing with clarifying the essence of the act (as explained above 1:4). The bedikot are additional questions asked of the witnesses about matters that are not central to the testimony (there 1:6). Here, the halachic difference between these types of questions is explained.)

What is implied? The witnesses testified that one person killed another. One of the witnesses specified the year of the seven year cycle, the year, the month, the date, the day of the week, Wednesday, the time, 12 noon, and the place of the murder. Similarly, they asked him: "With what did he kill him?", and he answered: "With a sword."

(Steinsaltz on Mishneh Torah, Testimony 2:1:10: With a sword.)

If the second witnesses outlined his testimony in the same manner except for the time, i.e., he said: "I do not know the time of day at which the murder took place," or he was able to specify the time, but said: "I don't know what he used to kill him. I did not take notice of the murder weapon," their testimony is nullified.

(Steinsaltz on Mishneh Torah, Testimony 2:1:11: Precisely clarified his testimony except for the time of the event. Steinsaltz on Mishneh Torah, Testimony 2:1:12: I did not pay attention to the weapon in his hand.)

If, however, they outlined all the above factors identically, but were asked: "Was he dressed in black or white?" their testimony is allowed to stand if they replied: "We don't know. We did not pay attention to factors like these which are of no consequence." If one of the witnesses said: "He was wearing black clothes," and the second one said: "That is not so," he was wearing white clothes, their testimony is nullified. It is as one said: "It took place on Wednesday," and the other said: "It took place on Thursday," in which instance, the testimony is of no consequence. Or it can be compared to a situation where one said: ""He killed him with a sword," and the other says: "He killed him with a lance." The need for corroboration of the witnesses' testimony is derived from Deuteronomy 13:15 which states: "And the matter is precise." If they contradicted each other in any matter, their testimony is not precise. The following rules apply if there were many witnesses. If two of them testified in a like manner with regard to the chakirot and the derishot, their testimony is allowed to stand and the defendant is executed, even though the third witness says: "I don't know." If, however, that witness contradicts the other two, even with regard to the bedikot, their testimony is nullified.

If one witness says: "The murder took place on Wednesday, the second of the month," and another says: "It took place on Wednesday, the third of the month," their testimony is allowed to stand. Although there is a contradiction between them, we assume that one knew that an extra day was added to the month, and one did not know. Until when does the above apply? Until the middle of the month. After the middle of the month, by contrast, e.g., one said: "It took place on the sixteenth of the month," and the second said: "It took place on the seventeenth of the month," their testimony is nullified even though both of them spoke about the same day of the week. The rationale is that by the middle of the month, every one knows when Rosh Chodesh was commemorated. If, however, one witness says: "It took place on the third of the month," and the other says: "It took place on the fifth of the month," their testimony is nullified.

If one witness says: "It took place during the second hour of the day," and the other says: "It took place during the third hour," their testimony is allowed to stand. The rationale is that it is common for people to err with regard to one hour. If, however, one says: "It took place during the third hour," and the other says: "It took place during the fifth hour," their testimony is nullified.

If one witness says: "It took place before sunrise," and the other says: "It took place at sunrise," their testimony is nullified. Even though the discrepancy between them is less than one hour, the matter is evident to all. Similar concepts apply with regard to sunset.

Flow Model

Let's visualize the Maimonidean validate_testimony function as a decision tree, mapping out the IF/THEN/ELSE logic.

FUNCTION validate_testimony(witness_data_array)
  INPUT: witness_data_array (array of Witness objects, each with fields for chakirot, derishot, bedikot)
  OUTPUT: BOOLEAN (true if valid, false if nullified)

  1.  INITIALIZE testimony_status = VALID

  2.  PROCESS_CHAK_DER_FIELDS (Critical Path Data - e.g., Date, Time, Place, Weapon, Core Act)
      a.  FOR EACH chak_der_field IN chakirot_derishot_fields:
          i.   Check if ALL witnesses provided data for this field:
               IF any witness says "I don't know" for this field:
                   SET testimony_status = NULLIFIED
                   BREAK (exit function, testimony invalid)
          ii.  Check for CONTRADICTION between witnesses for this field:
               IF witness1.field_value != witness2.field_value:
                   // Special Case: Date/Time discrepancies
                   IF field_is_date OR field_is_time:
                       IF (field_is_date AND is_minor_date_discrepancy(w1_date, w2_date) AND w1_day_of_week == w2_day_of_week AND month_half == "first_half") OR
                          (field_is_time AND is_minor_time_discrepancy(w1_time, w2_time) AND ABS(w1_time - w2_time) <= 1_hour AND NOT (is_sunrise_or_sunset_event)):
                           CONTINUE (allow testimony, assume human error)
                       ELSE:
                           SET testimony_status = NULLIFIED
                           BREAK (exit function, testimony invalid)
                   ELSE: // Not a special date/time case, direct contradiction
                       SET testimony_status = NULLIFIED
                       BREAK (exit function, testimony invalid)
      b.  IF testimony_status == NULLIFIED, RETURN FALSE

  3.  PROCESS_BEDIKOT_FIELDS (Ancillary Data - e.g., Clothing Color)
      a.  FOR EACH bedikot_field IN bedikot_fields:
          i.   Check if ALL witnesses provided data for this field:
               IF any witness says "I don't know" for this field:
                   CONTINUE (allow testimony, "I don't know" is OK for bedikot)
          ii.  Check for CONTRADICTION between witnesses for this field:
               IF witness1.field_value != witness2.field_value:
                   SET testimony_status = NULLIFIED
                   BREAK (exit function, testimony invalid)
      b.  IF testimony_status == NULLIFIED, RETURN FALSE

  4.  RETURN TRUE (testimony is VALID)

Two Implementations

Let's compare two conceptual "algorithms" for processing witness data, derived from Maimonides' text. We'll call them Algorithm A: The "Strict Precision Parser" and Algorithm B: The "Contextual Tolerance Engine." These aren't necessarily competing Rishonim, but rather highlight the nuanced design choices within Maimonides' own system.

Algorithm A: The "Strict Precision Parser"

Core Principle: This algorithm prioritizes absolute data integrity and the paramount need for disprovability (הזמה). It operates on the principle that the core facts of a case (the chakirot and derishot) must be unassailably precise and identical across all primary data streams (witnesses). Any missing data or contradiction in these critical fields is a fatal error, leading to an immediate nullification of the entire testimony. The system's robustness against false testimony is its highest priority.

Data Structures & Logic:

  • Chakirot & Derishot (Critical Path Data):
    • Data Requirement: All witnesses must provide specific, matching data for these fields.
    • null Handling: If witness.chakirot_field == "I don't know" for any witness, for any chakirot or derishot field (like time or weapon_type), the function immediately returns false. This is a non-recoverable error.
    • Contradiction Handling: If witness1.chakirot_field != witness2.chakirot_field, the function immediately returns false. This parser has no built-in "fuzziness" for critical data.
  • Bedikot (Ancillary Metadata):
    • Data Requirement: Witnesses can say "I don't know." The system is tolerant of missing ancillary data.
    • null Handling: If witness.bedikot_field == "I don't know", the parser continues processing. This is a non-critical warning, not an error.
    • Contradiction Handling: If witness1.bedikot_field != witness2.bedikot_field, this is a fatal error. Even for ancillary data, direct contradiction is unacceptable, as it indicates unreliability (Mishneh Torah, Testimony 2:1:1).

Analogy: Think of a compiler with extremely strict type-checking and no implicit conversions. If a required variable is null, or if two variables declared as int are given string values, the compilation fails immediately. The output executable cannot be generated. This algorithm is designed to prevent any ambiguity in the core narrative, ensuring that the "story" is perfectly synchronized across all data sources. The Deuteronomy 13:15 ("And the matter is precise") instruction is its guiding principle.

Algorithm B: The "Contextual Tolerance Engine"

Core Principle: This algorithm acknowledges the "Strict Precision Parser" as its baseline but incorporates a sophisticated layer of "human error tolerance" and "contextual awareness." While still prioritizing disprovability for chakirot and derishot, it introduces specific, limited exceptions for minor discrepancies in certain critical fields (like date and time), recognizing that human perception and recall are not always machine-precise. It's a more "intelligent" parser, designed to distinguish between fundamental disagreement and understandable human fallibility.

Data Structures & Logic:

  • Chakirot & Derishot (Critical Path Data):
    • null Handling: Identical to Algorithm A. witness.chakirot_field == "I don't know" for critical fields is still a fatal error (Mishneh Torah, Testimony 2:1:11-12). The ability to disconfirm is paramount.
    • Contradiction Handling (with exceptions): This is where Algorithm B shines.
      • Standard Contradiction: If witness1.field_value != witness2.field_value for most chakirot or derishot (e.g., "Wednesday" vs. "Thursday"; "sword" vs. "lance"), it's a fatal error, returning false (Mishneh Torah, Testimony 2:1:13).
      • Date Discrepancy Exception (Mishneh Torah, Testimony 2:1:14):
        • If witness1.date == "Wednesday, 2nd" and witness2.date == "Wednesday, 3rd", and this occurs in the first half of the month, the discrepancy is tolerated. The system assumes a reasonable explanation (one witness knew about an intercalated day, the other didn't). This is a valid = true scenario.
        • However, if witness1.date == "Wednesday, 16th" and witness2.date == "Wednesday, 17th", or if the discrepancy is greater than one day (e.g., "3rd" vs. "5th"), it's a fatal error.
      • Time Discrepancy Exception (Mishneh Torah, Testimony 2:1:15):
        • If witness1.time == "2nd hour" and witness2.time == "3rd hour", the discrepancy is tolerated. The system recognizes that people commonly err by a single hour. This is a valid = true scenario.
        • However, if witness1.time == "3rd hour" and witness2.time == "5th hour", the discrepancy is too large and becomes a fatal error.
      • "Evident to All" Override (Mishneh Torah, Testimony 2:1:16): Even if the time difference is less than an hour, if the event is objectively obvious (e.g., "before sunrise" vs. "at sunrise"), the system reverts to strict precision. The perceived ease of accurate observation overrides the one-hour tolerance.
  • Bedikot (Ancillary Metadata):
    • null Handling: Identical to Algorithm A.
    • Contradiction Handling: Identical to Algorithm A.

Analogy: This is like a modern programming language's parser that has built-in linting and error correction. It's strict by default, but it understands common patterns of human input and has configurable tolerance levels for minor deviations in specific contexts, as long as the core semantic meaning (the event itself) is still clearly identifiable and provable. It's an optimized compiler that allows for "fuzzy matching" in specific, predefined scenarios.

Comparison Summary:

Feature Algorithm A: Strict Precision Parser Algorithm B: Contextual Tolerance Engine
Philosophy Maximize disprovability, eliminate ambiguity. Balance disprovability with human reality/fallibility.
Chakirot/Derishot - "I don't know" Fatal error. Fatal error. (Core truth must be known)
Chakirot/Derishot - Contradiction Fatal error. Fatal error, except for specific, minor date/time discrepancies.
Bedikot - "I don't know" Tolerated (non-critical). Tolerated (non-critical). (Ancillary data is optional)
Bedikot - Contradiction Fatal error. Fatal error. (Even ancillary contradictions show unreliability)
"Wednesday 2nd vs 3rd" Would be a contradiction, thus invalid. Valid (if in first half of month). Has specific logic for this case.
"2nd hr vs 3rd hr" Would be a contradiction, thus invalid. Valid. Has specific logic for this case.
"Before vs At sunrise" Would be a contradiction, thus invalid. Invalid. The "evident to all" rule overrides general time tolerance.
Overhead Simpler logic, but potentially discards valid testimony due to minor human error. More complex logic (additional conditional checks), but more robust to real-world input.

Algorithm B represents Maimonides' finely tuned system, which, while demanding ultimate precision for the core elements of testimony, also incorporates a pragmatic understanding of human observation and memory. It's a truly sophisticated piece of judicial software.

Edge Cases

Let's stress-test our system with a couple of inputs that might trip up a naive if (w1_value == w2_value) logic.

  1. Input:

    • Witness 1 (chakira field: Date): "Wednesday, the second of the month"
    • Witness 2 (chakira field: Date): "Wednesday, the third of the month"
    • Context: The event occurred on the tenth of the month (i.e., in the first half of the lunar month).

    Naïve Logic Prediction: w1_date != w2_date -> NULLIFIED (contradiction!) Expected Output (Mishneh Torah): ALLOWED TO STAND (Mishneh Torah, Testimony 2:1:14). Explanation: Our system's Contextual Tolerance Engine has a special exception handler for date discrepancies. If the day of the week matches (Wednesday), and the numerical date differs by only one day, and the event occurs in the first half of the month, the system tolerates this. It assumes one witness might have been aware of a calendrical adjustment (like an intercalated day in the previous month affecting Rosh Chodesh), while the other was not. This reveals a deep understanding of contextual information and human knowledge gaps within the system design.

  2. Input:

    • Witness 1 (chakira field: Time): "The murder took place before sunrise."
    • Witness 2 (chakira field: Time): "The murder took place at sunrise."

    Naïve Logic Prediction: w1_time != w2_time -> NULLIFIED (contradiction!). Or, if applying a 1-hour tolerance: The difference is less than an hour, so perhaps ALLOWED TO STAND. Expected Output (Mishneh Torah): NULLIFIED (Mishneh Torah, Testimony 2:1:16). Explanation: This is a fantastic "override" condition. While the system generally allows a one-hour tolerance for time discrepancies, it has an is_evident_to_all_override flag. Events like "sunrise" or "sunset" are so distinct and publicly observable that even a small discrepancy (less than an hour) becomes critically significant. It's like a system where certain boolean flags (like is_daybreak_event) trigger an immediate return to maximum precision, overriding any general tolerance settings. The reliability of observation for these specific events is assumed to be very high, making even slight differences indicative of unreliability.

Refactor

If we were to refactor the core logic for evaluating witness agreement, a minimal but powerful change would be to explicitly define a materiality_score for each data field.

Original Implied Rule:

  • chakirot/derishot: High materiality (critical for disprovability).
  • bedikot: Low materiality (ancillary).

Refactored Rule with materiality_score:

function evaluate_field_agreement(field_type, w1_value, w2_value, context_flags) {
    const field_metadata = get_field_metadata(field_type); // Returns { materiality_score, tolerance_threshold, override_conditions }

    // Phase 1: Check for "I don't know" (missing data)
    if (w1_value === "I don't know" || w2_value === "I don't know") {
        if (field_metadata.materiality_score > THRESHOLD_FOR_NULL_TOLERANCE) {
            return { status: "NULLIFIED", reason: "Missing critical data" };
        } else {
            return { status: "TOLERATED", reason: "Missing ancillary data" };
        }
    }

    // Phase 2: Check for contradiction
    if (w1_value !== w2_value) {
        // Apply override conditions first (e.g., sunrise/sunset)
        if (field_metadata.override_conditions && field_metadata.override_conditions.some(cond => cond(context_flags, w1_value, w2_value))) {
            return { status: "NULLIFIED", reason: "Contradiction in objectively evident fact" };
        }

        // Apply tolerance threshold
        if (calculate_discrepancy(w1_value, w2_value) <= field_metadata.tolerance_threshold) {
            return { status: "TOLERATED", reason: "Minor discrepancy within tolerance" };
        } else {
            return { status: "NULLIFIED", reason: "Contradiction exceeds tolerance" };
        }
    }

    // No issues found
    return { status: "MATCH", reason: "Witnesses agree" };
}

This single refactoring clarifies that chakirot and derishot simply have higher materiality_score and stricter tolerance_threshold values (often 0 unless specific exceptions apply), while bedikot have a lower materiality_score that allows null values. The "evident to all" rule becomes a specific override_condition that forces tolerance_threshold to 0 regardless of the numerical difference. This modular approach makes the system's logic explicit and extensible.

Takeaway

The Mishneh Torah's approach to witness testimony isn't just a set of rules; it's a sophisticated "expert system" designed to operate in a high-uncertainty environment. It's a triumph of systems thinking, balancing the absolute need for justice and truth with a profound understanding of human nature and its limitations. By segmenting data into "critical path" (chakirot/derishot) and "ancillary metadata" (bedikot), and by implementing contextual tolerance levels and override conditions, Maimonides crafted a judicial algorithm that is both incredibly robust against fraud and remarkably forgiving of honest human error. It's a testament to ancient wisdom anticipating modern challenges in data validation and system design.