Documentation

Cslib.Logics.HML.Basic

Hennessy-Milner Logic (HML) #

Hennessy-Milner Logic (HML) is a logic for reasoning about the behaviour of nondeterministic and concurrent systems.

Implementation notes #

There are two main versions of HML. The original [HM85], which includes a negation connective, and a variation without negation, for example as in [AI99]. We follow the former and focus on a minimal set of connectives, recovering the others as derived constructs.

Main definitions #

Main statements #

References #

inductive Cslib.Logic.HML.Proposition (Label : Type u) :

Propositions.

Instances For
    @[match_pattern]

    Falsity, derived from negation and truth.

    Equations
    Instances For
      @[match_pattern]
      def Cslib.Logic.HML.Proposition.or {Label : Type u_1} (φ₁ φ₂ : Proposition Label) :

      Disjunction, derived from negation and conjunction.

      Equations
      Instances For
        @[match_pattern]
        def Cslib.Logic.HML.Proposition.imp {Label : Type u_1} (φ₁ φ₂ : Proposition Label) :

        Implication.

        Equations
        Instances For
          @[match_pattern]
          def Cslib.Logic.HML.Proposition.iff {Label : Type u_1} (φ₁ φ₂ : Proposition Label) :

          Bi-implication.

          Equations
          Instances For
            @[match_pattern]
            def Cslib.Logic.HML.Proposition.box {Label : Type u_1} (μ : Label) (φ : Proposition Label) :

            Necessity (dynamic box modality), derived from dynamic diamond and negation.

            Equations
            Instances For
              theorem Cslib.Logic.HML.Proposition.and_def {Label : Type u_1} (φ₁ φ₂ : Proposition Label) :
              φ₁.and φ₂ = HasAnd.and φ₁ φ₂
              theorem Cslib.Logic.HML.Proposition.not_def {Label : Type u_1} (φ : Proposition Label) :
              theorem Cslib.Logic.HML.Proposition.diamond_def {Label : Type u_1} (μ : Label) (φ : Proposition Label) :
              theorem Cslib.Logic.HML.Proposition.or_def {Label : Type u_1} (φ₁ φ₂ : Proposition Label) :
              φ₁.or φ₂ = HasOr.or φ₁ φ₂
              theorem Cslib.Logic.HML.Proposition.imp_def {Label : Type u_1} (φ₁ φ₂ : Proposition Label) :
              φ₁.imp φ₂ = HasImp.imp φ₁ φ₂
              theorem Cslib.Logic.HML.Proposition.iff_def {Label : Type u_1} (φ₁ φ₂ : Proposition Label) :
              φ₁.iff φ₂ = HasIff.iff φ₁ φ₂
              theorem Cslib.Logic.HML.Proposition.box_def {Label : Type u_1} (μ : Label) (φ : Proposition Label) :
              def Cslib.Logic.HML.Proposition.finiteAnd {Label : Type u_1} (φs : List (Proposition Label)) :

              Finite conjunction of propositions.

              Equations
              Instances For
                def Cslib.Logic.HML.Proposition.finiteOr {Label : Type u_1} (φs : List (Proposition Label)) :

                Finite disjunction of propositions.

                Equations
                Instances For
                  def Cslib.Logic.HML.Satisfies {State : Type u_1} {Label : Type u_2} (lts : LTS State Label) (s : State) :
                  Proposition LabelProp

                  Satisfaction relation. Satisfies lts s φ means that, in the LTS lts, the state s satisfies the proposition φ.

                  Equations
                  Instances For
                    structure Cslib.Logic.HML.Judgement (State : Type u_1) (Label : Type u_2) :
                    Type (max u_1 u_2)

                    Judgement, representing the conclusions one reaches in HML.

                    • lts : LTS State Label

                      LTS.

                    • state : State

                      The state satisfying the proposition φ.

                    • φ : Proposition Label

                      The proposition satisfied by the state s.

                    Instances For

                      Constructs a judgement.

                      Equations
                      • One or more equations did not get rendered due to their size.
                      Instances For
                        def Cslib.Logic.HML.Satisfies.Bundled {State : Type u_1} {Label : Type u_2} (j : Judgement State Label) :

                        Satisfaction for judgements. This just refers to the unbundled Satisfies.

                        Equations
                        Instances For
                          theorem Cslib.Logic.HML.derivation_def {State✝ : Type u_1} {Label✝ : Type u_2} {lts : LTS State✝ Label✝} {s : State✝} {φ : Proposition Label✝} :
                          Satisfies lts s φ = { lts := lts, state := s, φ := φ }
                          theorem Cslib.Logic.HML.Satisfies.not_iff_not {State✝ : Type u_1} {Label✝ : Type u_2} {lts : LTS State✝ Label✝} {s : State✝} {φ : Proposition Label✝} :
                          { lts := lts, state := s, φ := HasNot.not φ } ¬{ lts := lts, state := s, φ := φ }
                          theorem Cslib.Logic.HML.Satisfies.top {State✝ : Type u_1} {Label✝ : Type u_2} {lts : LTS State✝ Label✝} {s : State✝} :
                          { lts := lts, state := s, φ := }
                          theorem Cslib.Logic.HML.Satisfies.bot {State✝ : Type u_1} {Label✝ : Type u_2} {lts : LTS State✝ Label✝} {s : State✝} :
                          ¬{ lts := lts, state := s, φ := }
                          theorem Cslib.Logic.HML.Satisfies.and_iff_and {State✝ : Type u_1} {Label✝ : Type u_2} {lts : LTS State✝ Label✝} {s : State✝} {φ₁ φ₂ : Proposition Label✝} :
                          { lts := lts, state := s, φ := HasAnd.and φ₁ φ₂ } { lts := lts, state := s, φ := φ₁ } { lts := lts, state := s, φ := φ₂ }
                          theorem Cslib.Logic.HML.Satisfies.or_iff_or {State✝ : Type u_1} {Label✝ : Type u_2} {lts : LTS State✝ Label✝} {s : State✝} {φ₁ φ₂ : Proposition Label✝} :
                          { lts := lts, state := s, φ := HasOr.or φ₁ φ₂ } { lts := lts, state := s, φ := φ₁ } { lts := lts, state := s, φ := φ₂ }
                          theorem Cslib.Logic.HML.Satisfies.diamond_iff_exists {State✝ : Type u_1} {Label✝ : Type u_2} {lts : LTS State✝ Label✝} {s : State✝} {μ : Label✝} {φ : Proposition Label✝} :
                          { lts := lts, state := s, φ := HasDynamicDiamond.dynDiamond μ φ } ∃ (s' : State✝), lts.Tr s μ s' { lts := lts, state := s', φ := φ }
                          theorem Cslib.Logic.HML.Satisfies.imp_iff_imp {State✝ : Type u_1} {Label✝ : Type u_2} {lts : LTS State✝ Label✝} {s : State✝} {φ₁ φ₂ : Proposition Label✝} :
                          { lts := lts, state := s, φ := HasImp.imp φ₁ φ₂ } { lts := lts, state := s, φ := φ₁ }{ lts := lts, state := s, φ := φ₂ }

                          Characterisation of the connective.

                          Implication is defined in terms of the more primitive connectives given in Proposition. This result proves that the definition is correct.

                          theorem Cslib.Logic.HML.Satisfies.iff_iff_iff {State✝ : Type u_1} {Label✝ : Type u_2} {lts : LTS State✝ Label✝} {s : State✝} {φ₁ φ₂ : Proposition Label✝} :
                          { lts := lts, state := s, φ := HasIff.iff φ₁ φ₂ } ({ lts := lts, state := s, φ := φ₁ } { lts := lts, state := s, φ := φ₂ })

                          Characterisation of the connective.

                          Bi-implication is defined in terms of the more primitive connectives given in Proposition. This result proves that the definition is correct.

                          theorem Cslib.Logic.HML.Satisfies.box_iff_forall {State✝ : Type u_1} {Label✝ : Type u_2} {lts : LTS State✝ Label✝} {s : State✝} {μ : Label✝} {φ : Proposition Label✝} :
                          { lts := lts, state := s, φ := HasDynamicBox.dynBox μ φ } ∀ (s' : State✝), lts.Tr s μ s'{ lts := lts, state := s', φ := φ }
                          theorem Cslib.Logic.HML.Satisfies.finiteAnd_iff_forall {State✝ : Type u_1} {Label✝ : Type u_2} {lts : LTS State✝ Label✝} {s : State✝} {φs : List (Proposition Label✝)} :
                          { lts := lts, state := s, φ := Proposition.finiteAnd φs } φφs, { lts := lts, state := s, φ := φ }

                          A state satisfies a finite conjunction iff it satisfies all conjuncts.

                          theorem Cslib.Logic.HML.Satisfies.finiteOr_iff_exists {State✝ : Type u_1} {Label✝ : Type u_2} {lts : LTS State✝ Label✝} {s : State✝} {φs : List (Proposition Label✝)} :
                          { lts := lts, state := s, φ := Proposition.finiteOr φs } φφs, { lts := lts, state := s, φ := φ }

                          A state satisfies a finite disjunction iff it satisfies some disjunct.

                          @[reducible, inline]
                          abbrev Cslib.Logic.HML.theory {State : Type u_1} {Label : Type u_2} (lts : LTS State Label) (s : State) :

                          The theory of a state is the set of all propositions that it satisfies.

                          Equations
                          Instances For
                            @[reducible, inline]
                            abbrev Cslib.Logic.HML.TheoryEq {State : Type u_1} {Label : Type u_2} (lts : LTS State Label) (s1 s2 : State) :

                            Two states are theory-equivalent (for a specific LTS) if they have the same theory.

                            Equations
                            Instances For
                              theorem Cslib.Logic.HML.mem_denotation_iff_satisfies {Label : Type u_1} {State✝ : Type u_2} {lts : LTS State✝ Label} {s : State✝} {φ : Proposition Label} :
                              s Proposition.denotation lts φ { lts := lts, state := s, φ := φ }

                              Characterisation theorem for the denotational semantics.

                              theorem Cslib.Logic.HML.mem_theory_iff_satisfies {State✝ : Type u_1} {Label✝ : Type u_2} {lts : LTS State✝ Label✝} {s : State✝} {φ : Proposition Label✝} :
                              φ theory lts s { lts := lts, state := s, φ := φ }
                              theorem Cslib.Logic.HML.not_denotation {State : Type u_1} {Label : Type u_2} {s : State} {lts : LTS State Label} (φ : Proposition Label) :

                              A state is in the denotation of a proposition iff it is not in the denotation of the negation of the proposition.

                              theorem Cslib.Logic.HML.theoryEq_denotation_eq {State : Type u_1} {Label : Type u_2} {s1 s2 : State} {lts : LTS State Label} :
                              TheoryEq lts s1 s2 ∀ (φ : Proposition Label), s1 Proposition.denotation lts φ s2 Proposition.denotation lts φ

                              Two states are theory-equivalent iff they are denotationally equivalent.

                              theorem Cslib.Logic.HML.not_theoryEq_satisfies {State✝ : Type u_1} {Label✝ : Type u_2} {lts : LTS State✝ Label✝} {s1 s2 : State✝} (h : ¬TheoryEq lts s1 s2) :
                              ∃ (φ : Proposition Label✝), { lts := lts, state := s1, φ := φ } ¬{ lts := lts, state := s2, φ := φ }

                              If two states are not theory equivalent, there exists a distinguishing proposition.

                              theorem Cslib.Logic.HML.theoryEq_satisfies {State✝ : Type u_1} {Label✝ : Type u_2} {lts : LTS State✝ Label✝} {s1 s2 : State✝} {φ : Proposition Label✝} (h : TheoryEq lts s1 s2) (hs : { lts := lts, state := s1, φ := φ }) :
                              { lts := lts, state := s2, φ := φ }

                              If two states are theory equivalent and the former satisfies a proposition, the latter does as well.

                              noncomputable def Cslib.Logic.HML.propositions {State : Type u_1} {Label : Type u_2} {s : State} {μ : Label} {lts : LTS State Label} (stateMap : (lts.image s μ)Proposition Label) [finImage : Fintype (lts.image s μ)] :

                              The list of propositions over finite μ-derivatives.

                              Equations
                              Instances For
                                theorem Cslib.Logic.HML.propositions_complete {State : Type u_1} {Label : Type u_2} {s : State} {μ : Label} {lts : LTS State Label} (stateMap : (lts.image s μ)Proposition Label) [finImage : Fintype (lts.image s μ)] (s' : (lts.image s μ)) :
                                stateMap s' propositions stateMap
                                theorem Cslib.Logic.HML.propositions_satisfies_conjunction {State : Type u_1} {Label : Type u_2} {s : State} {μ : Label} {lts : LTS State Label} (stateMap : (lts.image s μ)Proposition Label) [finImage : Fintype (lts.image s μ)] {s1 s1' : State} (htr : lts.Tr s1 μ s1') (hdist_spec : ∀ (s2' : (lts.image s μ)), { lts := lts, state := s1', φ := stateMap s2' }) :
                                { lts := lts, state := s1, φ := HasDynamicDiamond.dynDiamond μ (Proposition.finiteAnd (propositions stateMap)) }
                                theorem Cslib.Logic.HML.theoryEq_isBisimulation {State : Type u_1} {Label : Type u_2} (lts : LTS State Label) [image_finite : ∀ (s : State) (μ : Label), Finite (lts.image s μ)] :

                                Theory equivalence is a bisimulation.

                                theorem Cslib.Logic.HML.bisimulation_satisfies {State✝ : Type u_1} {r : State✝State✝Prop} {Label : Type u_2} {lts : LTS State✝ Label} {s1 s2 : State✝} {hrb : lts.IsHomBisimulation r} (hr : r s1 s2) (φ : Proposition Label) :
                                { lts := lts, state := s1, φ := φ } { lts := lts, state := s2, φ := φ }

                                If two states are in a bisimulation, one satisfies a proposition iff the other does.

                                theorem Cslib.Logic.HML.bisimulation_theoryEq {State✝ : Type u_1} {r : State✝State✝Prop} {Label✝ : Type u_2} {lts : LTS State✝ Label✝} {s1 s2 : State✝} {hrb : lts.IsHomBisimulation r} (hr : r s1 s2) :
                                TheoryEq lts s1 s2
                                theorem Cslib.Logic.HML.theoryEq_eq_bisimilarity {State : Type u_1} {Label : Type u_2} {lts : LTS State Label} [image_finite : ∀ (s : State) (μ : Label), Finite (lts.image s μ)] :

                                Theory equivalence and bisimilarity coincide for image-finite LTSs.