Documentation

Trestle.Encode.Tseitin

Tseitin Transform #

This file implements a lightly optimized Tseitin encoding of arbitrary PropForm formulas into CNF.

The formula is put into negation normal form first, and top-level ∧ / top-level ∨ are collected into one formula/clause respectively.

Instances For
    @[irreducible]
    Equations
    Instances For
      @[irreducible]
      Equations
      Instances For
        @[irreducible]
        Equations
        Instances For
          @[irreducible]
          Equations
          Instances For
            @[irreducible]
            Equations
            • =
            Instances For
              @[irreducible]
              Equations
              • =
              Instances For

                Take a formula f into

                Equations
                • One or more equations did not get rendered due to their size.
                Instances For
                  @[irreducible]
                  def Trestle.Encode.Tseitin.encodeNNF_mkDefs {ν' : Type u_1} {ν : Type} (fs : Array (NegNormForm ν')) (emb : ν' ν) :
                  VEncCNF (ν Fin fs.size) Unit fun (τ : Model.PropAssignment (ν Fin fs.size)) => ∀ (i : Fin fs.size), τ (Sum.inr i) = trueModel.PropAssignment.map (Sum.inl emb) τ fs[i].toPropFun
                  Equations
                  • One or more equations did not get rendered due to their size.
                  Instances For
                    @[irreducible]
                    def Trestle.Encode.Tseitin.encodeNNF {ν : Type} {ν' : Type u_1} (t : ν) (emb : ν' ν) (f : NegNormForm ν') :
                    VEncCNF ν Unit fun (τ : Model.PropAssignment ν) => τ t = trueτ Model.PropFun.map (⇑emb) f.toPropFun

                    Tseitin encoding in the general case creates temporaries for each clause

                    Equations
                    • One or more equations did not get rendered due to their size.
                    Instances For
                      def Trestle.Encode.Tseitin.encodeNNF_top_clause {ν : Type} (clause : Array (NegNormForm ν)) :
                      VEncCNF ν Unit fun (τ : Model.PropAssignment ν) => fclause, τ f.toPropFun
                      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.
                        Instances For
                          Equations
                          • One or more equations did not get rendered due to their size.
                          Instances For
                            • p : V
                            • q : V
                            • r : V
                            • s : V
                            • t : V
                            Instances For
                              Equations
                              • One or more equations did not get rendered due to their size.
                              Instances For