Legal Text to Explainable Logic‐Unpacking Law Text With Precision - jurisgpt/GrizlyUDVacator GitHub Wiki

From Legal Text to Explainable Logic: Formalizing CCP § 473.5 Deadlines with Computational Methods

Introduction

California Code of Civil Procedure § 473.5(b) governs motions to set aside a default or default judgment when a defendant lacked actual notice of the action. The statute imposes two temporal constraints—an outer two‑year limit from the entry of default or judgment and a shorter 180‑day limit from service of a written notice of that entry—specifying that the earlier deadline controls (Cal. Civ. Proc. Code § 473.5(b), West 2025).

This article (a) restates that statutory rule, (b) encodes it in two declarative logic formalisms—IDP‑Z3's FO(·) and Answer Set Programming (ASP), and (c) derives a minimal tenant‑interview instrument whose answers provide all facts required for automated reasoning. All narrative is confined to the statute's text and the logical consequences thereof.

Statutory Rule Statement

A motion to set aside a default or default judgment must be filed (a) within two years after entry of the default or judgment and (b), if a written notice of entry was served, within 180 days after that service, whichever occurs first (Cal. Civ. Proc. Code § 473.5(b), West 2025).

Missing either deadline is fatal, terminating the right to the requested relief. The statute's "whichever occurs first" language establishes these deadlines as jurisdictional barriers, not subject to equitable tolling or judicial discretion. As reinforced in Manson, Iver & York v. Black, 33 Cal.App.4th 1432 (1995), statutory time limits in § 473 proceedings are strictly construed, emphasizing that courts lack equitable power to excuse untimeliness once these periods have elapsed.

Formal Logical Encodings

Before formalizing the temporal constraints of § 473.5(b), we must first establish a clear logical distinction central to the statute's application: the difference between defective service (which maintains actual notice) and invalid service (where no actual notice occurs). This foundational distinction determines when the statute applies in the first place and provides the conceptual basis for the subsequent formal encodings.

Negation Handling: "Service Defect ≠ Invalid Service"

An important distinction in § 473.5 is between defective service (procedural flaw) and invalid service (substantive failure). This distinction can be formalized using predicate logic:

valid_service(S) ⟺ service_method(S, compliant) ∧ notice_received(S).  
service_defect(S) ⟺ service_method(S, noncompliant) ∧ notice_received(S).  
invalid_service(S) ⟺ ¬notice_received(S).

Key Insight: The statute's negation ("defective ≠ invalid") is modeled as mutually exclusive predicates. A service defect (service_method noncompliant but notice_received) does not imply invalid service unless ¬notice_received (actual notice lacking).

Application: In ASP, this prevents conflating procedural defects (e.g., improper mailing) with substantive invalidity (no actual notice), ensuring relief remains available under § 473.5(b) for the latter but not the former.

FO(·) Specification for IDP‑Z3

//////////////////////////////////////////////////////////////////////////////
// Timeliness of a motion under CCP § 473.5(b) – testing IDP‑Z3 example
///////////////////////////////////////////////////////////////////////////////

vocabulary V {
  // Treat “dates” as ordinal day‑numbers so we can add / compare them
//   type Day ⊆ Int ee
//   type Day ⊆ date

  // ── INPUT CONSTANTS ───────────────────────────────────────────────────────
  initial_service_date   : ->  Int   // date default or judgment was entered
  written_notice_date    : -> Int   // date written notice of entry was served
  motion_for_relief_date : -> Int   // date the motion was filed
  written_notice_served:  -> Bool        // predicate – true iff notice was served

  // ── DERIVED CONSTANTS / FLAGS ────────────────────────────────────────────
  deadline_180_days : -> Int
  deadline_2_years  : -> Int
  relief_sought_in_time :  -> Bool         // predicate – true iff motion is timely
}

theory T : V {
  // Unconditional outer limit (2 years = 730 days)
  deadline_2_years() = initial_service_date() + 730.

  // Shorter 180‑day limit only if a written notice was in fact served
  written_notice_served()
        => deadline_180_days() = written_notice_date() + 180.

  // “Earlier‑date‑controls” rule from § 473.5(b)
  {
  relief_sought_in_time() <-
        motion_for_relief_date() =< deadline_2_years()
        & ( ~written_notice_served()           // no notice ⇒ only 2‑year test
            | motion_for_relief_date() =< deadline_180_days() ).
  }
}

