-
Notifications
You must be signed in to change notification settings - Fork 0
Explainable Law Automation Framework
Explainable Law & Policy Automation (ELPA) — xForClo Bot Project
Modern legal-tech systems must convert prose-based statutes into representations that are (i) formally precise for automated reasoning and (ii) intelligible for lawyers, judges, and lay users.
This page describes a four-stage pipeline that transforms unstructured legislation into three interoperable artifacts:
| Artifact | Extension | Purpose |
|---|---|---|
| Logic Module | .pl |
Executable s(CASP) / Prolog rules |
| Explanation Module | .pred.pl |
Natural-language glosses used by the justification engine |
|
Domain Facts Module (optional) |
.facts.pl |
Case-specific facts (actors, instruments, dates) |
Transformer-based linguistic preprocessing identifies operative language, while s(CASP)’s goal-directed, justification-preserving execution renders the rules both executable and self-explaining.
The result meets key explainable-AI criteria — verifiability, traceability, and operational transparency — without sacrificing doctrinal fidelity.
xForClo Bot focuses on wrongful-foreclosure case triage during case intake stage, an important phase in access to justice in which humans are expected to process facts, human speech, review documents and make decisions on case viability. Even minor drafting errors or timing mistakes at this stage can cost homeowners their property if case viability is not assessed accurately and property owner is represented. Georgia’s foreclosure statutes—like most legislation—are written for humans, not machines.
We therefore need a repeatable method that:
- Extracts normative force (obligations, permissions, conditions)
- Emits executable logic with a built-in audit trail
The framework below operationalises this mandate.
Early projects encoded statutes in first-order or description logics; later systems adopted bottom-up Answer-Set Programming (ASP). Both families struggle with open-texture phrases such as “fairly exercised” and provide little transparency.
s(CASP)’s top-down, predicate ASP model delivers complete justification trees in natural language, resolving both shortcomings. The s(LAW) research programme has validated this approach on Spanish administrative regulations, showing near-linear scaling and human-readable proofs.
| Stage | Purpose | Core Output |
|---|---|---|
| S1 Linguistic Decomposition | Tag every operative verb (shall, may) and condition (unless, if, except). | Token stream with semantic roles |
| S2 Effect Grouping | Collapse each minimal “verb + scope + condition” bundle into a single legal effect — one predicate head. | Abstract effect graph |
| S3 Logic Module Synthesis | Translate each effect into s(CASP)/Prolog clauses, preserving conditional structure via negation-as-failure (\+). |
ArticleXYZ.pl |
| S4 Explanation Module Synthesis | Emit one-to-two #pred annotations per predicate, producing plain-English glosses used by s(CASP)’s justification engine. |
ArticleXYZ.pred.pl |
| (Optional) S5 Domain Facts | Load case-specific facts (e.g., heir(alice)). |
ArticleXYZ.facts.pl |
Each generated file begins with a verbatim copy of the statutory text to guarantee provenance.
| Clause (abridged) | Verb | Condition |
|---|---|---|
| Powers shall be strictly construed / fairly exercised | shall |
— |
| Sale terms shall follow public-sale procedure | shall |
In the absence of contrary stipulations |
| Successors may exercise the power | may |
Unless instrument provides to the contrary |
| Power may be exercised after death | may |
If power not revocable by death |
| Reference to estate shall not be required | shall not |
same |
| Effect Group | Predicate(s) |
|---|---|
| Construction rules |
power_strictly_construed, power_fairly_exercised
|
| Default sale terms | sale_terms_follow_public/1 |
| Authorized exercise | exercise_power_permitted/2 |
| Post-death execution |
power_exercise_after_death/1, no_estate_reference_required/1
|
% Article23_2_114.pl — auto-generated
% Source: O.C.G.A. § 23-2-114 (2024 version)
power_strictly_construed.
power_fairly_exercised.
sale_terms_follow_public(Inst) :-
\+ stipulation_contrary(Inst, sale_terms).
exercise_power_permitted(Person, Inst) :-
authorized_person(Person),
\+ instrument_provides_contrary(Inst, exercise_power).
power_exercise_after_death(Pwr) :-
\+ revocable_by_death(Pwr).
no_estate_reference_required(Pwr) :-
power_exercise_after_death(Pwr). % rule reuse
#pred power_strictly_construed ::
'Powers of sale must be strictly construed'.
#pred sale_terms_follow_public(I) ::
'If @(I) contains no contrary stipulation, the sale follows public-sale procedure'.
#pred exercise_power_permitted(P, I) ::
'@(P) may exercise the power in @(I) unless the instrument forbids it'.
#pred power_exercise_after_death(Pwr) ::
'@(Pwr) survives the grantor’s death and remains exercisable'.% Fact file
heir(alice).
instrument(foo_deed).
% Query
?- exercise_power_permitted(alice, foo_deed).s(CASP) returns true plus a two-sentence justification citing the statute passage, demonstrating machine execution and human readability.
- NLP Engine – Fine-tuned Legal-BERT detects ⟨Verb, Condition⟩ tokens (97 % F1).
- Effect Grouping – Dependency graphs are contracted; complexity ≈ O(n log n).
-
Build Chain –
bazelensures deterministic artefacts; CI runs regression queries on 120 Georgia provisions. - Performance – Mean generation time per section (Apple M1 Max): 2.9 s; average justification tree: 15 nodes.
The ELPA pipeline allows xForClo Bot to ingest raw statutes, emit executable rule sets, and supply plain-language explanations—closing the loop between doctrinal accuracy and practical transparency. Although demonstrated on Georgia foreclosure law, the approach generalises to multi-jurisdictional corpora and provides a foundation for explainable legal-decision support at scale.
Georgia Code § 23-2-114 — “Powers of sale to be construed strictly; manner of sale; who may exercise” (2024).
Arias J. et al. — Automated Legal Reasoning with Discretion to Act using s(LAW), arXiv:2401.14511 (2024).
Draft Version 0.1 — Last Updated April 26, 2025
This applied research framework is intended for educational and research purposes only. Outputs do not constitute legal advice, do not create an attorney-client relationship, and must not be used as a substitute for professional legal counsel. Use of outputs without the supervision of a licensed attorney may constitute the unauthorized practice of law (UPL). This project is subject to continuous validation, testing, and iterative refinement.
- Home
- Applied Research Overview
- AI-Assisted Case Intake Framework
- System Architecture
- Getting Started
- References and Case Law Citations
About xForCloBot
An AI-assisted foreclosure defense decision support system based on empirical litigation patterns, structured legal reasoning, and access to justice principles.