• 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
        • Riscv
        • 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
      • ACL2
      • Macro-libraries
      • Interfacing-tools
      • Hardware-verification
      • Software-verification
      • Math
      • Testing-utilities
    • Semantics

    Tree-match-num-val-p

    Semantics of numeric value notations.

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

    A tree matches a numeric value notation iff one of the following conditions holds:

    • The numeric value notation is a list of natural numbers, and the tree is a leaf consisting of exactly that list of natural numbers.
    • The numeric value notation is a range of natural numbers, and the tree is a leaf consisting of one natural number in that range. (Note that no tree matches a range whose minimum exceeds the maximum.)

    Definitions and Theorems

    Function: tree-match-num-val-p

    (defun tree-match-num-val-p (tree num-val)
      (declare (xargs :guard (and (treep tree) (num-val-p num-val))))
      (and (tree-case tree :leafterm)
           (let ((nats (tree-leafterm->get tree)))
             (num-val-case num-val
                           :direct (equal nats num-val.get)
                           :range (and (= (len nats) 1)
                                       (<= num-val.min (car nats))
                                       (<= (car nats) num-val.max))))))

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

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

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

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

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

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

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

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

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

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