Documentation

Cslib.Foundations.Logic.Operators

Logical operators #

This module contains typeclasses and associated notation for common logical operators: propositional connectives (like ∧ and →), modalities (like ◇, plain and indexed), linear connectives (like ⊗), etc.

Propositional connectives #

class Cslib.Logic.HasAnd (α : Type u_1) :
Type u_1

The type α has an and connective (∧).

  • and (a b : α) : α

    a ∧ b is the conjunction of a and b.

Instances

    a ∧ b is the conjunction of a and b.

    Equations
    Instances For
      class Cslib.Logic.HasOr (α : Type u_1) :
      Type u_1

      The type α has an or connective (∨).

      • or (a b : α) : α

        a ∨ b is the disjunction of a and b.

      Instances

        a ∨ b is the disjunction of a and b.

        Equations
        Instances For
          def Cslib.Logic.finiteAnd {α : Type u_1} [HasAnd α] [Top α] (as : List α) :
          α

          Finite conjunction, with empty conjunction equal to truth.

          Equations
          Instances For

            Finite conjunction, with empty conjunction equal to truth.

            Equations
            Instances For
              @[simp]
              theorem Cslib.Logic.finiteAnd_nil {α : Type u_1} [HasAnd α] [Top α] :
              @[simp]
              theorem Cslib.Logic.finiteAnd_cons {α : Type u_1} [HasAnd α] [Top α] (a : α) (as : List α) :
              def Cslib.Logic.finiteOr {α : Type u_1} [HasOr α] [Bot α] (as : List α) :
              α

              Finite disjunction, with empty disjunction equal to falsehood.

              Equations
              Instances For

                Finite disjunction, with empty disjunction equal to falsehood.

                Equations
                Instances For
                  @[simp]
                  theorem Cslib.Logic.finiteOr_nil {α : Type u_1} [HasOr α] [Bot α] :
                  @[simp]
                  theorem Cslib.Logic.finiteOr_cons {α : Type u_1} [HasOr α] [Bot α] (a : α) (as : List α) :
                  finiteOr (a :: as) = HasOr.or a (finiteOr as)
                  class Cslib.Logic.HasImp (α : Type u_1) :
                  Type u_1

                  The type α has an implication connective (→).

                  • imp (a b : α) : α

                    a → b denotes a implies b.

                  Instances

                    a → b denotes a implies b.

                    Equations
                    Instances For
                      class Cslib.Logic.HasIff (α : Type u_1) :
                      Type u_1

                      The type α has a bi-implication connective (↔).

                      • iff (a b : α) : α

                        a ↔ b denotes a implies b and vice-versa.

                      Instances

                        a ↔ b denotes a implies b and vice-versa.

                        Equations
                        Instances For
                          class Cslib.Logic.HasNot (α : Type u_1) :
                          Type u_1

                          The type α has a negation connective (¬).

                          • not (a : α) : α

                            ¬a is the negation of a.

                          Instances

                            ¬a is the negation of a.

                            Equations
                            Instances For

                              General modalities from modal similarity types (polynomial functors) #

                              class Cslib.Logic.HasTriangle (α : Type u_1) (τ : outParam PFunctor.{u_3, u_2}) :
                              Type (max (max u_1 u_2) u_3)

                              The type α has a family of triangle operators (Δ).

                              • triangle (op : τ.A) (arg : τ.B op → α) : α

                                Δ[op](φ₁, ..., φₙ) means that φ₁, ..., φₙ are valid at some respective related states.

                              Instances

                                Δ[op](φ₁, ..., φₙ) means that φ₁, ..., φₙ are valid at some respective related states.

                                Equations
                                • One or more equations did not get rendered due to their size.
                                Instances For
                                  class Cslib.Logic.HasNabla (α : Type u_1) (τ : outParam PFunctor.{u_3, u_2}) :
                                  Type (max (max u_1 u_2) u_3)

                                  The type α has a family of nabla operators (∇).

                                  • nabla (op : τ.A) (arg : τ.B op → α) : α

                                    ∇[op](φ₁, ..., φₙ) means that φ₁, ..., φₙ are valid at all respective related states.

                                  Instances

                                    ∇[op](φ₁, ..., φₙ) means that φ₁, ..., φₙ are valid at all respective related states.

                                    Equations
                                    • One or more equations did not get rendered due to their size.
                                    Instances For

                                      Dynamic modalities #

                                      Here we need to use the prefix d to distinguish our notation from the normal [·] and ⟨·⟩. A refactoring that makes this unnecessary would be welcome.

                                      class Cslib.Logic.HasDynamicDiamond (α : Type u_1) (β : outParam (Type u_2)) :
                                      Type (max u_1 u_2)

                                      The type α has a dynamic diamond modality with action type β (d⟨a⟩φ).

                                      • dynDiamond (a : β) (b : α) : α

                                        b is possibly valid after a.

                                      Instances

                                        b is possibly valid after a.

                                        Equations
                                        • One or more equations did not get rendered due to their size.
                                        Instances For
                                          class Cslib.Logic.HasDynamicBox (α : Type u_1) (β : outParam (Type u_2)) :
                                          Type (max u_1 u_2)

                                          The type α has a dynamic box modality with action type β (d[a]φ).

                                          • dynBox (a : β) (b : α) : α

                                            b is necessarily valid after a.

                                          Instances

                                            b is necessarily valid after a.

                                            Equations
                                            • One or more equations did not get rendered due to their size.
                                            Instances For
                                              @[instance_reducible]

                                              A family of triangle operators over induces dynamic diamond modalities by applying each operator to the constant argument family.

                                              Equations
                                              @[instance_reducible]

                                              A family of nabla operators induces dynamic box modalities by applying each operator to the constant argument family.

                                              Equations
                                              @[simp]
                                              theorem Cslib.Logic.dynBox_eq_nabla {α : Type u_1} {τ : PFunctor.{u_2, u_3}} [HasNabla α τ] (op : τ.A) (φ : α) :

                                              Basic modalities (Unimodal logic operators) #

                                              class Cslib.Logic.HasBox (α : Type u_1) :
                                              Type u_1

                                              The type α has a box modality (□).

                                              • box (a : α) : α

                                                a is valid in all immediately reachable states.

                                              Instances

                                                a is valid in all immediately reachable states.

                                                Equations
                                                Instances For
                                                  class Cslib.Logic.HasDiamond (α : Type u_1) :
                                                  Type u_1

                                                  The type α has a diamond modality (◇).

                                                  • diamond (a : α) : α

                                                    a is valid in a reachable state.

                                                  Instances

                                                    a is valid in a reachable state.

                                                    Equations
                                                    Instances For
                                                      @[instance_reducible]

                                                      A dynamic diamond modality with a unique action induces a basic diamond modality.

                                                      Equations
                                                      @[instance_reducible]
                                                      instance Cslib.Logic.instHasBoxOfUniqueOfHasDynamicBox {β : Type u_1} {α : Type u_2} [Unique β] [HasDynamicBox α β] :

                                                      A dynamic box modality with a unique action induces a basic box modality.

                                                      Equations
                                                      @[simp]
                                                      theorem Cslib.Logic.box_eq_dynBox {β : Type u_1} {α : Type u_2} [Unique β] [HasDynamicBox α β] {φ : α} :

                                                      Linear connectives #

                                                      class Cslib.Logic.HasTensor (α : Type u_1) :
                                                      Type u_1

                                                      The type α has a tensor connective (⊗).

                                                      • tensor (a b : α) : α

                                                        a ⊗ b is the multiplicative conjunction of a and b.

                                                      Instances

                                                        a ⊗ b is the multiplicative conjunction of a and b.

                                                        Equations
                                                        Instances For