• 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
            • Rulelist-incremental-ok-p
            • Num-val-wfp
              • Char-val-wfp
              • Prose-val-wfp
              • Rulename-wfp
              • Rulelist-wfp
              • Repeat-range-wfp
              • Rule-list-wfp
              • Concatenation-wfp
              • Alternation-wfp
              • Rule-wfp
              • Concatenation-list-wfp
              • Repetition-list-wfp
              • Repetition-wfp
              • Element-wfp
            • Closure
            • Plugging
            • Ambiguity
            • 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
    • Well-formedness

    Num-val-wfp

    A direct numeric value notation is well-formed iff it consists of at least one number; a range numeric value notation is well-formed iff the minimum does not exceed the maximum.

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

    The condition on direct numeric value notations is required by the rules bin-val, dec-val, and hex-val in [RFC:4]. The condition on range numeric value notations is reasonably justifiable because no number exists in a range whose minimum exceeds the maximum; formally, no tree matches a malformed range numeric value notation.

    Definitions and Theorems

    Function: num-val-wfp

    (defun num-val-wfp (num-val)
      (declare (xargs :guard (num-val-p num-val)))
      (num-val-case num-val
                    :direct (consp num-val.get)
                    :range (<= num-val.min num-val.max)))

    Theorem: booleanp-of-num-val-wfp

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

    Theorem: justification-for-num-val-range-wfp

    (defthm justification-for-num-val-range-wfp
      (implies (and (num-val-case num-val :range)
                    (> (num-val-range->min num-val)
                       (num-val-range->max num-val)))
               (not (tree-match-num-val-p tree num-val))))