Documentation

Linglib.Core.Computability.Subregular.Logic.TreeModel

Tree models and quantifier-free logic over them #

The hierarchical counterpart of Logic/WordModel.lean: the model-theoretic representation of finite labeled trees, the foundation for logical characterizations of tree-to-tree subregular maps. A tree model is a RoseTree L — a node-labeled rose tree — addressed by Gorn indices (List ℕ); its relations are dominance (parent/child) and sibling precedence. Quantifier-free terms navigate by parent/child/sibSucc/sibPred partial functions, giving the bounded reach that, as on strings, underlies tree-local computation.

The model is generic over the label type L; downstream layers instantiate it.

Main definitions #

@[reducible, inline]
abbrev Subregular.Logic.TreeModel (L : Type u_3) :
Type u_3

A tree model: a node-labeled rose tree, addressed by Gorn indices (List ℕ). The carrier is RoseTree L itself — a labeled tree is its model, as a string is its word model.

Equations
Instances For
    def Subregular.Logic.TreeModel.nodeAt {L : Type u_1} :
    TreeModel LList Option (TreeModel L)

    The subtree rooted at a Gorn address, none if the address leaves the tree.

    Equations
    Instances For
      def Subregular.Logic.TreeModel.labelAt? {L : Type u_1} (t : TreeModel L) (a : List ) :
      Option L

      The label at a Gorn address, none off the tree.

      Equations
      Instances For
        def Subregular.Logic.TreeModel.posOf {L : Type u_1} (t : TreeModel L) (a : List ) :
        Option (List )

        The address, if it names a node of t; otherwise none.

        Equations
        • t.posOf a = if (t.nodeAt a).isSome = true then some a else none
        Instances For

          Quantifier-free tree terms #

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

          Quantifier-free tree terms: a variable, or a one-step move to the parent, the i-th child, or the next/previous sibling. The moves are the bounded reach of tree-local logic.

          Instances For
            def Subregular.Logic.TreeTerm.eval {L : Type u_1} {V : Type u_2} (t : TreeModel L) (ρ : VList ) :
            TreeTerm VOption (List )

            Interpret a tree term in t under an assignment ρ of variables to addresses; none if a move leaves the tree.

            Equations
            Instances For
              inductive Subregular.Logic.TreeAtom (L : Type u_3) (V : Type u_4) :
              Type (max u_3 u_4)

              Atomic quantifier-free tree formulas.

              Instances For
                inductive Subregular.Logic.TreeQF (L : Type u_3) (V : Type u_4) :
                Type (max u_3 u_4)

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

                Instances For
                  def Subregular.Logic.TreeAtom.Realize {L : Type u_1} {V : Type u_2} (t : TreeModel L) (ρ : VList ) :
                  TreeAtom L VProp

                  Satisfaction of a tree atom in t under assignment ρ.

                  Equations
                  Instances For
                    @[implicit_reducible]
                    instance Subregular.Logic.instDecidableRealize {L : Type u_1} {V : Type u_2} [DecidableEq L] (t : TreeModel L) (ρ : VList ) (a : TreeAtom L V) :
                    Decidable (TreeAtom.Realize t ρ a)
                    Equations
                    • One or more equations did not get rendered due to their size.

                    Worked example #

                    @[implicit_reducible]
                    Equations