///////////////////////////////////////////////////////////////////////////////
// Example data – change these to test other scenarios
///////////////////////////////////////////////////////////////////////////////
structure S : V {
  initial_service_date   := 20240101.   // 1 Jan 2024
  written_notice_served  := true.
  written_notice_date    := 20240601.   // 1 Jun 2024
  motion_for_relief_date := 20241015.   // 15 Oct 2024
}

///////////////////////////////////////////////////////////////////////////////
// Run: expand the model produced by S ⊨ T and print the results
///////////////////////////////////////////////////////////////////////////////
procedure main() {
  pretty_print(model_expand(T,S))
}

Notes

  • DO NOT use ChatGPT to generate FO(.) code.
  • The IDP-Z3 is a fully functional and tested code. Thanks to Simon Vandevelde
  • Dates are integers counted in days from a fixed epoch.
  • Addition uses standard arithmetic; "<=" is the total order on integers.
  • The rule enforces both limits; if the 180‑day deadline exists and is earlier, it necessarily governs.

The FO(·) encoding uses first-order logic with arithmetic to derive deadlines (e.g., deadline_180_days() = d + 180) and enforces conjunction via a rule structure requiring both deadlines to be satisfied. This formalism explicitly encodes the statute's "earlier deadline controls" principle by comparing motion_for_relief_date() against both calculated deadlines, selecting the stricter limit through the logical implication operator.

Equivalent ASP Encoding

% ----- base facts to be provided by case intake -----
% date/2: date(identifier, integer_days)
% notice_served.           % include if a written notice was served
% motion_date(D).          % D = filing date (integer)
% entry_date(E).           % E = date default/judgment entered
% notice_date(N).          % N = date notice served (only if notice_served)

% ----- derived deadlines -----
deadline_2yr(D2) :- entry_date(E), D2 = E + 730.

deadline_180(D180) :- notice_served, notice_date(N), D180 = N + 180.

% ----- timeliness rules -----
timely :-                     % motion must satisfy both conditions
    motion_date(M),
    deadline_2yr(D2),
    M <= D2,
    (  notice_served -> deadline_180(D180), M <= D180 ).

% ----- negation (untimely) -----
untimely :- not timely.

ASP uses integer arithmetic (supported in clingo ≥ 5.4) and a single model to classify the motion as timely or untimely.

The ASP encoding employs declarative rules (e.g., timely :- motion_date(M), M <= D2, (notice_served -> M <= D180)) to model the same constraints as the FO(·) specification, but with a more concise syntax. This approach translates the legal rule into both human-readable and machine-executable code, ensuring computational tractability while maintaining fidelity to the statute's logic.

Machine‑Reasoning Workflow

  1. Intake supplies atomic facts (entry_date, notice_served, notice_date, motion_date).
  2. Reasoner (IDP‑Z3 or ASP solver) instantiates deadlines, applies the temporal rule, and derives relief_sought_in_time / timely.
  3. Output is presented to an attorney, flagging whether statutory timeliness is satisfied. No other legal elements (e.g., affidavit sufficiency) are assessed here; those are orthogonal modules.

Advanced Temporal Reasoning: Interval Algebra for Deadline Accuracy

The basic model presented above calculates deadlines as simple integer offsets but ignores calendar complexities such as holidays, weekends, and leap years. A more sophisticated implementation using Allen's Interval Algebra resolves these practical issues:

# Python pseudocode with Allen's relations
def compute_deadline(start_date, days, court_calendar):  
    current = start_date  
    while days > 0:  
        current += 1 day  
        if current not in court_calendar.holidays and current.is_weekday():  
            days -= 1  
    return current

Key Insight: Using interval algebra, the 180-day deadline dynamically adjusts for weekends/holidays per CCP § 12a. For example, a deadline ending on a Saturday shifts to Monday.

Impact: The original model's deadline_180_days() = d + 180 becomes context-aware, avoiding jurisdictional errors (e.g., Johnson v. Roe, 203 Cal.App.4th 47 (2012)).

Substantive vs. Procedural Requirements in Logic

The original model focuses on deadline calculation but doesn't encode the distinction between substantive and procedural requirements. This distinction can be formalized using logic predicates:

substantive(affidavit_required).  
procedural(pleading_attachment).  
% Rule enforcement  
deny_relief(Case) :-  
    substantive_requirement(R),  
    not satisfied(R, Case).  
warn_defect(Case) :-  
    procedural_requirement(R),  
    not satisfied(R, Case).

Key Insight: Substantive failures (e.g., missing affidavits) trigger automatic denial, while procedural defects (e.g., unattached pleadings) generate warnings but allow amendments. This mirrors case law (e.g., Bonura v. Ardin, 56 Cal.App.5th 991 (2020)).

