Documentation

LeanSce.Core.Semantics.Determinism

Determinism of the Core small-step semantics for well-typed terms.

Typing is needed only for record selection: on an ill-typed merge carrying the same label on both sides, RLookupV may pick either side. The disjointness built into RLookup (via notin_false) rules that out.

theorem core_value_no_step {v : Core.Exp} (hv : Core.Value v) {ρ e : Core.Exp} :
¬Step ρ v e

Core values do not step.

theorem core_lookupv_det {v v1 v2 : Core.Exp} {n : Nat} (h1 : Core.LookupV v n v1) (h2 : Core.LookupV v n v2) :
v1 = v2
theorem core_rlookupv_det {E : Core.Typ} {v : Core.Exp} {A : Core.Typ} {l : String} {B : Core.Typ} {v1 v2 : Core.Exp} (ht : HasType E v A) (hrl : Core.RLookup A l B) (h1 : Core.RLookupV v l v1) (h2 : Core.RLookupV v l v2) :
v1 = v2
theorem core_step_deterministic {ρ e e1 : Core.Exp} (hs : Step ρ e e1) {e2 : Core.Exp} {E A : Core.Typ} :
Step ρ e e2 → HasType E e A → HasType Core.Typ.top ρ E → e1 = e2

Determinism of Core small steps for well-typed terms in a well-typed environment.