• 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
        • 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
    • Semantics

    String-unambiguousp

    Notion of unambiguous string.

    Signature
    (string-unambiguousp string rulename rules) → yes/no
    Arguments
    string — Guard (stringp string).
    rulename — Guard (rulenamep rulename).
    rules — Guard (rulelistp rules).
    Returns
    yes/no — Type (booleanp yes/no).

    A string is unambiguous iff it has exactly one parse tree.

    Definitions and Theorems

    Function: string-unambiguousp

    (defun string-unambiguousp (string rulename rules)
      (declare (xargs :guard (and (stringp string)
                                  (rulenamep rulename)
                                  (rulelistp rules))))
      (and (string-parsablep string rulename rules)
           (not (string-ambiguousp string rulename rules))))

    Theorem: booleanp-of-string-unambiguousp

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

    Theorem: parse-treep-when-string-unambiguousp

    (defthm parse-treep-when-string-unambiguousp
     (implies
      (string-unambiguousp string rulename rules)
      (equal (parse-treep tree string rulename rules)
             (equal tree
                    (string-parsablep-witness string rulename rules)))))

    Theorem: treep-of-string-parsablep-witness-when-string-unambiguousp

    (defthm treep-of-string-parsablep-witness-when-string-unambiguousp
     (implies (string-unambiguousp string rulename rules)
              (treep (string-parsablep-witness string rulename rules))))

    Theorem: string-unambiguousp-of-string-fix-string

    (defthm string-unambiguousp-of-string-fix-string
      (equal (string-unambiguousp (string-fix string)
                                  rulename rules)
             (string-unambiguousp string rulename rules)))

    Theorem: string-unambiguousp-string-equiv-congruence-on-string

    (defthm string-unambiguousp-string-equiv-congruence-on-string
     (implies (string-equiv string string-equiv)
              (equal (string-unambiguousp string rulename rules)
                     (string-unambiguousp string-equiv rulename rules)))
     :rule-classes :congruence)

    Theorem: string-unambiguousp-of-rulename-fix-rulename

    (defthm string-unambiguousp-of-rulename-fix-rulename
      (equal (string-unambiguousp string (rulename-fix rulename)
                                  rules)
             (string-unambiguousp string rulename rules)))

    Theorem: string-unambiguousp-rulename-equiv-congruence-on-rulename

    (defthm string-unambiguousp-rulename-equiv-congruence-on-rulename
     (implies (rulename-equiv rulename rulename-equiv)
              (equal (string-unambiguousp string rulename rules)
                     (string-unambiguousp string rulename-equiv rules)))
     :rule-classes :congruence)

    Theorem: string-unambiguousp-of-rulelist-fix-rules

    (defthm string-unambiguousp-of-rulelist-fix-rules
      (equal (string-unambiguousp string rulename (rulelist-fix rules))
             (string-unambiguousp string rulename rules)))

    Theorem: string-unambiguousp-rulelist-equiv-congruence-on-rules

    (defthm string-unambiguousp-rulelist-equiv-congruence-on-rules
     (implies (rulelist-equiv rules rules-equiv)
              (equal (string-unambiguousp string rulename rules)
                     (string-unambiguousp string rulename rules-equiv)))
     :rule-classes :congruence)