Class OwnershipPathVerifier

java.lang.Object
org.ek9lang.compiler.phase9.OwnershipPathVerifier
All Implemented Interfaces:
Function<IRConstruct, List<String>>

public final class OwnershipPathVerifier extends Object implements Function<IRConstruct, List<String>>
THE per-path rules of the ownership form (EK9_IR_OWNERSHIP_STAGE4_DESIGN.md): V-A - every OWNED value is consumed exactly once on every path to a normal exit and to every exceptional exit - and V-J - a path that ends in a Panic owes nothing.

It tracks OBLIGATIONS: an OWNED value (ValueKind.madeBy(IRInstr), or OWN v) is one, discharged by exactly one consumer - DROP, DROP_AT_EXIT (handed to a region, which drops it at every exit, unwind included), a [consume] assignment, an owned call argument, THROW, a forwarding CAST (the obligation moves to the cast). Slots are their owners' (V-G), so they carry none.

Paths, compositionally (design §3): every nested list of a composite is CLOSED - what it makes it discharges, and it discharges nothing it was given. Flat branches inside a list are followed label by label, the state compared at every join and required empty at every RETURN. At every call - every call may throw until the effect summary exists - each live obligation must already be covered (handed to a region), or it leaks on that call's unwind edge. The throw sites outside a CALL are exits too (M3, 2026-11-12; OWNERSHIP §7): a CANCEL_POINT throws Cancelled natively (ek9_cancel_point), and a DICT_LITERAL runs the key type's #? and == through the runtime's _addAss - user code that may throw. THROW ends its path.

Enforced (design §4, step 3): IR_ANALYSIS fails a compile on any finding, as it does for OwnershipVerifier.

  • Constructor Details

    • OwnershipPathVerifier

      public OwnershipPathVerifier()
  • Method Details