Documentation

LeanPool.MatchingLogic.Semantics

MatchingLogic.Semantics #

def MatchingLogic.Closed {S : Signature} {Var : Type} (φ : Pattern S Var) :

A pattern is closed when it has no free variables. The paper assumes throughout Sections 3-5 that Γ and φ are closed, without loss of generality.

Equations
Instances For
    @[simp]
    theorem MatchingLogic.FV_var {S : Signature} {Var : Type} (x : Var) :
    @[simp]
    theorem MatchingLogic.FV_imp {S : Signature} {Var : Type} (φ ψ : Pattern S Var) :
    FV (φ.imp ψ) = FV φ FV ψ
    @[simp]
    theorem MatchingLogic.FV_app {S : Signature} {Var : Type} (σ : S.Sym) (f : Fin (S.arity σ)Pattern S Var) :
    FV (Pattern.app σ f) = ⋃ (i : Fin (S.arity σ)), FV (f i)
    @[simp]
    theorem MatchingLogic.FV_ex {S : Signature} {Var : Type} (x : Var) (φ : Pattern S Var) :
    FV (Pattern.ex x φ) = FV φ \ {x}
    theorem MatchingLogic.denote_congr {S : Signature} {Var : Type} [DecidableEq Var] (M : Model S) (φ : Pattern S Var) (ρ ρ' : VarM.carrier) :
    (∀ xFV φ, ρ x = ρ' x)M.denote ρ φ = M.denote ρ' φ

    The denotation depends on a valuation only through the free variables.

    theorem MatchingLogic.denote_closed {S : Signature} {Var : Type} [DecidableEq Var] (M : Model S) {φ : Pattern S Var} ( : Closed φ) (ρ ρ' : VarM.carrier) :
    M.denote ρ φ = M.denote ρ' φ

    For a closed pattern the denotation does not depend on the valuation at all; this is what licenses the paper's ⟦ψ⟧ notation.

    Definition 1: totality and the three consequence relations #

    def MatchingLogic.Model.Total {S : Signature} {Var : Type} [DecidableEq Var] (M : Model S) (ρ : VarM.carrier) (φ : Pattern S Var) :

    φ is total in M under ρ when ρ(φ) = M.

    Equations
    Instances For
      def MatchingLogic.Model.Sat {S : Signature} {Var : Type} [DecidableEq Var] (M : Model S) (φ : Pattern S Var) :

      M ⊨ φ: φ is total in M under every valuation.

      Equations
      Instances For
        def MatchingLogic.Model.SatSet {S : Signature} {Var : Type} [DecidableEq Var] (M : Model S) (Γ : Set (Pattern S Var)) :

        M ⊨ Γ.

        Equations
        Instances For
          def MatchingLogic.Model.denoteSet {S : Signature} {Var : Type} [DecidableEq Var] (M : Model S) (ρ : VarM.carrier) (Δ : Set (Pattern S Var)) :

          ρ(Δ) = ⋂_{δ ∈ Δ} ρ(δ), with value M when Δ = ∅.

          Equations
          Instances For
            def MatchingLogic.LocalCons {S : Signature} {Var : Type} [DecidableEq Var] (Δ : Set (Pattern S Var)) (φ : Pattern S Var) :

            Δ ⊨loc φ: local consequence, comparing denotations pointwise.

            Equations
            Instances For
              def MatchingLogic.GlobalCons {S : Signature} {Var : Type} [DecidableEq Var] (Γ : Set (Pattern S Var)) (φ : Pattern S Var) :

              Γ ⊨ φ: global consequence, asking for totality.

              Equations
              Instances For
                theorem MatchingLogic.Model.sat_iff_denote_eq_univ {S : Signature} {Var : Type} [DecidableEq Var] (M : Model S) {φ : Pattern S Var} ( : Closed φ) (ρ : VarM.carrier) :
                M.Sat φ M.denote ρ φ = Set.univ

                For closed φ, M ⊨ φ says exactly ⟦φ⟧ = M, with no valuation quantifier left (paper, Section 2, "Closed patterns").