Documentation

Linglib.Core.Computability.Subregular.Logic.QFLogic

Quantifier-free logic over word models #

The quantifier-free (QF) fragment of the logic of word models. Terms are built from a variable by applying the successor/predecessor partial functions; formulas are boolean combinations of atomic label/equality/definedness tests. Because successor is a function, a QF term reaches a bounded neighbourhood of its variable with no quantifiers — the syntactic counterpart of strict locality (an existential like ∃w,y[succ w x ∧ succ x y ∧ …] collapses to the quantifier-free … (pred x) ∧ … (succ x)). The locality bridge (Logic/LocalityBridge.lean) makes this precise: QF-definable transductions are exactly the Input-Strictly-Local functions of Subregular ([Cha14a], [CJ19]).

Main definitions #

Implementation notes #

Realize is Prop-valued (mathlib's model-theory idiom) with a derived Decidable instance, so worked examples close by decide. A Term evaluates to Option ℕ, none once it falls off an edge; atoms over an undefined term are false.

inductive Subregular.Logic.Term (V : Type u_3) :
Type u_3

Quantifier-free terms: a variable, or the successor/predecessor of a term. The succ/pred chains give bounded-window reach without quantifiers.

Instances For
    @[implicit_reducible]
    instance Subregular.Logic.instDecidableEqTerm {V✝ : Type u_3} [DecidableEq V✝] :
    DecidableEq (Term V✝)
    Equations
    def Subregular.Logic.Term.eval {α : Type u_1} {V : Type u_2} (w : WordModel α) (ρ : V) :
    Term VOption

    Interpret a term in a word model under an assignment ρ of variables to positions; none if it falls off an edge.

    Equations
    Instances For

      Directed terms and substitution #

      A term is backward if it uses no successor — only the variable and predecessors, so it reads positions at or before its variable.

      Equations
      Instances For

        A term is forward if it uses no predecessor, so it reads positions at or after its variable.

        Equations
        Instances For
          def Subregular.Logic.Term.pdepth {V : Type u_2} :
          Term V

          The predecessor depth of a term: how far back it reaches.

          Equations
          Instances For
            @[implicit_reducible]
            instance Subregular.Logic.Term.instDecidableBackward {V : Type u_2} (t : Term V) :
            Decidable t.Backward
            Equations
            @[implicit_reducible]
            instance Subregular.Logic.Term.instDecidableForward {V : Type u_2} (t : Term V) :
            Decidable t.Forward
            Equations
            def Subregular.Logic.Term.comp :
            Term UnitTerm UnitTerm Unit

            Substitution into the single variable: t.comp u is t[u/x].

            Equations
            Instances For
              inductive Subregular.Logic.Atom (α : Type u_3) (V : Type u_4) :
              Type (max u_3 u_4)

              Atomic quantifier-free formulas: a label test, an equality of positions, or a definedness test on a term.

              Instances For
                inductive Subregular.Logic.QF (α : Type u_3) (V : Type u_4) :
                Type (max u_3 u_4)

                Quantifier-free formulas: boolean combinations of atoms (no quantifiers).

                Instances For
                  def Subregular.Logic.Atom.Realize {α : Type u_1} {V : Type u_2} (w : WordModel α) (ρ : V) :
                  Atom α VProp

                  Satisfaction of an atom in w under assignment ρ.

                  Equations
                  Instances For
                    @[implicit_reducible]
                    instance Subregular.Logic.instDecidableRealize {α : Type u_1} {V : Type u_2} [DecidableEq α] (w : WordModel α) (ρ : V) (a : Atom α V) :
                    Decidable (Atom.Realize w ρ a)
                    Equations
                    • One or more equations did not get rendered due to their size.
                    @[implicit_reducible]
                    instance Subregular.Logic.QF.instDecidableRealize {α : Type u_1} {V : Type u_2} [DecidableEq α] (w : WordModel α) (ρ : V) (φ : QF α V) :
                    Decidable (Realize w ρ φ)
                    Equations
                    def Subregular.Logic.QF.initial {α : Type u_1} {V : Type u_2} (t : Term V) :
                    QF α V

                    t is an initial position: in-domain with no predecessor.

                    Equations
                    Instances For
                      def Subregular.Logic.QF.final {α : Type u_1} {V : Type u_2} (t : Term V) :
                      QF α V

                      t is a final position: in-domain with no successor.

                      Equations
                      Instances For

                        Worked example #

                        @[implicit_reducible]
                        Equations