• 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
        • Riscv
        • Instant-runoff-voting
        • Imp-language
        • Sidekick
        • Leftist-trees
        • Java
        • Taspi
        • Bitcoin
        • 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
        • Aleo
        • Bigmems
        • Builtins
        • Execloader
        • Solidity
        • Paco
        • Concurrent-programs
        • Bls12-377-curves
      • Debugging
      • Std
      • Community
      • Proof-automation
      • Macro-libraries
      • ACL2
      • Interfacing-tools
      • Hardware-verification
      • Software-verification
      • Math
      • Testing-utilities
    • Semantics

    Tree-match-char-val-p

    Semantics of character value notations.

    Signature
    (tree-match-char-val-p tree char-val) → yes/no
    Arguments
    tree — Guard (treep tree).
    char-val — Guard (char-val-p char-val).
    Returns
    yes/no — Type (booleanp yes/no).

    A tree matches a character value notation iff the tree is a leaf consisting of a list of natural numbers that match the corresponding characters, case-sensitively or case-insensitively (depending on the kind of character value notation).

    Definitions and Theorems

    Function: tree-match-char-val-p

    (defun tree-match-char-val-p (tree char-val)
     (declare (xargs :guard (and (treep tree)
                                 (char-val-p char-val))))
     (and
      (tree-case tree :leafterm)
      (let ((nats (tree-leafterm->get tree)))
       (char-val-case
        char-val
        :sensitive
        (nats-match-sensitive-chars-p nats (explode char-val.get))
        :insensitive
        (nats-match-insensitive-chars-p nats (explode char-val.get))))))

    Theorem: booleanp-of-tree-match-char-val-p

    (defthm booleanp-of-tree-match-char-val-p
      (b* ((yes/no (tree-match-char-val-p tree char-val)))
        (booleanp yes/no))
      :rule-classes :rewrite)

    Theorem: tree-match-char-val-p-of-tree-fix-tree

    (defthm tree-match-char-val-p-of-tree-fix-tree
      (equal (tree-match-char-val-p (tree-fix tree)
                                    char-val)
             (tree-match-char-val-p tree char-val)))

    Theorem: tree-match-char-val-p-tree-equiv-congruence-on-tree

    (defthm tree-match-char-val-p-tree-equiv-congruence-on-tree
      (implies (tree-equiv tree tree-equiv)
               (equal (tree-match-char-val-p tree char-val)
                      (tree-match-char-val-p tree-equiv char-val)))
      :rule-classes :congruence)

    Theorem: tree-match-char-val-p-of-char-val-fix-char-val

    (defthm tree-match-char-val-p-of-char-val-fix-char-val
      (equal (tree-match-char-val-p tree (char-val-fix char-val))
             (tree-match-char-val-p tree char-val)))

    Theorem: tree-match-char-val-p-char-val-equiv-congruence-on-char-val

    (defthm tree-match-char-val-p-char-val-equiv-congruence-on-char-val
      (implies (char-val-equiv char-val char-val-equiv)
               (equal (tree-match-char-val-p tree char-val)
                      (tree-match-char-val-p tree char-val-equiv)))
      :rule-classes :congruence)