• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
      • Apt
      • Zfc
      • Acre
      • Milawa
      • Smtlink
      • Abnf
        • Deftreeops
        • Defdefparse
        • Defgrammar
        • Tree-utilities
        • Notation
        • Grammar-parser
        • Meta-circular-validation
        • Parsing-primitives-defresult
        • Parsing-primitives-seq
        • Operations
          • In-terminal-set
          • Well-formedness
          • Closure
          • Plugging
          • Ambiguity
            • Concatenation-alternation-disjointp
            • Concatenation-unambiguousp
            • Repetition-unambiguousp
            • Alternation-unambiguousp
            • Alternation-unambiguousp-of-cons-when-disjointp
            • Element-unambiguousp
              • Rules-ambiguousp
              • Prose-val-ambiguous
              • Num-val-unambiguous
              • Char-val-unambiguous
              • Element-prose-val-ambiguous
              • Element-num-val-unambiguous
              • Element-char-val-unambiguous
            • Renaming
            • Numeric-range-retrieval
            • Rule-utilities
            • Removal
            • Character-value-retrieval
          • Examples
          • Differences-with-paper
          • Constructor-utilities
          • Grammar-printer
          • Parsing-tools
        • Vwsim
        • Isar
        • Wp-gen
        • Dimacs-reader
        • Pfcs
        • Legacy-defrstobj
        • Proof-checker-array
        • Soft
        • C
        • Farray
        • Rp-rewriter
        • Instant-runoff-voting
        • Imp-language
        • Sidekick
        • Leftist-trees
        • Java
        • Taspi
        • Bitcoin
        • Riscv
        • Des
        • Ethereum
        • X86isa
        • Sha-2
        • Yul
        • Zcash
        • Proof-checker-itp13
        • Regex
        • ACL2-programming-language
        • Json
        • Jfkr
        • Equational
        • Cryptography
        • Poseidon
        • Where-do-i-place-my-book
        • Axe
        • Bigmems
        • Builtins
        • Execloader
        • Aleo
        • Solidity
        • Paco
        • Concurrent-programs
        • Bls12-377-curves
      • Debugging
      • Std
      • Proof-automation
      • Macro-libraries
      • ACL2
      • Interfacing-tools
      • Hardware-verification
      • Software-verification
      • Math
      • Testing-utilities
    • Ambiguity

    Element-unambiguousp

    Notion of unambiguous elements.

    An element is unambiguous iff any two trees that match the element and have the same string at the leaves are the same tree.

    Definitions and Theorems

    Theorem: element-unambiguousp-necc

    (defthm element-unambiguousp-necc
      (implies (element-unambiguousp element rules)
               (implies (and (treep tree1)
                             (treep tree2)
                             (tree-match-element-p tree1 element rules)
                             (tree-match-element-p tree2 element rules))
                        (equal (equal (tree->string tree1)
                                      (tree->string tree2))
                               (equal tree1 tree2)))))

    Theorem: booleanp-of-element-unambiguousp

    (defthm booleanp-of-element-unambiguousp
      (b* ((yes/no (element-unambiguousp element rules)))
        (booleanp yes/no))
      :rule-classes :rewrite)

    Theorem: element-ambiguousp-rewrite

    (defthm element-ambiguousp-rewrite
      (implies (and (element-unambiguousp element rules)
                    (tree-match-element-p tree1 element rules)
                    (tree-match-element-p tree2 element rules))
               (equal (equal (tree->string tree1)
                             (tree->string tree2))
                      (tree-equiv tree1 tree2))))