Yerushalmi Yomi · Techie Talmid · Standard
Jerusalem Talmud Nazir 2:10:2-3
This is going to be so much fun! Let's dive into the fascinating logic gates and state machines of Tractate Nazir.
Problem Statement – The "Bug Report" in the Sugya
Alright, imagine our Sages are running a complex simulation of vows and timekeeping. Suddenly, a critical bug report comes in!
Bug ID: JTT-NAZIR-2-10-2-3-TIMING-COLLISION
Severity: High (Potential for invalid vows, incorrect ritual timing, and loss of sanctified days)
Description: A user (a nazir) has implemented a conditional vow: "I shall be a nazir if a son is born to me, and I shall be a nazir for 100 days." The system is experiencing unexpected behavior when the birth of the son (the trigger event) occurs during the 100-day nezirut period. Specifically, the system struggles to correctly manage the overlapping time intervals and the associated ritual requirements (shaving, sacrifices). The core issue is how to reconcile two distinct nezirut periods that are initiated by a single event and have a temporal overlap. The system needs to determine:
- Time Unit Granularity: How do we count days? Does the start of a day count as a full day? Does the end of a day count as a full day? This affects the precise boundary conditions.
- Vow Overlap Management: When the son is born, the father's nezirut is interrupted or modified. How do we allocate the days? Does the son's nezirut count towards the father's 100 days?
- Ritual Synchronization: The shaving ceremony marks the completion of a nezirut period. If two nezirut periods are active or pending, how does a single shaving event (or the lack of one) affect both?
- Impurity Impact: How does ritual impurity (especially impurity of a corpse) interact with these overlapping vow periods, particularly when the impurity occurs within the "grace period" or overlap zone?
User Impacted: Any nazir making conditional vows, especially those involving overlapping time periods or events.
Expected Behavior: A clear, deterministic calculation for the number of days to be observed for each nezirut, the timing of required rituals, and the impact of impurity, based on the exact day of the son's birth relative to the father's 100-day vow.
Current Behavior: Conflicting interpretations and difficult edge cases. The current implementation seems to have race conditions where time units are double-counted or lost, leading to incorrect state transitions. This is causing significant downstream errors in ritual observance. The system needs a robust algorithm to handle these temporal dependencies.
Full Experience in the App
Listen. Chat. Go deeper.
Audio playback, interactive chevruta, Hebrew tools, and every daily learning track — only in Derekh Learning.
Text Snapshot
Let's isolate the key lines that define the problem and the proposed solutions. Think of these as the critical code snippets that the debugger is highlighting.
- MISHNAH: "I shall be a nazir if a son is born to me and a nazir for 100 days."
- This establishes the dual vow, one conditional, one absolute for a fixed duration.
- MISHNAH: "If a son is born to him in less than 70 [days], he should not lose anything."
- This is a core constraint. Births within the first 70 days of the 100-day vow don't cause a loss of days from the father's 100-day vow.
- MISHNAH: "After 70 [days], he reduces to 70 since no shaving is for less than 30 days."
- This is the crucial logic for births after 70 days. The 100-day vow effectively becomes a 70-day vow. The "30 days" rule is key here.
- HALAKHAH: "“I shall be a nazir if a son is born to me,” etc. It is obvious that the end of a day is counted as a full [day]."
- This anchors our time unit. The end of a day is a complete unit.
- HALAKHAH: "Is the start of a day counted as a full day?"
- The central question of temporal granularity.
- HALAKHAH: "Is that not the Mishnah: “after 70 [days], he reduces to 70,” not even a part [of a day]? This implies that the start of a day is counted as a full day."
- This is the inferential leap: the reduction implies that even a partial day counts as a full day. If it didn't, he wouldn't "reduce to 70" but potentially 69.
- HALAKHAH: "If he was born on the eightieth day, he eliminates ten."
- A concrete example of the rule in action. 100 days - 80 days = 20 days remaining. But the rule says he reduces to 70 total. So, 100 - 70 = 30 days lost. The text says "eliminates ten" - this refers to the last ten days of his original 100-day vow.
- HALAKHAH: "If he finished his nezirut and came to complete his son’s nezirut and became impure within the first ten days, he eliminates everything."
- This introduces the impurity bug. Impurity within the first 10 days of the son's nezirut (which is concurrent with the father's final days) invalidates everything.
- HALAKHAH: "Within the last twenty days? Rebbi Abba in the name of Rab and Rebbi Joḥanan both say, he eliminates thirty."
- A different impurity scenario, leading to a different loss.
- HALAKHAH: "Rebbi Samuel said, he eliminates seven only."
- A dissenting opinion on the impurity rule.
- HALAKHAH: "Samuel bar Abba asked before Rebbi Yose: Does Rebbi Joḥanan think that eliminating by a shaving knife is identical with substantial eliminating?"
- This is a critical meta-question about the nature of invalidation. Is it like a minor glitch (shaving) or a system crash (substantial impurity)?
- HALAKHAH: "Rebbi Ze‘ira said, if Rebbi Joḥanan thought that eliminating by a shaving knife is identical to substantial eliminating, why would he say that he eliminates thirty? Should he not invalidate everything?"
- Rebbi Ze'ira is using the impurity scenarios to probe Rebbi Johanan's underlying logic about what constitutes total invalidation versus partial reduction.
- HALAKHAH: "Rebbi Abin bar Ḥiyya said before Rebbi Ze‘ira: Explain it if he was born on a day unsuitable to bring a sacrifice."
- This introduces a new parameter: the timing of sacrifices.
- HALAKHAH: "Rebbi Joḥanan said, he shaves and then shaves a second time."
- A specific ruling on shaving when both the father's nezirut and the son's nezirut are completed around the same time.
- HALAKHAH: "A baraita disagrees with Rebbi Joḥanan: 'They asked Rebbi Simeon ben Ioḥai: Assume that he was both a nazir and a sufferer from scale disease...'"
- This introduces a parallel system (scale disease purification) and a conflict with Rebbi Johanan's rule about shaving. The core of the debate is whether a single shaving event can satisfy the requirements of two different ritual processes.
- HALAKHAH: "He said to them: 'if he shaved to remove hair, you would be correct. But the nazir shaves to remove hair whereas the sufferer from scale disease shaves to have hair grow.'"
- The initial distinction based on the purpose of shaving.
- HALAKHAH: "Both of them shave to remove hair." (After further debate).
- The students push back, forcing a deeper analysis of the timing and ritual prerequisites.
- HALAKHAH: "But the nazir shaves before he immerses himself in water and the sufferer from scale disease shaves after he immerses himself in water."
- The final distinction: timing relative to immersion, which has its own ritual significance.
- HALAKHAH: "That is, if he was a nazir and sufferer from scale disease. But if he was a nazir and nazir, he may shave once for both."
- This is a critical takeaway from the baraita: when the requirements are identical, one action suffices. This directly challenges Rebbi Johanan's ruling that the father nazir and son nazir require two shaves.
Flow Model – The Decision Tree
Let's visualize the primary logic flow based on the Mishnah. This is the initial algorithm for handling the conditional vow and the 100-day vow.
- START
- INPUT: Vow: "I shall be a nazir if a son is born to me, AND I shall be a nazir for 100 days."
- INITIALIZE: Father's Nezirut Timer (FNT) = 0 days. Son's Nezirut Timer (SNT) = 0 days.
- EVENT: Birth of Son (BS) occurs.
- CHECK: Has FNT reached 70 days before BS?
- YES (BS on Day 70 or earlier):
- ACTION: No loss of days from FNT.
- ACTION: Start SNT count from Day 1.
- ACTION: FNT continues to count towards 100 days.
- SUBSEQUENT EVENT: Father completes his 100-day FNT.
- CHECK: Are there at least 30 days remaining in FNT after SNT is completed and shaved?
- YES: Father completes FNT, shaves. SNT is completed and shaved. No loss for father.
- NO: Father must observe additional days to bridge the gap between SNT completion/shaving and FNT completion/shaving, ensuring at least 30 days between shaves. (This is the "reduces to 70" logic as per the Penei Moshe and Korban HaEdah commentary explaining the why behind the Mishnah's rule).
- CHECK: Are there at least 30 days remaining in FNT after SNT is completed and shaved?
- GO TO: Ritual Completion Logic (for both FNT and SNT)
- NO (BS on Day 71 or later):
- LOGIC: The "70 days" rule applies. The father's 100-day vow is effectively reduced.
- CALCULATION: Days elapsed in FNT before BS = D_elapsed.
- RULE: The total duration for the father's vow is capped at 70 days from the start of the vow, not 70 days remaining.
- ACTION: Father's FNT is now considered completed at 70 days from its initiation.
- ACTION: Start SNT count from Day 1.
- CHECK: Is there a gap of at least 30 days between the completion of SNT (and its shaving) and the completion of the original 70-day FNT (and its shaving)?
- YES: No further loss.
- NO: Father must observe additional days to ensure 30 days between shaves. This means the father might have to observe more than the 70 days that were initially "reduced to". The Penei Moshe and Korban HaEdah explain this: if the son is born on day 80, the father loses 10 days (100-80 = 20 remaining, but the reduction to 70 means he only needed 70 total. The 10 days from day 70-80 are "lost" from his original 100-day count because they are insufficient to form the 30-day gap after the son's vow completion/shaving).
- GO TO: Ritual Completion Logic (for both FNT and SNT)
- YES (BS on Day 70 or earlier):
- Sub-Process: Ritual Completion Logic
- INPUT: Completed FNT duration, Completed SNT duration.
- ACTION: Perform Shaving for SNT.
- CHECK: Is FNT completed and ready for shaving?
- YES:
- CALCULATE: Days between SNT shaving and FNT shaving.
- IF: Days >= 30: Perform FNT shaving. END.
- IF: Days < 30: Father must add days to FNT until the gap is >= 30. Perform FNT shaving. END.
- NO: (This scenario is complex, involving impurity, but the base case is FNT is not yet complete).
- YES:
- Potential Branch: Impurity Event (IE) occurs.
- IF: IE occurs before completion and shaving of FNT or SNT.
- SUB-PROCESS: Impurity Impact Logic.
- CHECK: Timing of IE relative to FNT completion.
- CHECK: Timing of IE relative to SNT completion.
- APPLY: Specific rules for "eliminates everything," "eliminates thirty," "eliminates seven."
- SUB-PROCESS: Impurity Impact Logic.
- END
- IF: IE occurs before completion and shaving of FNT or SNT.
This flow model highlights the core decision points: the timing of the son's birth relative to the 70-day mark, and the subsequent calculation of required days and ritual gaps. The complexity arises when we layer on the impurity rules and the precise definition of "day" counting.
Two Implementations – Algorithm A vs. Algorithm B
Now, let's look at how different historical authorities (Rishonim and Acharonim) might implement this logic. We'll represent them as two distinct algorithms, Algorithm A (based on Rambam's interpretation) and Algorithm B (representing a more nuanced understanding of the Yerushalmi's debate, particularly as elucidated by later commentaries).
Algorithm A: The Rambam's Stack-Based Approach (Mishneh Torah, Hilchot Nezirut 4:4-5)
The Rambam's approach can be seen as a sequential processing of vows, treating the conditional vow as a base layer and the son's vow as a superimposed layer that interacts with the base. It's like a stack where you push the initial vow, and then push the conditional vow, and then have to pop them off correctly.
Core Principle: The Rambam prioritizes the minimum required duration for each vow, ensuring the 30-day gap between shaves. He seems to "reduce" the father's 100-day vow first if the son is born late, and then manage the son's vow.
Data Structures:
father_nezirut_duration: Integer, initially 100.father_nezirut_start_day: Integer, timestamp of vow start.son_nezirut_start_day: Integer, timestamp of son's birth.son_nezirut_duration: Integer, 30 days (minimum for son's vow to be distinct).father_shave_day: Integer, timestamp of father's completion shave.son_shave_day: Integer, timestamp of son's completion shave.day_resolution: Boolean,True(start of day counts as full day, based on Halakha).
Algorithm A - Pseudocode:
# Input: Vow: "I shall be a nazir if son is born, AND 100 days"
# Input: Son_birth_day (relative to father_nezirut_start_day)
def algorithm_A_Rambam(son_birth_day):
father_nezirut_duration_initial = 100
min_shave_gap = 30
father_nezirut_start_day = 0 # Assume vow starts on day 0
# --- Phase 1: Calculate effective father's vow duration ---
# The Yerushalmi Mishnah states: "after 70 days, he reduces to 70"
# The Rambam's explanation in 4:5 seems to imply this reduction happens FIRST.
if son_birth_day > 70:
# If son born after day 70, father's 100-day vow is effectively capped at 70 days.
# The days from 70 to son_birth_day are "lost" from the original 100.
effective_father_vow_end = 70
days_lost_from_father_vow = father_nezirut_duration_initial - effective_father_vow_end
# Note: The Yerushalmi text implies losing days *beyond* 70.
# Rambam 4:5: "If his son was born on the eightieth day, he eliminates ten." (100-80=20 remaining, but reduced to 70 total. 100-70=30 lost. The text says "eliminates ten" referring to the last 10 of his original 100).
# This implies the reduction to 70 is the primary constraint for the father's *total* days.
# Let's refine: The father's vow is now for 70 days total from start.
father_nezirut_duration_actual = 70
else:
# If son born on day 70 or earlier, the father's 100-day vow is not reduced *by the birth timing itself*.
father_nezirut_duration_actual = father_nezirut_duration_initial
# --- Phase 2: Determine timing of shaves ---
# Son's vow starts on son_birth_day. Minimum duration for son's vow to be distinct (implied by 30-day gap rule for father).
# Let's assume son's vow minimum is 30 days for calculation, though the text doesn't explicitly state it for the son's vow independently.
# The core issue is the gap *between* shaves.
# A common understanding is that the son's vow requires 30 days to be a distinct period.
son_vow_completion_day_raw = son_birth_day + 30 # Assuming minimum 30 days for son's vow before shave
# Now, determine father's shave day based on his actual duration AND the son's shave day.
# The father's vow must end and be shaved AFTER his father_nezirut_duration_actual is met,
# AND he needs 30 days between son's shave and his own.
# Calculate father's vow completion day if no son's vow existed.
father_vow_completion_day_independent = father_nezirut_start_day + father_nezirut_duration_actual
# The father's shave must happen *after* his vow duration is met AND *at least 30 days after* the son's shave.
# Let's consider two potential shave points for the father:
# 1. His vow completion: father_vow_completion_day_independent
# 2. 30 days after son's shave: son_vow_completion_day_raw + min_shave_gap
# The father's shave day is the LATER of these two requirements.
father_shave_day = max(father_vow_completion_day_independent, son_vow_completion_day_raw + min_shave_gap)
# The son's shave day is the completion of his vow period.
# We must ensure the son's vow is counted from his birth.
# If son_birth_day is late, and father_nezirut_duration_actual is 70.
# E.g., son_birth_day = 80. Father's vow duration is 70. Father's vow ends on day 70. Son's vow starts on day 80.
# Son's shave day would be 80 + 30 = 110.
# Father's shave day would be max(70, 110 + 30) = 140.
# This implies the father *adds* days to his vow to meet the gap.
# This interpretation aligns with Mishneh Torah 4:5: "begin counting 30 days after that shaving."
# This means the father's *own* 100 (or 70) days are being extended to accommodate the son's vow completion.
# Let's re-evaluate based on Rambam 4:4: "If 30 or more days remain... he does not forfeit anything. For he [temporarily] concludes his own nazirite vow, begins counting that associated with his son, performs the shaving, brings his sacrifices and then completes the 30 or more days that remain from his own nazirite vow."
# This implies the father's original 100 days are the *basis*, and the son's vow fits *within* or *after* it, with the gap rule overriding.
# Revised approach for Algorithm A:
# The father's vow is 100 days. The son's vow starts on birth day.
# The father must shave *after* his 100 days are met AND *at least 30 days after* the son's shave.
# If the son's birth happens late, the father's *total observed days* might exceed 100 to maintain the gap.
father_nezirut_completion_independent = father_nezirut_start_day + father_nezirut_duration_initial # 100 days from start
son_vow_completion_day = son_birth_day + 30 # Assuming son's vow requires 30 days before shave
# Father's shave day is the max of:
# 1. His vow completion day (day 100)
# 2. 30 days after son's shave day
father_shave_day = max(father_nezirut_completion_independent, son_vow_completion_day + min_shave_gap)
# If son_birth_day > 70, the Mishnah says "he reduces to 70". This implies the *total* days observed by the father *from his original vow* cannot exceed 70 if the birth is late.
# This is the core tension.
# Mishneh Torah 4:5 clarifies: "he should count the vow associated with his son, complete that vow, perform the shaving, and begin counting 30 days after that shaving. Thus he loses the ten days that [immediately] preceded [the birth of] his son, i.e., the days from the seventieth day until the son's birth."
# This confirms that if son_birth_day > 70, the father's vow is treated as having ended at day 70 *for the purpose of counting lost days*, but he might ADD days to meet the gap.
# Let's try to reconcile:
# If son_birth_day <= 70:
# Father's vow ends on day 100.
# Son's vow ends on day son_birth_day + 30.
# Father's shave day = max(100, (son_birth_day + 30) + 30)
# If this calculated father_shave_day > 100, he adds days.
# If son_birth_day > 70:
# Father's vow is treated as ending on day 70 for calculating loss.
# Days lost = son_birth_day - 70 (if son_birth_day < 100)
# Father's vow effectively ends at day 70.
# Son's vow ends on day son_birth_day + 30.
# Father's shave day = max(70, (son_birth_day + 30) + 30)
# This still implies the father might add days. The "reduces to 70" means he *doesn't get credit* for days beyond 70 if the son is born too late.
# The most consistent interpretation of Rambam 4:4 and 4:5:
# The father's vow is initially 100 days.
# If son_birth_day <= 70: Father observes 100 days, then potentially more to ensure the 30-day gap.
# If son_birth_day > 70: Father's vow is considered completed at day 70. He forfeits days from 70 to son_birth_day.
# He then observes the son's vow (30 days).
# His final shave is 30 days after son's shave, OR his original day 70, whichever is LATER.
# This means he might observe MORE than 70 days if the son's vow pushes his shave date out.
father_vow_period_end = father_nezirut_start_day + father_nezirut_duration_initial # 100
son_vow_period_end = son_birth_day + 30 # Minimum 30 days for son's vow
# Actual father's shave day:
# If son_birth_day <= 70:
# The father's shave must be *at least* day 100.
# And it must be *at least* 30 days after son's shave.
# So, father_shave_day = max(100, son_vow_period_end + 30)
# If son_birth_day > 70:
# The father's vow is "reduced to 70". This means he doesn't get credit for days beyond 70 from his original vow.
# He forfeits days from day 70 up to son_birth_day.
# His *effective* completion of his original vow is considered day 70.
# His final shave must be *at least* day 70.
# And it must be *at least* 30 days after son's shave.
# So, father_shave_day = max(70, son_vow_period_end + 30)
# Let's synthesize:
if son_birth_day <= 70:
# Father's effective end for his own vow is day 100.
father_effective_end = father_nezirut_start_day + father_nezirut_duration_initial # 100
else:
# Father's effective end for his own vow is day 70.
father_effective_end = father_nezirut_start_day + 70
# The final shave day is the later of:
# 1. The father's effective vow end.
# 2. 30 days after the son's vow completion.
father_shave_day = max(father_effective_end, son_vow_period_end + min_shave_gap)
# Days lost by father are the difference between his original 100 days and the actual days he observed up to his final shave,
# BUT constrained by the "reduces to 70" rule.
# The phrasing "he reduces to 70" implies a forfeiture of days that would have been in his 100-day vow.
# If son_birth_day > 70:
# Days from 70 up to son_birth_day are lost from the *original 100-day count*.
# Total days observed by father = father_shave_day.
# Days lost = (father_nezirut_duration_initial - father_effective_end) + (father_shave_day - son_vow_period_end - min_shave_gap) <- This is getting too complex.
# Let's stick to the Rambam's simpler calculation for days lost:
# If son_birth_day <= 70: No days lost from the 100-day vow itself.
# If son_birth_day > 70: Days lost = son_birth_day - 70. (This matches Rambam 4:5's "eliminates ten" for day 80, meaning 80-70=10).
days_lost_father = 0
if son_birth_day > 70:
days_lost_father = son_birth_day - 70 # Assuming son_birth_day < 100. If > 100, it's more complex.
# The son's vow requires 30 days.
son_nezirut_duration = 30 # Minimum to be distinct
# The father's final shave occurs at father_shave_day.
# The son's final shave occurs at son_vow_period_end.
return {
"father_vow_duration_base": father_nezirut_duration_initial,
"son_birth_day": son_birth_day,
"father_vow_reduction_applied": son_birth_day > 70,
"father_days_lost_from_100_count": days_lost_father if son_birth_day > 70 else 0,
"father_effective_vow_end_for_gap_calc": father_effective_end,
"son_vow_period_end": son_vow_period_end,
"father_final_shave_day": father_shave_day,
"son_final_shave_day": son_vow_period_end
}
# Example Walkthrough (Algorithm A):
# Vow: "Nazir if son born AND 100 days"
# Father starts vow on Day 0.
# Son born on Day 80.
# result = algorithm_A_Rambam(son_birth_day=80)
# son_birth_day = 80. This is > 70.
# father_nezirut_duration_initial = 100.
# father_nezirut_start_day = 0.
# min_shave_gap = 30.
# son_nezirut_duration = 30.
# --- Phase 1: Calculate effective father's vow duration ---
# son_birth_day (80) > 70:
# effective_father_vow_end = 70.
# days_lost_from_father_vow = 100 - 70 = 30. <- This is not what Rambam 4:5 says. It says "eliminates ten" for day 80.
# Let's correct the "days_lost_father" calculation based on Rambam 4:5.
# Rambam 4:5: "If his son was born on the eightieth day, he eliminates ten days"
# This means the father forfeits the days from day 70 up to day 80. That's 10 days.
# So, if son_birth_day > 70, days lost = son_birth_day - 70.
# Recalculating with corrected days_lost_father:
# son_birth_day = 80
# father_nezirut_duration_initial = 100
# father_nezirut_start_day = 0
# min_shave_gap = 30
# son_nezirut_duration = 30 # assumed minimum
# if son_birth_day <= 70:
# father_effective_end = 0 + 100 = 100
# else: # son_birth_day = 80 > 70
# father_effective_end = 0 + 70 = 70
# son_vow_period_end = 80 + 30 = 110
# father_shave_day = max(father_effective_end, son_vow_period_end + min_shave_gap)
# father_shave_day = max(70, 110 + 30)
# father_shave_day = max(70, 140)
# father_shave_day = 140
# days_lost_father = 0
# if son_birth_day > 70: # 80 > 70
# days_lost_father = son_birth_day - 70 # 80 - 70 = 10. This matches Rambam.
# Result for day 80:
# father_vow_duration_base: 100
# son_birth_day: 80
# father_vow_reduction_applied: True
# father_days_lost_from_100_count: 10
# father_effective_vow_end_for_gap_calc: 70
# son_vow_period_end: 110
# father_final_shave_day: 140
# son_final_shave_day: 110
# This means: Father observes 70 days of his vow (from day 0 to 70). He forfeits 10 days (from 70 to 80).
# Son's vow starts day 80, lasts 30 days, ending day 110. Son shaves on day 110.
# Father's final shave must be at least 30 days after son's shave. So, 110 + 30 = 140.
# His own vow ended at day 70. So he must shave *at least* on day 70, and *at least* on day 140. He shaves on day 140.
# He observed 70 days of his vow, plus an additional 70 days (from 70 to 140) to meet the gap requirement. Total observed: 140 days.
# He lost 10 days *from his original 100-day count*. He observed 70 days + 70 additional days.
# This interpretation aligns with the idea that the 30-day gap rule can extend the total observed period beyond the initial vow duration.
Algorithm B: The Yerushalmi's Debate and Deductive Logic (Focus on Day Counting and Overlap)
Algorithm B will attempt to capture the more intricate reasoning found in the Yerushalmi and its commentaries, particularly the debate about whether the start of a day counts as a full day, and how this interacts with the "30 days between shaves" rule. This algorithm focuses on precise interval management and the definition of "completeness" for each vow.
Core Principle: This approach emphasizes the day-counting rule. If the start of a day counts as a full day, then day 70 is fully completed at the start of day 70. The 30-day gap is also critical. The focus is on ensuring the minimum number of days are observed for each vow independently, and then merging them while respecting the gap and the day counting.
Data Structures:
father_vow_start: Timestamp (Day 0).father_vow_end_target: Timestamp (Day 100).son_birth_time: Timestamp (relative to father_vow_start).son_vow_required_duration: Integer (e.g., 30 days).min_inter_shave_gap: Integer (30 days).day_counts_as_full: Boolean (True- start of day is full day, based on Halakha).
Algorithm B - Pseudocode:
# Input: Vow: "Nazir if son born AND 100 days"
# Input: Son_birth_day (relative to father_vow_start)
# Assumption: Start of a day counts as a full day.
def algorithm_B_Yerushalmi(son_birth_day):
father_vow_start = 0
father_vow_end_target = 100
son_vow_required_duration = 30 # Minimum duration for son's vow to be distinct
min_inter_shave_gap = 30
day_counts_as_full = True # Based on JTT Nazir 2:10:2-3
# --- Step 1: Determine the actual duration and completion day for Father's vow ---
# If son is born on day 70 or earlier, father's 100-day vow is not shortened.
# If son is born *after* day 70, the father "reduces to 70". This means his vow *effectively* ends on day 70.
# The days from 70 to birth_day are lost from his 100-day count.
# The Yerushalmi's "reduces to 70" implies his *total observed days for his original vow* is capped at 70 if the birth is late.
# However, the gap rule can make him observe *more* days overall.
father_vow_completion_day = father_vow_start + father_vow_end_target # Initially 100
if son_birth_day > 70:
# The "reduces to 70" rule means his original vow is treated as ending on day 70.
# The days from 70 up to son_birth_day are forfeited.
father_vow_completion_day = father_vow_start + 70 # Effective end for his original vow period
# --- Step 2: Determine the completion day for Son's vow ---
# Son's vow starts on son_birth_day. It requires a minimum duration (e.g., 30 days) before shaving.
son_vow_completion_day = son_birth_day + son_vow_required_duration
# --- Step 3: Determine the Father's final shave day ---
# The father's shave must occur *after* his vow period is met (either 100 or 70 days).
# AND it must be *at least 30 days after* the son's shave day.
# The final shave day is the LATER of these two conditions.
father_final_shave_day = max(father_vow_completion_day, son_vow_completion_day + min_inter_shave_gap)
# --- Step 4: Calculate days lost by the Father ---
# Days lost are the difference between the original 100-day vow and the days he *actually completed* before his final shave,
# BUT only if the son was born late, causing a reduction.
# If son_birth_day > 70, days lost = (son_birth_day - 70) from his original 100-day count.
# If father_final_shave_day > father_vow_completion_day, he is adding days to meet the gap requirement.
# These added days are not "lost" from his vow, but they are *additional* days beyond his original vow period.
days_lost_father = 0
if son_birth_day > 70:
# The days from 70 to son_birth_day are lost from the original 100-day count.
days_lost_father = son_birth_day - 70 # Example: Day 80 birth -> 80-70 = 10 days lost.
# --- Step 5: Calculate Son's shave day ---
# This is straightforward: son's birth day + required duration.
son_final_shave_day = son_vow_completion_day
# --- Step 6: Final Check on Day Counting and Gap (Crucial Yerushalmi element) ---
# The Yerushalmi's debate about day counting and the "no shaving for less than 30 days" implies that if the gap between son's shave and father's effective vow end is LESS than 30, the father must extend his vow period.
# The father's final shave day calculation in Step 3 already incorporates this.
# The Yerushalmi's "reduces to 70" is about the *original* vow's credit.
return {
"father_vow_start": father_vow_start,
"father_vow_end_target": father_vow_end_target,
"son_birth_day": son_birth_day,
"father_vow_effective_completion": father_vow_completion_day, # Day 100 or Day 70
"son_vow_completion": son_vow_completion_day,
"father_final_shave_day": father_final_shave_day,
"son_final_shave_day": son_final_shave_day,
"father_days_lost_from_100_count": days_lost_father,
"father_observed_total_days": father_final_shave_day - father_vow_start # Total days father observes from start of vow to his final shave
}
# Example Walkthrough (Algorithm B):
# Vow: "Nazir if son born AND 100 days"
# Father starts vow on Day 0.
# Son born on Day 80.
# result = algorithm_B_Yerushalmi(son_birth_day=80)
# father_vow_start = 0
# father_vow_end_target = 100
# son_vow_required_duration = 30
# min_inter_shave_gap = 30
# day_counts_as_full = True
# --- Step 1: Determine father's vow completion day ---
# son_birth_day (80) > 70:
# father_vow_completion_day = 0 + 70 = 70.
# --- Step 2: Determine son's vow completion day ---
# son_vow_completion_day = 80 + 30 = 110.
# --- Step 3: Determine father's final shave day ---
# father_final_shave_day = max(father_vow_completion_day, son_vow_completion_day + min_inter_shave_gap)
# father_final_shave_day = max(70, 110 + 30)
# father_final_shave_day = max(70, 140)
# father_final_shave_day = 140.
# --- Step 4: Calculate days lost by father ---
# days_lost_father = 0
# if son_birth_day > 70: # 80 > 70
# days_lost_father = son_birth_day - 70 # 80 - 70 = 10.
# --- Step 5: Calculate son's shave day ---
# son_final_shave_day = son_vow_completion_day = 110.
# --- Step 6: Final Check ---
# father_observed_total_days = father_final_shave_day - father_vow_start = 140 - 0 = 140.
# Result for day 80:
# father_vow_start: 0
# father_vow_end_target: 100
# son_birth_day: 80
# father_vow_effective_completion: 70
# son_vow_completion: 110
# father_final_shave_day: 140
# son_final_shave_day: 110
# father_days_lost_from_100_count: 10
# father_observed_total_days: 140
# This yields the same numerical result as Algorithm A for this case, but the *reasoning* is slightly different.
# Algorithm A focuses on the *initial* reduction and then ensuring the gap.
# Algorithm B focuses on the *effective completion date* of each vow and then ensuring the gap, while explicitly stating the days lost from the *original* 100-day count.
# The core difference lies in how the "reduces to 70" rule is applied.
# Rambam (Alg A) seems to apply it as a reduction of the *father's own vow duration* first, then ensuring the gap.
# Yerushalmi's logic (Alg B) seems to establish the effective completion for the father's vow (day 70) and the son's vow (day birth+30), and then the father's *final* shave day is the later of his effective completion or 30 days after son's shave.
# Let's consider a case where son_birth_day <= 70.
# Example: Son born on Day 30.
# result = algorithm_B_Yerushalmi(son_birth_day=30)
# father_vow_start = 0
# father_vow_end_target = 100
# son_vow_required_duration = 30
# min_inter_shave_gap = 30
# --- Step 1: Father's vow completion ---
# son_birth_day (30) <= 70:
# father_vow_completion_day = 0 + 100 = 100.
# --- Step 2: Son's vow completion ---
# son_vow_completion_day = 30 + 30 = 60.
# --- Step 3: Father's final shave day ---
# father_final_shave_day = max(100, 60 + 30)
# father_final_shave_day = max(100, 90)
# father_final_shave_day = 100.
# --- Step 4: Days lost ---
# days_lost_father = 0 (since son_birth_day <= 70).
# --- Step 5: Son's shave day ---
# son_final_shave_day = 60.
# --- Step 6: Total observed ---
# father_observed_total_days = 100 - 0 = 100.
# Result for day 30:
# father_vow_start: 0
# father_vow_end_target: 100
# son_birth_day: 30
# father_vow_effective_completion: 100
# son_vow_completion: 60
# father_final_shave_day: 100
# son_final_shave_day: 60
# father_days_lost_from_100_count: 0
# father_observed_total_days: 100
# This means: Father completes his 100-day vow on day 100. Son's vow ends on day 60.
# Father shaves on day 100. Son shaves on day 60.
# The gap is 100 - 60 = 40 days, which is >= 30. So no extra days are added.
# The father observes exactly 100 days. No days are lost. This aligns with the Mishnah: "If a son is born to him in less than 70 [days], he should not lose anything."
# The key distinction in Algorithm B is the explicit handling of the "start of day is full day" rule and the precise calculation of completion dates before applying the gap rule.
Comparison:
- Algorithm A (Rambam): Tends to be more directive, offering clear rules for reduction and forfeiture. It implies that if the son's vow pushes the father's shave day beyond his original vow period, he simply observes the later date. The "reduction to 70" seems to be a primary constraint on the father's own vow period, leading to potential forfeitures from that initial 100 days.
- Algorithm B (Yerushalmi Logic): Focuses on defining the completion points of each vow period based on the day-counting rule and minimum durations, then applying the gap rule. It emphasizes that the father's final shave day is the later of his effective vow completion or 30 days after the son's shave. This can lead to the father observing more than his original vow duration to satisfy the inter-shave gap. The "reduction to 70" is framed as a forfeiture of specific days from the initial 100-day count if the son is born late.
The Yerushalmi's debate on day counting ("start of day is a full day") is a critical parameter. If the start of the day wasn't a full day, the calculations for completion and gaps would shift. Algorithm B explicitly incorporates this.
The Penei Moshe and Korban HaEdah commentaries are invaluable here. They explain why the Mishnah says "reduces to 70" and the conditionality of it. For example, Penei Moshe on 2:10:1:2 states: "After seventy. And if he counted more than seventy before the son was born and now when he interrupts his nezirut to count his son's nezirut and when he shaves for his son's nezirut and comes to complete his nezirut until 100 days, it is found that there are less than thirty days between the shaving of his son's nezirut and the shaving of his nezirut, and it is impossible for there to be less than thirty days between shaves. Therefore, he forfeits all those days that he counted beyond seventy days before the son was born." This sentiment is captured in Algorithm B's max() function for father_final_shave_day and the days_lost_father calculation.
Edge Cases – Inputs That Break Naïve Logic
Let's test our algorithms with inputs that are designed to stress-test the temporal logic and the interaction of rules.
Edge Case 1: The "Just Barely Too Late" Birth
- Input: Son is born on Day 71 of the father's 100-day vow.
- Naïve Logic Problem: A simple "if birth day <= 70 then no loss, else loss" would incorrectly apply a loss. A simple "if birth day > 70 then reduce to 70" might not correctly account for the 30-day gap.
- Expected Output (based on JTT Nazir 2:10:2-3):
- The Mishnah states: "After 70 [days], he reduces to 70 since no shaving is for less than 30 days."
- This implies that if the son is born on day 71, the father's original 100-day vow is effectively considered completed on day 70.
- Days lost from the original 100-day count = 71 - 70 = 1 day.
- The son's vow starts on day 71 and requires a minimum of, say, 30 days. So, the son's shave would be on day 71 + 30 = 101.
- The father's final shave must be at least 30 days after the son's shave: 101 + 30 = 131.
- Since his effective vow completion was day 70, his final shave must be at least day 70, and at least day 131. Thus, his final shave is on day 131.
- Output:
- Father's Vow Start: Day 0
- Son's Birth Day: Day 71
- Father's Vow Effective Completion (for gap calc): Day 70
- Son's Vow Completion: Day 101 (71 + 30)
- Father's Final Shave Day: Day 131 (max(70, 101 + 30))
- Son's Final Shave Day: Day 101
- Father's Days Lost from 100-day count: 1 (71 - 70)
- Father's Total Observed Days (from start): 131
Edge Case 2: The "Son Born Just Before Father's Vow End, Minimal Gap"
- Input: Son is born on Day 95 of the father's 100-day vow.
- Naïve Logic Problem: A simple calculation might assume the father just finishes his 100 days and then deals with the son's vow, potentially violating the 30-day gap.
- Expected Output (based on JTT Nazir 2:10:2-3 and commentaries):
- Son's birth day (95) is after 70, so the father's original 100-day vow is effectively reduced.
- Days lost from the original 100-day count = 95 - 70 = 25 days.
- Father's effective vow completion for gap calculation is Day 70.
- Son's vow starts on day 95 and requires 30 days. Son's shave is on day 95 + 30 = 125.
- Father's final shave must be at least 30 days after the son's shave: 125 + 30 = 155.
- The father's final shave day is the later of his effective completion (Day 70) or 30 days after the son's shave (Day 155). So, Day 155.
- Output:
- Father's Vow Start: Day 0
- Son's Birth Day: Day 95
- Father's Vow Effective Completion (for gap calc): Day 70
- Son's Vow Completion: Day 125 (95 + 30)
- Father's Final Shave Day: Day 155 (max(70, 125 + 30))
- Son's Final Shave Day: Day 125
- Father's Days Lost from 100-day count: 25 (95 - 70)
- Father's Total Observed Days (from start): 155
Why these break naïve logic:
These cases highlight that the "reduces to 70" rule is not a simple truncation of the father's vow, but rather a redefinition of its completion point for forfeiture purposes, while the 30-day gap rule can force the father to observe days beyond his original vow period. A naïve system might:
- Simply truncate the father's vow to 70 days and then add 30 days for the son, ignoring the interaction.
- Fail to account for the fact that the father's actual observed period can exceed 100 days due to the gap requirement.
- Not correctly calculate the days lost from the original 100-day vow when the birth is late.
The precise temporal ordering and the interplay between the "reduction" rule and the "gap" rule are the critical components that require a sophisticated state machine or decision tree logic.
Refactor – One Minimal Change That Clarifies the Rule
The core confusion in this sugya often stems from how the "reduces to 70" rule interacts with the "30 days between shaves" rule, and how days are "lost." The phrase "he reduces to 70" is particularly ambiguous.
Proposed Refactor: Rephrase the rule for births after day 70.
Original Implication: "If a son is born to him after 70 [days], he reduces to 70 [days], since no shaving is for less than 30 days."
Refactored Rule Statement:
"If a son is born to him on or after day 71 of his 100-day nezirut:
- His nezirut is considered completed for the purpose of his original vow on day 70.
- He forfeits the days from day 71 up to and including the day of his son's birth (i.e.,
son_birth_day - 70days are lost from his original 100-day count). - His son's nezirut begins on the day of birth and requires a minimum of 30 days before shaving.
- His own final shave must occur at least 30 days after his son's shave.
- His final shave day will be the later of:
- His effective vow completion (day 70).
- 30 days after his son's shave day."
Why this clarifies:
- Explicitly states the "completion point": "His nezirut is considered completed... on day 70" clearly defines the baseline for the father's own vow.
- Quantifies "lost days": "i.e.,
son_birth_day - 70days are lost from his original 100-day count" provides a direct calculation. - Prioritizes the gap rule: By stating that his final shave is the later of his effective completion or the gap requirement, it makes it clear that the 30-day gap can force him to observe days beyond day 70, and potentially beyond his original 100 days.
- Removes ambiguity: It removes the passive "he reduces to 70" and replaces it with active, sequential steps that define the outcome.
This refactoring acts like a function signature with clear parameters and a step-by-step return value. It addresses the core ambiguity by separating the "forfeiture" aspect from the "inter-shave gap" requirement and explicitly stating how they combine.
Takeaway
This sugya is a masterclass in temporal logic and rule-based systems. It demonstrates that even seemingly simple rules about time and vows can lead to complex interactions. The Yerushalmi's analysis reveals that the exact definition of a "day" (start vs. end) and the precise sequencing of conditional events (birth, vow completion, impurity) are critical for correct execution.
The "bug report" highlights how temporal overlaps in a system can lead to race conditions and incorrect state transitions. The algorithms developed by the Rishonim and Acharonim are essentially debugging and refactoring efforts, creating more robust protocols to handle these complex scenarios. The debate between Rabbananan and Rebbi (and the further discussions) is akin to finding critical edge cases that expose flaws in simpler implementations, pushing the development towards more sophisticated, layered logic that accounts for all constraints, especially the vital 30-day gap between ritual shaving events. The "refactored" rule is like writing cleaner, more explicit code comments that leave no room for misinterpretation. It's all about defining the state transitions and their dependencies with absolute precision!
derekhlearning.com