• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
      • Apt
      • Zfc
      • Acre
      • Milawa
      • Smtlink
      • Abnf
        • Deftreeops
        • Defdefparse
        • Defgrammar
        • Tree-utilities
        • Notation
          • Syntax-abstraction
          • Semantics
            • Tree-terminatedp
            • Tree->string
            • String-has-finite-parse-trees-p
            • Parse-trees-of-string-p
              • Tree-match-element-p
              • Parse-treep
              • Symbol
              • String-unambiguousp
              • Tree-match-num-val-p
              • Nat-match-insensitive-char-p
              • Nats-match-insensitive-chars-p
              • Tree-option
              • String-parsablep
              • Lookup-rulename
              • Nats-match-sensitive-chars-p
              • Numrep-match-repeat-range-p
              • Tree-match-char-val-p
              • Tree-list-match-repetition-p
              • String-ambiguousp
              • Parse
              • Tree-match-prose-val-p
              • Nat-match-sensitive-char-p
              • Theorems-about-terminated-trees-matching-elements
              • Tree-option-result
              • Tree-list-result
              • Tree-list-list-result
              • Tree-result
              • Tree-list-list-match-concatenation-p
              • Languagep
              • Terminal-string-for-rules-p
              • Tree-list-list-match-alternation-p
              • Tree-list-match-element-p
              • Parse!
              • String
              • Tree-set
              • Trees
            • Abstract-syntax
            • Core-rules
            • Concrete-syntax
          • Grammar-parser
          • Meta-circular-validation
          • Parsing-primitives-defresult
          • Parsing-primitives-seq
          • Operations
          • Examples
          • Differences-with-paper
          • Constructor-utilities
          • Grammar-printer
          • Parsing-tools
        • Vwsim
        • Isar
        • Wp-gen
        • Dimacs-reader
        • Pfcs
        • Legacy-defrstobj
        • C
        • Proof-checker-array
        • Soft
        • Farray
        • Rp-rewriter
        • Instant-runoff-voting
        • Imp-language
        • Sidekick
        • Ethereum
        • Leftist-trees
        • Java
        • Riscv
        • Taspi
        • Bitcoin
        • Zcash
        • Des
        • X86isa
        • Sha-2
        • Yul
        • Proof-checker-itp13
        • Regex
        • ACL2-programming-language
        • Json
        • Jfkr
        • Equational
        • Cryptography
        • Axe
        • Poseidon
        • Where-do-i-place-my-book
        • Aleo
        • Bigmems
        • Builtins
        • Execloader
        • Solidity
        • Paco
        • Concurrent-programs
        • Bls12-377-curves
      • Debugging
      • Community
      • Std
      • Proof-automation
      • Macro-libraries
      • ACL2
      • Interfacing-tools
      • Hardware-verification
      • Software-verification
      • Math
      • Testing-utilities
    • Semantics

    Parse-trees-of-string-p

    Check if a finite set of trees is the set of all and only the parse trees of a string.

    If this is true, then the string has a finite number of parse trees.

    Definitions and Theorems

    Theorem: parse-trees-of-string-p-necc0

    (defthm parse-trees-of-string-p-necc0
      (implies (parse-trees-of-string-p trees string rulename rules)
               (iff (in tree (tree-set-fix trees))
                    (parse-treep tree string rulename rules))))

    Theorem: booleanp-of-parse-trees-of-string-p

    (defthm booleanp-of-parse-trees-of-string-p
      (b*
        ((yes/no (parse-trees-of-string-p trees string rulename rules)))
        (booleanp yes/no))
      :rule-classes :rewrite)

    Theorem: parse-trees-of-string-p-necc

    (defthm parse-trees-of-string-p-necc
     (implies (and (parse-trees-of-string-p trees string rulename rules)
                   (tree-setp trees))
              (iff (in tree trees)
                   (parse-treep tree string rulename rules))))

    Theorem: parse-trees-of-string-p-of-tree-set-fix-trees

    (defthm parse-trees-of-string-p-of-tree-set-fix-trees
      (equal (parse-trees-of-string-p (tree-set-fix trees)
                                      string rulename rules)
             (parse-trees-of-string-p trees string rulename rules)))

    Theorem: parse-trees-of-string-p-tree-set-equiv-congruence-on-trees

    (defthm parse-trees-of-string-p-tree-set-equiv-congruence-on-trees
     (implies
      (tree-set-equiv trees trees-equiv)
      (equal
           (parse-trees-of-string-p trees string rulename rules)
           (parse-trees-of-string-p trees-equiv string rulename rules)))
     :rule-classes :congruence)

    Theorem: parse-trees-of-string-p-of-string-fix-string

    (defthm parse-trees-of-string-p-of-string-fix-string
      (equal (parse-trees-of-string-p trees (string-fix string)
                                      rulename rules)
             (parse-trees-of-string-p trees string rulename rules)))

    Theorem: parse-trees-of-string-p-string-equiv-congruence-on-string

    (defthm parse-trees-of-string-p-string-equiv-congruence-on-string
     (implies
      (string-equiv string string-equiv)
      (equal
           (parse-trees-of-string-p trees string rulename rules)
           (parse-trees-of-string-p trees string-equiv rulename rules)))
     :rule-classes :congruence)

    Theorem: parse-trees-of-string-p-of-rulename-fix-rulename

    (defthm parse-trees-of-string-p-of-rulename-fix-rulename
      (equal
           (parse-trees-of-string-p trees string (rulename-fix rulename)
                                    rules)
           (parse-trees-of-string-p trees string rulename rules)))

    Theorem: parse-trees-of-string-p-rulename-equiv-congruence-on-rulename

    (defthm
          parse-trees-of-string-p-rulename-equiv-congruence-on-rulename
     (implies
      (rulename-equiv rulename rulename-equiv)
      (equal
           (parse-trees-of-string-p trees string rulename rules)
           (parse-trees-of-string-p trees string rulename-equiv rules)))
     :rule-classes :congruence)

    Theorem: parse-trees-of-string-p-of-rulelist-fix-rules

    (defthm parse-trees-of-string-p-of-rulelist-fix-rules
     (equal
          (parse-trees-of-string-p trees
                                   string rulename (rulelist-fix rules))
          (parse-trees-of-string-p trees string rulename rules)))

    Theorem: parse-trees-of-string-p-rulelist-equiv-congruence-on-rules

    (defthm parse-trees-of-string-p-rulelist-equiv-congruence-on-rules
     (implies
      (rulelist-equiv rules rules-equiv)
      (equal
           (parse-trees-of-string-p trees string rulename rules)
           (parse-trees-of-string-p trees string rulename rules-equiv)))
     :rule-classes :congruence)

    Theorem: at-most-one-parse-tree-set-of-string

    (defthm at-most-one-parse-tree-set-of-string
      (implies
           (and (tree-setp trees1)
                (tree-setp trees2)
                (parse-trees-of-string-p trees1 string rulename rules)
                (parse-trees-of-string-p trees2 string rulename rules))
           (equal trees1 trees2))
      :rule-classes nil)

    Theorem: parse-trees-of-string-p-when-not-string-parsablep

    (defthm parse-trees-of-string-p-when-not-string-parsablep
      (implies
           (and (not (string-parsablep string rulename rules))
                (tree-setp trees))
           (equal (parse-trees-of-string-p trees string rulename rules)
                  (equal trees nil))))

    Theorem: not-string-parsablep-when-parse-trees-of-string-p-of-nil

    (defthm not-string-parsablep-when-parse-trees-of-string-p-of-nil
      (implies (parse-trees-of-string-p nil string rulename rules)
               (not (string-parsablep string rulename rules))))

    Theorem: parse-trees-of-string-p-when-string-unambiguousp

    (defthm parse-trees-of-string-p-when-string-unambiguousp
     (implies
      (and (string-unambiguousp string rulename rules)
           (tree-setp trees))
      (equal
         (parse-trees-of-string-p trees string rulename rules)
         (equal trees
                (insert (string-parsablep-witness string rulename rules)
                        nil)))))

    Theorem: string-unambiguousp-when-parse-trees-of-string-p-of-one

    (defthm string-unambiguousp-when-parse-trees-of-string-p-of-one
      (implies (and (parse-trees-of-string-p (insert tree nil)
                                             string rulename rules)
                    (treep tree))
               (string-unambiguousp string rulename rules)))