Documentation

Semantic.CC.Denotation.Core

Denotation of types.

Equations
Instances For

    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.

        Instances For

          Capture bound denotation.

          Equations
          Instances For
            Equations
            Instances For
              Equations
              Instances For
                Equations
                Instances For
                  Equations
                  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).

                    Reachability of a heap location equals resolve_reachability of the stored value.

                    This pre-denotation actually enforces the reachability bound.

                    Equations
                    Instances For

                      This pre-denotation is monotonic over reachability sets.

                      Equations
                      Instances For

                        This pre-denotation entails heap well-formedness.

                        Equations
                        Instances For

                          This pre-denotation is "tight" on reachability sets.

                          Equations
                          Instances For

                            This is a proper pre-denotation.

                            Equations
                            Instances For
                              def CC.Denot.Imply (d1 d2 : Denot) :
                              Equations
                              Instances For
                                Equations
                                Instances For
                                  def CC.Denot.ImplyAt (d1 : Denot) (m : Memory) (d2 : Denot) :
                                  Equations
                                  Instances For
                                    def CC.PreDenot.ImplyAt (pd1 pd2 : PreDenot) (m : Memory) :
                                    Equations
                                    Instances For
                                      def CC.Denot.ImplyAfter (d1 : Denot) (m : Memory) (d2 : Denot) :
                                      Equations
                                      Instances For
                                        Equations
                                        Instances For
                                          theorem CC.Denot.imply_implyat {m : Memory} {d1 d2 : Denot} (himp : d1.Imply d2) :
                                          d1.ImplyAt m d2
                                          theorem CC.Denot.implyat_trans {m : Memory} {d3 d1 d2 : Denot} (himp1 : d1.ImplyAt m d2) (himp2 : d2.ImplyAt m d3) :
                                          d1.ImplyAt m d3
                                          theorem CC.Denot.imply_after_subsumes {m1 m2 : Memory} {d1 d2 : Denot} (himp : d1.ImplyAfter m1 d2) (hmem : m2.subsumes m1) :
                                          d1.ImplyAfter m2 d2
                                          theorem CC.Denot.imply_after_to_imply_at {m : Memory} {d1 d2 : Denot} (himp : d1.ImplyAfter m d2) :
                                          d1.ImplyAt m d2
                                          theorem CC.Denot.imply_after_trans {m : Memory} {d1 d2 d3 : Denot} (himp1 : d1.ImplyAfter m d2) (himp2 : d2.ImplyAfter m d3) :
                                          d1.ImplyAfter m d3
                                          theorem CC.Denot.apply_imply_at {m : Memory} {e : Exp } {d1 d2 : Denot} (ht : d1 m e) (himp : d1.ImplyAt m d2) :
                                          d2 m e
                                          inductive CC.TypeInfo :
                                          Instances For
                                            inductive CC.TypeEnv :
                                            SigType
                                            Instances For
                                              def CC.TypeEnv.extend_var {s : Sig} (Γ : TypeEnv s) (x : ) :
                                              Equations
                                              Instances For
                                                def CC.TypeEnv.extend_tvar {s : Sig} (Γ : TypeEnv s) (T : PreDenot) :
                                                Equations
                                                Instances For
                                                  def CC.TypeEnv.extend_cvar {s : Sig} (Γ : TypeEnv s) (ground : CaptureSet ) :
                                                  Equations
                                                  Instances For
                                                    def CC.TypeEnv.lookup {s : Sig} {k : Kind} (Γ : TypeEnv s) (x : BVar s k) :
                                                    Equations
                                                    Instances For
                                                      def CC.TypeEnv.lookup_var {s : Sig} (Γ : TypeEnv s) (x : BVar s Kind.var) :
                                                      Equations
                                                      Instances For
                                                        Equations
                                                        Instances For
                                                          Equations
                                                          Instances For
                                                            def CC.Subst.from_TypeEnv {s : Sig} (env : TypeEnv s) :
                                                            Equations
                                                            • One or more equations did not get rendered due to their size.
                                                            Instances For

                                                              Compute denotation for a ground capture set.

                                                              Equations
                                                              Instances For
                                                                def CC.CaptureSet.denot {s : Sig} (ρ : TypeEnv s) (cs : CaptureSet s) :
                                                                Equations
                                                                Instances For
                                                                  theorem CC.CapabilitySet.BoundedBy.trans {C : CapabilitySet} {B1 B2 : CapabilityBound} (hbound : C.BoundedBy B1) (hsub : B1 B2) :
                                                                  @[irreducible]
                                                                  Equations
                                                                  Instances For
                                                                    @[irreducible]
                                                                    Equations
                                                                    • One or more equations did not get rendered due to their size.
                                                                    Instances For
                                                                      @[irreducible]
                                                                      Equations
                                                                      Instances For
                                                                        Equations
                                                                        Instances For
                                                                          @[irreducible]
                                                                          Equations
                                                                          Instances For
                                                                            def CC.EnvTyping {s : Sig} :
                                                                            Ctx sTypeEnv sMemoryProp
                                                                            Equations
                                                                            Instances For
                                                                              def CC.SemanticTyping {s : Sig} (C : CaptureSet s) (Γ : Ctx s) (e : Exp s) (E : Ty TySort.exi s) :
                                                                              Equations
                                                                              Instances For
                                                                                Equations
                                                                                • One or more equations did not get rendered due to their size.
                                                                                Instances For
                                                                                  theorem CC.from_TypeEnv_wf_in_heap {s : Sig} {Γ : Ctx s} {ρ : TypeEnv s} {m : Memory} (htyping : EnvTyping Γ ρ m) :

                                                                                  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.

                                                                                  def CC.Denot.Equiv (d1 d2 : Denot) :
                                                                                  Equations
                                                                                  Instances For
                                                                                    Equations
                                                                                    • =
                                                                                    Instances For
                                                                                      def CC.Denot.equiv_symm (d1 d2 : Denot) :
                                                                                      d1 d2d2 d1
                                                                                      Equations
                                                                                      • =
                                                                                      Instances For
                                                                                        def CC.Denot.equiv_trans (d1 d2 d3 : Denot) :
                                                                                        d1 d2d2 d3d1 d3
                                                                                        Equations
                                                                                        • =
                                                                                        Instances For
                                                                                          theorem CC.Denot.eq_to_equiv (d1 d2 : Denot) :
                                                                                          d1 = d2d1 d2
                                                                                          theorem CC.Denot.equiv_ltr {m : Memory} {e : Exp } {d1 d2 : Denot} (heqv : d1 d2) (h1 : d1 m e) :
                                                                                          d2 m e
                                                                                          theorem CC.Denot.equiv_rtl {m : Memory} {e : Exp } {d1 d2 : Denot} (heqv : d1 d2) (h2 : d2 m e) :
                                                                                          d1 m e
                                                                                          theorem CC.Denot.equiv_to_imply {d1 d2 : Denot} (heqv : d1 d2) :
                                                                                          d1.Imply d2 d2.Imply d1
                                                                                          theorem CC.Denot.equiv_to_imply_l {d1 d2 : Denot} (heqv : d1 d2) :
                                                                                          d1.Imply d2
                                                                                          theorem CC.Denot.equiv_to_imply_r {d1 d2 : Denot} (heqv : d1 d2) :
                                                                                          d2.Imply d1
                                                                                          theorem CC.Denot.imply_to_entails (d1 d2 : Denot) (himp : d1.Imply d2) :
                                                                                          Equations
                                                                                          Instances For
                                                                                            theorem CC.PreDenot.equiv_def {pd1 pd2 : PreDenot} :
                                                                                            pd1 pd2 ∀ (A : CapabilitySet) (m : Memory) (e : Exp ), pd1 A m e pd2 A m e
                                                                                            theorem CC.PreDenot.eq_to_equiv {pd1 pd2 : PreDenot} (h : pd1 = pd2) :
                                                                                            pd1 pd2
                                                                                            theorem CC.PreDenot.equiv_symm (pd1 pd2 : PreDenot) :
                                                                                            pd1 pd2pd2 pd1
                                                                                            theorem CC.PreDenot.equiv_trans (pd1 pd2 pd3 : PreDenot) :
                                                                                            pd1 pd2pd2 pd3pd1 pd3
                                                                                            theorem CC.Denot.imply_trans {d1 d2 d3 : Denot} (h1 : d1.Imply d2) (h2 : d2.Imply d3) :
                                                                                            d1.Imply d3
                                                                                            theorem CC.resolve_var_heap_some {heap : Heap} {x : } {v : HeapVal} (hheap : heap x = some (Cell.val v)) :
                                                                                            theorem CC.resolve_val {heap : Heap} {v : Exp } (hval : v.IsVal) :
                                                                                            resolve heap v = some v
                                                                                            theorem CC.resolve_var_heap_trans {heap : Heap} {x : } {v : HeapVal} (hheap : heap x = some (Cell.val v)) :
                                                                                            theorem CC.resolve_var_or_val {store : Heap} {e v : Exp } (hv : resolve store e = some v) :
                                                                                            (∃ (x : Var Kind.var ), e = Exp.var x) e = v
                                                                                            theorem CC.resolve_ans_to_val {store : Heap} {e v : Exp } (hv : resolve store e = some v) (hans : v.IsAns) :
                                                                                            Equations
                                                                                            Instances For
                                                                                              Equations
                                                                                              Instances For
                                                                                                structure CC.TypeEnv.IsMonotonic {s : Sig} (env : TypeEnv s) :
                                                                                                Instances For
                                                                                                  Equations
                                                                                                  Instances For
                                                                                                    Equations
                                                                                                    Instances For
                                                                                                      def CC.TypeEnv.is_tight {s : Sig} (env : TypeEnv s) :
                                                                                                      Equations
                                                                                                      Instances For
                                                                                                        theorem CC.typed_env_is_monotonic {a✝ : Sig} {Γ : Ctx a✝} {env : TypeEnv a✝} {mem : Memory} (ht : EnvTyping Γ env mem) :
                                                                                                        theorem CC.typed_env_is_transparent {a✝ : Sig} {Γ : Ctx a✝} {env : TypeEnv a✝} {mem : Memory} (ht : EnvTyping Γ env mem) :
                                                                                                        theorem CC.typed_env_is_bool_independent {a✝ : Sig} {Γ : Ctx a✝} {env : TypeEnv a✝} {mem : Memory} (ht : EnvTyping Γ env mem) :
                                                                                                        theorem CC.typed_env_is_reachability_safe {a✝ : Sig} {Γ : Ctx a✝} {env : TypeEnv a✝} {mem : Memory} (ht : EnvTyping Γ env mem) :
                                                                                                        theorem CC.typed_env_is_reachability_monotonic {a✝ : Sig} {Γ : Ctx a✝} {env : TypeEnv a✝} {mem : Memory} (ht : EnvTyping Γ env mem) :
                                                                                                        theorem CC.typed_env_is_implying_wf {a✝ : Sig} {Γ : Ctx a✝} {env : TypeEnv a✝} {mem : Memory} (ht : EnvTyping Γ env mem) :
                                                                                                        theorem CC.typed_env_is_tight {a✝ : Sig} {Γ : Ctx a✝} {env : TypeEnv a✝} {mem : Memory} (ht : EnvTyping Γ env mem) :
                                                                                                        theorem CC.capture_bound_denot_is_monotonic {s : Sig} {ρ : TypeEnv s} {m1 m2 : Memory} {B : CaptureBound s} (hwf : (B.subst (Subst.from_TypeEnv ρ)).WfInHeap m1.heap) (hsub : m2.subsumes m1) :
                                                                                                        Equations
                                                                                                        • =
                                                                                                        Instances For
                                                                                                          Equations
                                                                                                          • =
                                                                                                          Instances For
                                                                                                            Equations
                                                                                                            • =
                                                                                                            Instances For
                                                                                                              Equations
                                                                                                              • =
                                                                                                              Instances For
                                                                                                                Equations
                                                                                                                • =
                                                                                                                Instances For
                                                                                                                  def CC.capt_exp_denot_is_monotonic {s : Sig} {env : TypeEnv s} (henv_mono : env.IsMonotonic) (henv_bool : env.is_bool_independent) (T : Ty TySort.capt s) {C : CapabilitySet} {m1 m2 : Memory} {e : Exp } :
                                                                                                                  e.WfInHeap m1.heapm2.subsumes m1Ty.capt_exp_denot env T C m1 eTy.capt_exp_denot env T C m2 e
                                                                                                                  Equations
                                                                                                                  • =
                                                                                                                  Instances For
                                                                                                                    def CC.exi_exp_denot_is_monotonic {s : Sig} {env : TypeEnv s} (henv_mono : env.IsMonotonic) (henv_bool : env.is_bool_independent) (T : Ty TySort.exi s) {C : CapabilitySet} {m1 m2 : Memory} {e : Exp } :
                                                                                                                    e.WfInHeap m1.heapm2.subsumes m1Ty.exi_exp_denot env T C m1 eTy.exi_exp_denot env T C m2 e
                                                                                                                    Equations
                                                                                                                    • =
                                                                                                                    Instances For
                                                                                                                      theorem CC.env_typing_monotonic {a✝ : Sig} {Γ : Ctx a✝} {env : TypeEnv a✝} {mem1 mem2 : Memory} (ht : EnvTyping Γ env mem1) (hmem : mem2.subsumes mem1) :
                                                                                                                      EnvTyping Γ env mem2
                                                                                                                      def CC.SemSubcapt {s : Sig} (Γ : Ctx s) (C1 C2 : CaptureSet s) :

                                                                                                                      Semantic subcapturing.

                                                                                                                      Equations
                                                                                                                      Instances For
                                                                                                                        def CC.SemSubtyp {s : Sig} {k : TySort} (Γ : Ctx s) (T1 T2 : Ty k s) :
                                                                                                                        Equations
                                                                                                                        Instances For
                                                                                                                          theorem CC.wf_from_resolve_unit {m : Memory} {e : Exp } (hresolve : resolve m.heap e = some Exp.unit) :

                                                                                                                          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.

                                                                                                                          theorem CC.shape_val_denot_is_proper {s : Sig} {Γ : Ctx s} {m : Memory} {env : TypeEnv s} {S : Ty TySort.shape s} (hts : EnvTyping Γ env m) :
                                                                                                                          theorem CC.capt_denot_implyafter_lift {a✝ : Sig} {env : TypeEnv a✝} {T1 : Ty TySort.capt a✝} {H : Memory} {T2 : Ty TySort.capt a✝} (himp : (Ty.capt_val_denot env T1).ImplyAfter H (Ty.capt_val_denot env T2)) :
                                                                                                                          theorem CC.exi_denot_implyafter_lift {a✝ : Sig} {env : TypeEnv a✝} {T1 : Ty TySort.exi a✝} {H : Memory} {T2 : Ty TySort.exi a✝} (himp : (Ty.exi_val_denot env T1).ImplyAfter H (Ty.exi_val_denot env T2)) :