Utility: Legal aid tools can prioritize affidavit drafting over procedural fixes during client intake.

Tenant Interview Instrument

The following questions collect exactly the data required to evaluate the statutory rule above:

Date of Entry

On what date did the court enter the default or default judgment against you? — Maps to entry_date.

Written Notice of Entry

a. Did you receive a written notice stating that the default or default judgment had been entered? (Yes/No) b. If yes, on what date was that written notice served on you? — Maps to notice_served and notice_date.

Motion Filing Date

On what date did you file (or will you file) your motion asking the court to set aside the default or default judgment? — Maps to motion_date.

Rationale

  • Completeness – The statutory rule depends only on three temporal facts.
  • Determinacy – Each answer is a scalar value (Boolean or date), enabling direct instantiation of the logic program without interpretation.
  • Traceability – Each question corresponds one‑to‑one with a symbol in the formal model, facilitating automated validation and later audits.

These questions are grounded in mathematically derived logic—each question maps directly to atomic predicates required by the formal model. This eliminates arbitrariness and vagueness, ensuring counsel's data collection (due diligence) aligns precisely with the statute's variables. The interview structure transforms client consultation into a deterministic process, reducing the risk of overlooking critical temporal facts while maintaining doctrinal fidelity.

Practical Application and Output

The following example demonstrates how the logical formalization translates into practical utility for attorneys in real-world scenarios.

Example Case Scenario

Client Case Scenario: A tenant named Maria Rodriguez received a default judgment in an unlawful detainer action. She claims she never received the summons but later received a written notice of the default judgment.

Interview Data Collected:

  • Default judgment entered: February 15, 2023
  • Written notice of default served: March 10, 2023
  • Planned motion filing date: October 1, 2023

System Output

LEGAL DEADLINE ANALYSIS
========================
Case: Rodriguez v. Oakland Properties LLC
Case #: RG23-567890

INPUT PARAMETERS:
• Default judgment date: 2023-02-15
• Written notice served: Yes
• Written notice date: 2023-03-10
• Proposed motion date: 2023-10-01

CALCULATED DEADLINES:
• Two-year deadline: 2025-02-15 (730 days from judgment)
• 180-day deadline: 2023-09-06 (180 days from notice)

TIMELINESS DETERMINATION:
❌ MOTION WOULD BE UNTIMELY
The proposed filing date (2023-10-01) exceeds the controlling 
180-day deadline (2023-09-06).


Interactive UI Implementation

The theoretical model can be implemented as an intuitive web interface for practitioners:

Try the CCP § 473.5 Relief Calculator Demo

Figure 1: Interactive deadline calculator showing input fields, calendar integration, and risk assessment.

The interface above demonstrates how abstract logical formalisms translate into an accessible practitioner tool with:

  • Dynamic calendar visualization highlighting the controlling deadline
  • Confidence scoring indicating the strength of evidence for actual notice
  • Document generation for affidavits that address required elements
  • One-click document assembly for motion preparation

Attorney/Paralegal usability testing feedback during beta testing is in progress.

RECOMMENDATION: Client must file by 2023-09-06 to preserve relief rights under CCP § 473.5. Citation: "A motion to set aside a default or default judgment must be filed [...] if a written notice of entry was served, within 180 days after that service, whichever occurs first" (Cal. Civ. Proc. Code § 473.5(b), West 2025).

Legal Reasoning: The controlling deadline is determined by the earlier of two statutory periods. Here, the 180-day period following written notice (ending 2023-09-06) expires before the two-year period following judgment entry (ending 2025-02-15). The statute expressly provides no exceptions to these timing requirements, and courts have consistently held these deadlines to be jurisdictional barriers to relief. See Manson, Iver & York v. Black, 33 Cal.App.4th 1432 (1995) (holding that statutory time limits in § 473 proceedings are strictly construed).


## Ethical AI: Mitigating Garbage-in-Garbage-out (GIGO) Risks

The system above assumes truthful inputs, but § 473.5(b) motions often involve contested facts. Attorneys have an ethical duty to investigate client claims. An enhanced system can implement inconsistency detection using probabilistic models:

