You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
defmoduleGuardiandouseDomo,skip_defaults: truedefstruct[:name]@typet::%__MODULE__{name: String.t()}enddefmoduleUserdouseDomo,skip_defaults: truedefstruct[:name,:age,:address,:guardian]@typestr::String.t()@typet::%__MODULE__{name: str(),age: integer(),address: str(),guardian: Guardian.t()|nil}precond(t:&conddo&1.age<18andis_nil(&1.guardian)->{:error,"Users under 18 must have guardian."}&1.age>=18andnotis_nil(&1.guardian)->{:error,"Users of age 18 and over must have no guardian."}true->:okend)end
Shared structure proofs allowed use cases by itself 💯