A programming language for legal instruments
No false determinacy.
Precise where law is mechanical. Explicit where judgment enters. Incapable of hiding authority, discretion, or ambiguity inside a Boolean.
cargo install --git https://github.com/BeeGass/fidryn --locked fidryn-cliTrust, open eligibility
fidryn run examples/trust/bryan-revocable-trust.fr --query acting_trustee --case examples/trust/cases/two-certificates-open-eligibility.json --valid-at 2034-03-01T09:00:00Z --known-at 2034-03-01T09:00:00Z
1Source
interpretation_family SuccessorEligibility
for Instrument.clause("4.4")
{
alternative I1 {
defines Eligible(Alice, TrusteeOf(BRT)) as established
defines Eligible(Bob, TrusteeOf(BRT)) as established
}
alternative I2 {
defines Eligible(Alice, TrusteeOf(BRT)) as not_established
defines Eligible(Bob, TrusteeOf(BRT)) as established
}
selector explicit_instrument_definition
or controlling_interpretation
or request Interpret
}
…
query acting_trustee()
-> LegalPerson
! {Observe, Determine, Interpret}
{
goal UniqueOccupant {
office TrusteeOf(BRT)
}
}
2Case
{
"schema": "fidryn.case-record/v0.1",
"module": "Examples.BryanRevocableTrust@0.1.0",
"facts": {
"alice_accepted": true,
"bob_accepted": true
},
"evidence": [
{
"schema": "OccupancyRecord",
"value": "Bryan",
"observedAt": "2026-08-23T12:00:00Z"
},
{
"schema": "PhysicianCertificate",
"value": "certificate-1",
"observedAt": "2026-08-23T12:00:00Z"
},
{
"schema": "PhysicianCertificate",
"value": "certificate-2",
"observedAt": "2026-08-23T12:00:00Z"
}
],
"admissibleCompletions": {
"interpretations": {
"SuccessorEligibility": ["I1", "I2"]
}
}
}3Outcome
Contingent- acting_trustee depends on SuccessorEligibility.
- Under I1 it is Alice.
- Under I2 it is Bob.
- No single answer is determinate across the admissible completions.
- Outside scope: tax, creditor_priority, real_property_recording, complete_Massachusetts_trust_law.
Trust, court selects I2
fidryn run examples/trust/bryan-revocable-trust.fr --query acting_trustee --case examples/trust/cases/court-selects-i2.json --valid-at 2034-03-01T09:00:00Z --known-at 2034-03-01T09:00:00Z
1Source
interpretation_family SuccessorEligibility
for Instrument.clause("4.4")
{
alternative I1 {
defines Eligible(Alice, TrusteeOf(BRT)) as established
defines Eligible(Bob, TrusteeOf(BRT)) as established
}
alternative I2 {
defines Eligible(Alice, TrusteeOf(BRT)) as not_established
defines Eligible(Bob, TrusteeOf(BRT)) as established
}
selector explicit_instrument_definition
or controlling_interpretation
or request Interpret
}
…
query acting_trustee()
-> LegalPerson
! {Observe, Determine, Interpret}
{
goal UniqueOccupant {
office TrusteeOf(BRT)
}
}
2Case
{
"schema": "fidryn.case-record/v0.1",
"module": "Examples.BryanRevocableTrust@0.1.0",
"facts": {
"alice_accepted": true,
"bob_accepted": true
},
"evidence": [
{
"schema": "OccupancyRecord",
"value": "Bryan",
"observedAt": "2026-08-23T12:00:00Z"
},
{
"schema": "PhysicianCertificate",
"value": "certificate-1",
"observedAt": "2026-08-23T12:00:00Z"
},
{
"schema": "PhysicianCertificate",
"value": "certificate-2",
"observedAt": "2026-08-23T12:00:00Z"
}
],
"interpretations": {
"SuccessorEligibility": "I2"
},
"admissibleCompletions": {
"interpretations": {
"SuccessorEligibility": ["I1", "I2"]
}
}
}3Outcome
Determinate- acting_trustee is Bob.
- Outside scope: tax, creditor_priority, real_property_recording, complete_Massachusetts_trust_law.
require-gate, query q
fidryn run tests/programs/require-gate.fr --query q --case /tmp/fidryn-empty-case.json --valid-at 2026-09-17T12:00:00Z --known-at 2026-09-17T12:00:00Z
1Source
module Programs.RequireGate version "0.1.0" {
jurisdiction Test
source_snapshot "2026-09-17-require-gate"
effective_at 2026-09-17
recorded_at 2026-09-17T12:00:00Z
outside_scope { complete_instruments }
query q() -> Int { require true; return 7 }
query r() -> Int { require false; return 7 }
}
2Case
{
"schema": "fidryn.case-record/v0.1",
"admissibleCompletions": {}
}3Outcome
Determinate- q is 7.
- Outside scope: complete_instruments.
require-gate, query r
fidryn run tests/programs/require-gate.fr --query r --case /tmp/fidryn-empty-case.json --valid-at 2026-09-17T12:00:00Z --known-at 2026-09-17T12:00:00Z
1Source
module Programs.RequireGate version "0.1.0" {
jurisdiction Test
source_snapshot "2026-09-17-require-gate"
effective_at 2026-09-17
recorded_at 2026-09-17T12:00:00Z
outside_scope { complete_instruments }
query q() -> Int { require true; return 7 }
query r() -> Int { require false; return 7 }
}
2Case
{
"schema": "fidryn.case-record/v0.1",
"admissibleCompletions": {}
}3Outcome
Suspended- r is suspended.
- Outstanding request: requirement failed (require).
- Outside scope: complete_instruments.
Computed by the Fidryn interpreter when this page was built.
§ 2 — What it is
Instruments, not slogans
Bounded slices of trusts, tax, and statute-shaped rules as checkable programs, with outside_scope named so omissions stay visible.
Honest outcomes
Determinate only when invariant across every still-admissible resolution, or when a competent authority has already decided. Otherwise suspended, contingent, or another named kind.
A local mill
fidryn ui binds 127.0.0.1 only. It checks, runs, explores, and renders modules. It never files.
§ 3 — Six honest outcomes
A query answers with exactly one of six kinds, and every answer carries the declared modelBoundary. Each kind answers one question.
Is there one answer, invariant across every admissible completion, or already determined by a competent authority?
DeterminateDo still-admissible answers disagree?
ContingentDoes evaluation need a legal operation the case does not discharge, with no covering certificate?
SuspendedDo staged effects disagree with no single applicable doctrine?
NormConflictDoes the case ask for something outside the declared model or the module’s competence?
OutsideCompetenceCan the admitted model not be satisfied?
Inconsistent
§ 4 — Contents
- §1Getting startedCheck and run a tiny module
- §2LanguageModules, queries, rules, duties
- §3Cases and timeRecords, valid-at, known-at
- §4CLIEvery subcommand and flag
- §5MillThe localhost UI
- §6OutcomesThe six kinds and the envelope
- §7ExamplesTrust, tax, fifty states
- §8ContributingToolchain, tests, commits