Pre-denotation. It takes a capability to form a denotation.
Equations
Instances For
Capture-denotation. Given any memory, it produces a set of capabilities.
Equations
Instances For
A bound on capability sets. It can either be a concrete set of the top element.
- top : CapabilityBound
- set : CapabilitySet → CapabilityBound
Instances For
Capture bound denotation.
Equations
Instances For
Instances For
Equations
Instances For
Equations
- d.is_transparent = ∀ {m : CC.Memory} {x : ℕ} {v : CC.HeapVal}, m.lookup x = some (CC.Cell.val v) → d m v.unwrap → d m (CC.Exp.var (CC.Var.free x))
Instances For
Equations
- d.is_bool_independent = ∀ {m : CC.Memory}, d m CC.Exp.btrue ↔ d m CC.Exp.bfalse
Instances For
Equations
- d.is_proper = (d.is_monotonic ∧ d.is_transparent ∧ d.is_bool_independent)
Instances For
For simple values, compute_reachability equals resolve_reachability.
Heap invariant: the reachability stored in a heap value equals the computed reachability for that value.
This invariant is maintained by the operational semantics, which always uses
compute_reachability when creating heap values (see eval_letin in BigStep.lean).
This is a fundamental property connecting operational reachability (stored in the heap) with denotational reachability (computed from expression structure).
This pre-denotation actually enforces the reachability bound.
Equations
- denot.is_reachability_safe = ∀ (R : CC.CapabilitySet) (m : CC.Memory) (e : CC.Exp ∅), denot R m e → CC.resolve_reachability m.heap e ⊆ R
Instances For
This pre-denotation is monotonic over reachability sets.
Equations
- pd.is_reachability_monotonic = ∀ (R1 R2 : CC.CapabilitySet), R1 ⊆ R2 → ∀ (m : CC.Memory) (e : CC.Exp ∅), pd R1 m e → pd R2 m e
Instances For
This pre-denotation entails heap well-formedness.
Equations
- pd.implies_wf = ∀ (R : CC.CapabilitySet) (m : CC.Memory) (e : CC.Exp ∅), pd R m e → e.WfInHeap m.heap
Instances For
This pre-denotation is "tight" on reachability sets.
Equations
- pd.is_tight = ∀ (R : CC.CapabilitySet) (m : CC.Memory) (fx : ℕ), pd R m (CC.Exp.var (CC.Var.free fx)) → pd (CC.reachability_of_loc m.heap fx) m (CC.Exp.var (CC.Var.free fx))
Instances For
This is a proper pre-denotation.
Equations
- pd.is_proper = (pd.is_reachability_safe ∧ pd.is_reachability_monotonic ∧ pd.implies_wf ∧ pd.is_tight ∧ ∀ (C : CC.CapabilitySet), (pd C).is_proper)
Instances For
Equations
- pd1.Imply pd2 = ∀ (C : CC.CapabilitySet), (pd1 C).Imply (pd2 C)
Instances For
Equations
- pd1.ImplyAt pd2 m = ∀ (C : CC.CapabilitySet), (pd1 C).ImplyAt m (pd2 C)
Instances For
Equations
- pd1.ImplyAfter m pd2 = ∀ (C : CC.CapabilitySet), (pd1 C).ImplyAfter m (pd2 C)
Instances For
Equations
- Γ.extend_var x = Γ.extend (CC.TypeInfo.var x)
Instances For
Equations
- Γ.extend_tvar T = Γ.extend (CC.TypeInfo.tvar T)
Instances For
Equations
- Γ.extend_cvar ground = Γ.extend (CC.TypeInfo.cvar ground)
Instances For
Equations
- Γ.lookup_var x = match Γ.lookup x with | CC.TypeInfo.var y => y
Instances For
Equations
- Γ.lookup_tvar x = match Γ.lookup x with | CC.TypeInfo.tvar T => T
Instances For
Equations
- Γ.lookup_cvar x = match Γ.lookup x with | CC.TypeInfo.cvar cs => cs
Instances For
Compute denotation for a ground capture set.
Equations
- CC.CaptureSet.empty.ground_denot = fun (x : CC.Memory) => ∅
- (cs1.union cs2).ground_denot = fun (m : CC.Memory) => cs1.ground_denot m ∪ cs2.ground_denot m
- (CC.CaptureSet.var (CC.Var.free x_1)).ground_denot = fun (m : CC.Memory) => CC.reachability_of_loc m.heap x_1
Instances For
Equations
- CC.CaptureSet.denot ρ cs = (cs.subst (CC.Subst.from_TypeEnv ρ)).ground_denot
Instances For
Equations
- CC.CaptureBound.denot x✝ CC.CaptureBound.unbound = fun (x : CC.Memory) => CC.CapabilityBound.top
- CC.CaptureBound.denot x✝ (CC.CaptureBound.bound cs) = fun (m : CC.Memory) => CC.CapabilityBound.set (CC.CaptureSet.denot x✝ cs m)
Instances For
- top {C : CapabilitySet} : C.BoundedBy CapabilityBound.top
- set {C1 C2 : CapabilitySet} : C1 ⊆ C2 → C1.BoundedBy (CapabilityBound.set C2)
Instances For
- refl {B : CapabilityBound} : B.SubsetEq B
- set {C1 C2 : CapabilitySet} : C1 ⊆ C2 → (CapabilityBound.set C1).SubsetEq (CapabilityBound.set C2)
- top {B : CapabilityBound} : B.SubsetEq CapabilityBound.top
Instances For
Equations
Equations
- One or more equations did not get rendered due to their size.
- CC.Ty.shape_val_denot x✝ CC.Ty.top = fun (R : CC.CapabilitySet) (m : CC.Memory) (e : CC.Exp ∅) => e.WfInHeap m.heap ∧ CC.resolve_reachability m.heap e ⊆ R
- CC.Ty.shape_val_denot x✝ (CC.Ty.tvar X) = x✝.lookup_tvar X
- CC.Ty.shape_val_denot x✝ CC.Ty.unit = fun (x : CC.CapabilitySet) (m : CC.Memory) (e : CC.Exp ∅) => CC.resolve m.heap e = some CC.Exp.unit
- CC.Ty.shape_val_denot x✝ CC.Ty.bool = fun (x : CC.CapabilitySet) (m : CC.Memory) (e : CC.Exp ∅) => CC.resolve m.heap e = some CC.Exp.btrue ∨ CC.resolve m.heap e = some CC.Exp.bfalse
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- One or more equations did not get rendered due to their size.
- CC.Ty.exi_val_denot x✝ T.typ = CC.Ty.capt_val_denot x✝ T
Instances For
Equations
- CC.Ty.capt_exp_denot x✝¹ x✝ = fun (A : CC.CapabilitySet) (m : CC.Memory) (e : CC.Exp ∅) => CC.Eval A m e (CC.Ty.capt_val_denot x✝¹ x✝).as_mpost
Instances For
Equations
- CC.Ty.exi_exp_denot x✝¹ x✝ = fun (A : CC.CapabilitySet) (m : CC.Memory) (e : CC.Exp ∅) => CC.Eval A m e (CC.Ty.exi_val_denot x✝¹ x✝).as_mpost
Instances For
Equations
- CC.instCaptHasDenotation = { interp := CC.Ty.capt_val_denot }
Equations
- CC.instCaptHasExpDenotation = { interp := CC.Ty.capt_exp_denot }
Equations
- CC.instExiHasDenotation = { interp := CC.Ty.exi_val_denot }
Equations
- CC.instExiHasExpDenotation = { interp := CC.Ty.exi_exp_denot }
Equations
- CC.instShapeHasDenotation = { interp := CC.Ty.shape_val_denot }
Equations
- CC.instCaptureSetHasDenotation = { interp := CC.CaptureSet.denot }
Equations
- CC.instCaptureBoundHasDenotation = { interp := CC.CaptureBound.denot }
Equations
- One or more equations did not get rendered due to their size.
- CC.EnvTyping CC.Ctx.empty CC.TypeEnv.empty x✝ = True
- CC.EnvTyping (Γ.push (CC.Binding.var T)) (env.extend (CC.TypeInfo.var n)) x✝ = (⟦T⟧_[env] x✝ (CC.Exp.var (CC.Var.free n)) ∧ CC.EnvTyping Γ env x✝)
- CC.EnvTyping (Γ.push (CC.Binding.tvar S)) (env.extend (CC.TypeInfo.tvar denot)) x✝ = (denot.is_proper ∧ denot.ImplyAfter x✝ ⟦S⟧_[env] ∧ CC.EnvTyping Γ env x✝)
Instances For
Equations
- (C # Γ ⊨ e : E) = ∀ (ρ : CC.TypeEnv s) (m : CC.Memory), CC.EnvTyping Γ ρ m → ⟦E⟧e_[ρ] (CC.CaptureSet.denot ρ C m) m (e.subst (CC.Subst.from_TypeEnv ρ))
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
If a TypeEnv is typed with EnvTyping, then the substitution obtained from it
via Subst.from_TypeEnv is well-formed in the heap.
This is a key lemma connecting the semantic typing judgment to syntactic well-formedness.
Since EnvTyping ensures each variable location in the environment exists in memory,
the substitution that maps variables to these locations must be well-formed.
Equations
- CC.Denot.instHasEquiv = { Equiv := CC.Denot.Equiv }
Equations
- pd1.Equiv pd2 = ∀ (A : CC.CapabilitySet), pd1 A ≈ pd2 A
Instances For
Equations
- CC.PreDenot.instHasEquiv = { Equiv := CC.PreDenot.Equiv }
Equations
- pd.is_monotonic = ∀ (C : CC.CapabilitySet), (pd C).is_monotonic
Instances For
Equations
- pd.is_transparent = ∀ (C : CC.CapabilitySet), (pd C).is_transparent
Instances For
Equations
- pd.is_bool_independent = ∀ (C : CC.CapabilitySet), (pd C).is_bool_independent
Instances For
- tvar (X : BVar s Kind.tvar) : (env.lookup_tvar X).is_monotonic
Instances For
Equations
- env.is_transparent = ∀ (X : CC.BVar s CC.Kind.tvar), (env.lookup_tvar X).is_transparent
Instances For
Equations
- env.is_bool_independent = ∀ (X : CC.BVar s CC.Kind.tvar), (env.lookup_tvar X).is_bool_independent
Instances For
Equations
- env.is_reachability_safe = ∀ (X : CC.BVar s CC.Kind.tvar), (env.lookup_tvar X).is_reachability_safe
Instances For
Equations
- env.is_reachability_monotonic = ∀ (X : CC.BVar s CC.Kind.tvar), (env.lookup_tvar X).is_reachability_monotonic
Instances For
Equations
- env.is_implying_wf = ∀ (X : CC.BVar s CC.Kind.tvar), (env.lookup_tvar X).implies_wf
Instances For
Equations
- env.is_tight = ∀ (X : CC.BVar s CC.Kind.tvar), (env.lookup_tvar X).is_tight
Instances For
Equations
- ⋯ = ⋯
Instances For
Equations
- ⋯ = ⋯
Instances For
Equations
- ⋯ = ⋯
Instances For
Equations
- ⋯ = ⋯
Instances For
Equations
- ⋯ = ⋯
Instances For
Equations
- ⋯ = ⋯
Instances For
Equations
- ⋯ = ⋯
Instances For
Semantic subcapturing.
Equations
- CC.SemSubcapt Γ C1 C2 = ∀ (env : CC.TypeEnv s) (m : CC.Memory), CC.EnvTyping Γ env m → CC.CaptureSet.denot env C1 m ⊆ CC.CaptureSet.denot env C2 m
Instances For
Equations
- CC.SemSubtyp Γ T1_2 T2_2 = ∀ (env : CC.TypeEnv s) (H : CC.Memory), CC.EnvTyping Γ env H → (CC.Ty.shape_val_denot env T1_2).ImplyAfter H (CC.Ty.shape_val_denot env T2_2)
- CC.SemSubtyp Γ T1_2 T2_2 = ∀ (env : CC.TypeEnv s) (H : CC.Memory), CC.EnvTyping Γ env H → (CC.Ty.capt_val_denot env T1_2).ImplyAfter H (CC.Ty.capt_val_denot env T2_2)
- CC.SemSubtyp Γ T1_2 T2_2 = ∀ (env : CC.TypeEnv s) (H : CC.Memory), CC.EnvTyping Γ env H → (CC.Ty.exi_val_denot env T1_2).ImplyAfter H (CC.Ty.exi_val_denot env T2_2)
Instances For
If the type environment is well-typed, then the denotation of any shape type is proper. A PreDenot is proper if it is reachability-safe, monotonic, and transparent. This theorem combines the reachability safety, monotonicity, and transparency results for shape type denotations.