```python
# Fraud detection via inconsistency scoring
if (notice_date < entry_date):  
    inconsistency_score += 0.8  # Notice cannot precede judgment
if (motion_date - entry_date > 730):  
    inconsistency_score += 1.0

Key Insight: Systems can flag implausible inputs provided by tenants (e.g., notices predating judgments) for attorney review, reducing fraudulent claims.

Precedent: Aligns with Donovan v. Grand Vista Hotel, 34 Cal.App.5th 1132 (2019) (courts scrutinize timeline inconsistencies).

Bayesian Networks for Relief Likelihood Prediction

Building upon the ethical input validation framework, a fully integrated system can leverage validated client data to provide probabilistic outcome prediction. Once inconsistencies are addressed and reliable facts established, the following Bayesian network model can assess likelihood of success:

# Bayesian model for relief likelihood
P(relief_granted | timely, affidavit_strong, no_prejudice) = 0.95  
P(relief_granted | timely, affidavit_weak, prejudice) = 0.10

Key Insight: Weak affidavits (conclusory statements) or prejudice to plaintiffs (In re Marriage of Park, 27 Cal.App.5th 613 (2018)) reduce relief chances, even if timely.

Application: Tools can guide attorneys to strengthen affidavits using NLP-prompted templates (e.g., "Detail attempts to avoid service").

Utility for Legal Practitioners

This computational approach offers several key benefits to practicing attorneys:

  1. Error Prevention: Eliminates human calculation errors in determining complex statutory deadlines—a common source of malpractice claims.

  2. Client Intake Efficiency: Streamlines the initial client interview by focusing only on the legally relevant facts needed for deadline determination.

  3. Real-time Assessment: Allows attorneys to immediately advise clients during initial consultation whether statutory relief is still available.

  4. Scalability: Legal aid organizations serving high volumes of tenants can quickly triage which cases have preserved their rights to challenge defaults.

  5. Documentation: Creates auditable records of deadline calculations that can be included in case files for malpractice protection.

  6. Integration Potential: Can be embedded in practice management software or deployed as a standalone tool that generates court-ready declarations.

Expanding Access Beyond Legal Aid

While legal aid organizations represent an important initial implementation target, this computational approach has significant value for small law firms and solo practitioners who represent tenants who do not qualify for pro-bono services. These practitioners often face resource constraints similar to legal aid—limited time for case analysis, high client volume, and minimal support staff—but must operate efficiently to maintain viable practices while keeping services affordable.

A subscription-based or modestly-priced software implementation of this system could help solo practitioners compete with larger firms by:

  • Reducing the time needed for initial case evaluation (from hours to minutes)
  • Enabling immediate client counseling about viability during initial consultation
  • Decreasing malpractice insurance costs by documenting systematic deadline verification
  • Facilitating fixed-fee representation models that improve access to justice while maintaining profitability

This approach bridges legal doctrine (jurisdictional deadlines) with mathematical proofs (integer inequalities), enhancing transparency for high-volume legal aid applications. By formalizing tenant interviews using declarative programming (IDP-Z3/ASP), the system translates legal rules into explainable, provable computational workflows. The ASP rule timely :- ... is both human-readable and machine-executable, ensuring the model's outputs are traceable to statutory logic, merging legal rigor with computational precision to reduce malpractice risks.

Conclusion

By isolating the "earlier date controls" clause of CCP § 473.5(b) and expressing it in rigorous logical formalisms, we demonstrate how a small but critical statutory fragment can be automated with mathematical certainty. The aligned interview questions ensure the data required for reasoning is captured unambiguously, enabling software to assist attorneys while preserving doctrinal fidelity.

The practical example illustrates how this approach bridges the gap between abstract legal rules and actionable guidance for practitioners, potentially reducing malpractice risk while increasing access to justice through more efficient legal service delivery.

Knowledge Integration with Related Statutes

The analysis of § 473.5(b) can be enhanced by modeling its relationship with related provisions like § 473(d). Using knowledge graphs:

% Knowledge graph linking statutes
statute(ccp_473_5b, relief_for_lack_of_notice).  
statute(ccp_473d, relief_for_invalid_service).  
disjoint(ccp_473_5b, ccp_473d) :-  
    relief_basis(B1, lack_of_notice),  
    relief_basis(B2, invalid_service).

Key Insight: Automated systems can cross-reference statutes to prevent misapplication (e.g., citing § 473.5(b) for invalid service).

Impact: During intake, tools can flag conflicting inputs (e.g., "Received notice but claiming invalid service") and suggest the correct statutory basis for relief.

By integrating computational linguistics (negation handling, temporal logic) with mathematical frameworks (Bayesian networks, knowledge graphs), this approach transforms § 473.5(b) automation from a deadline calculator into a robust decision-support system, reducing malpractice risks while enhancing access to justice.

References {.unnumbered}

California Code of Civil Procedure § 473.5(b) (West 2025).