• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
      • Apt
      • Zfc
      • Acre
      • Milawa
      • Smtlink
      • Abnf
        • Deftreeops
        • Defdefparse
        • Defgrammar
        • Tree-utilities
        • Notation
          • Syntax-abstraction
          • Semantics
          • Abstract-syntax
            • Convenience-constructors
              • /_
              • %x-
                • %d-
                • %b-
                • =_
                • =/_
                • Def-rule-const
                • =_-fn
                • =/_-fn
                • Repetition/element/rulename/charstring-p
                • <>
                • %x.
                • %d.
                • %b.
                • Repetition/element/rulename/charstring-listp
                • ?_
                • !_
                • Def-rule-const-fn
                • *_
                • 1*_
                • ?_-fn
                • /_-fn
                • !_-fn
                • Element/rulename-p
                • %x.-fn
                • %d.-fn
                • %b.-fn
              • Num-val
              • Char-val
              • Repeat-range
              • Rulename
              • Rule
              • Rulename-option
              • Num-base
              • Rule-option
              • Prose-val
              • Rulelist
              • Char-val-set
              • Rulename-set
              • Rulename-list
              • Grammar
              • Alt/conc/rep/elem
            • 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
    • Convenience-constructors

    %x-

    Construct a hexadecimal-base range numeric value notation element from a minimum and a maximum.

    Signature
    (%x- min max) → element
    Arguments
    min — Guard (natp min).
    max — Guard (natp max).
    Returns
    element — Type (elementp element).

    The name of this function is inspired by the ABNF notation %x<min>-<max>, where <min> and <max> are numbers in base 16: the name of this function has the %x and the - of that notation.

    Definitions and Theorems

    Function: %x-

    (defun %x- (min max)
      (declare (xargs :guard (and (natp min) (natp max))))
      (element-num-val (num-val-range (num-base-hex) min max)))

    Theorem: elementp-of-%x-

    (defthm elementp-of-%x-
      (b* ((element (%x- min max)))
        (elementp element))
      :rule-classes :rewrite)

    Theorem: %x--of-nfix-min

    (defthm %x--of-nfix-min
      (equal (%x- (nfix min) max)
             (%x- min max)))

    Theorem: %x--nat-equiv-congruence-on-min

    (defthm %x--nat-equiv-congruence-on-min
      (implies (acl2::nat-equiv min min-equiv)
               (equal (%x- min max)
                      (%x- min-equiv max)))
      :rule-classes :congruence)

    Theorem: %x--of-nfix-max

    (defthm %x--of-nfix-max
      (equal (%x- min (nfix max))
             (%x- min max)))

    Theorem: %x--nat-equiv-congruence-on-max

    (defthm %x--nat-equiv-congruence-on-max
      (implies (acl2::nat-equiv max max-equiv)
               (equal (%x- min max)
                      (%x- min max-equiv)))
      :rule-classes :congruence)