Legal Entities and Relationships

Establishing your baseline

2.1 From Strings to Structured Types

Problem: Using simple text leads to errors and ambiguity.

Bad approach:

charity MEANS "Some Charity Name"  -- Just text, no structure

Better approach - Structured Types:

DECLARE RegisteredCharity
    HAS name IS A STRING
        registrationNumber IS A STRING  
        registrationDate IS A Date
        address IS A STRING
        purposes IS A LIST OF Purpose

Why This Matters:

  • Prevents errors: Can't accidentally use a person where you need a charity

  • Captures relationships: Links charities to their purposes, addresses, etc.

  • Enables validation: L4 can check if all required information is present

Example:

DECIDE animalCharity
    IS RegisteredCharity
       "Jersey Animal Welfare"
       "CH001"
       (Date 2020 1 15)
       "St. Helier, Jersey"
       (LIST `advancement of animal welfare`)

Legal Insight: Law often provides specific lists and categories.

Instead of treating charitable purposes as free text:

purposes IS A LIST OF STRING  -- Allows typos and inconsistencies

Use precise legal categories:

DECLARE Purpose IS ONE OF
    `prevention or relief of poverty`
    `advancement of education` 
    `advancement of religion`
    `advancement of health`
    `advancement of animal welfare`
    otherPurpose HAS description IS A STRING  -- For edge cases

Benefits:

  • Matches legal structure: Mirrors how legislation actually defines categories

  • Prevents typos: Can't accidentally write "education advancement" instead of "advancement of education"

  • Enables legal tests: Can easily check if all purposes are charitable

Pattern matching with legal categories:

GIVEN p IS A Purpose
GIVETH A BOOLEAN
`is charitable purpose` MEANS
    CONSIDER p
    WHEN `advancement of education` THEN TRUE
    WHEN `advancement of animal welfare` THEN TRUE
    WHEN `prevention or relief of poverty` THEN TRUE
    WHEN otherPurpose s THEN `is analogous to charitable purpose` p
    OTHERWISE FALSE

-- Helper function for the pattern matching
GIVEN p IS A Purpose
GIVETH A BOOLEAN
`is analogous to charitable purpose` MEANS
    CONSIDER p
    WHEN otherPurpose desc THEN TRUE  -- Simplified for now
    OTHERWISE FALSE

2.3 Connecting Multiple Entities

Legal systems involve relationships between multiple entities:

DECLARE Person
    HAS name IS A STRING
        address IS A STRING
        isGovernor IS A BOOLEAN

DECLARE RegisteredCharity  
    HAS name IS A STRING
        registrationNumber IS A STRING
        registrationDate IS A Date
        governors IS A LIST OF Person  -- Relationship to people
        address IS A STRING
        purposes IS A LIST OF Purpose  -- Relationship to purposes
        isRegistered IS A BOOLEAN

Real legal rule using relationships:

DECLARE Actor IS ONE OF
    PersonActor HAS person IS A Person

DECLARE Action IS ONE OF
    ActInBestInterests HAS description IS A STRING

GIVEN governor IS A Person
      charity IS A RegisteredCharity
GIVETH A CONTRACT Actor Action
`governor fiduciary obligation` MEANS
  IF governor's isGovernor EQUALS TRUE AND elem governor (charity's governors)
  THEN PARTY PersonActor governor
       MUST ActInBestInterests "act in best interests of charity and beneficiaries"
       WITHIN 365
       HENCE FULFILLED
  ELSE FULFILLED

Success Check: You can now model structured legal entities, use proper legal categories, and express relationships between entities.

Last updated