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

    Numrep-match-repeat-range-p

    Semantics of repetition ranges.

    Signature
    (numrep-match-repeat-range-p numrep range) → yes/no
    Arguments
    numrep — Guard (natp numrep).
    range — Guard (repeat-rangep range).
    Returns
    yes/no — Type (booleanp yes/no).

    A number of repetitions (a natural number) matches a repetition range iff it is between the range's minimum and the range's maximum.

    Definitions and Theorems

    Function: numrep-match-repeat-range-p

    (defun numrep-match-repeat-range-p (numrep range)
      (declare (xargs :guard (and (natp numrep)
                                  (repeat-rangep range))))
      (b* ((numrep (mbe :logic (nfix numrep) :exec numrep))
           (min (repeat-range->min range))
           (max (repeat-range->max range)))
        (and (<= min numrep)
             (or (nati-case max :infinity)
                 (<= numrep (nati-finite->get max))))))

    Theorem: booleanp-of-numrep-match-repeat-range-p

    (defthm booleanp-of-numrep-match-repeat-range-p
      (b* ((yes/no (numrep-match-repeat-range-p numrep range)))
        (booleanp yes/no))
      :rule-classes :rewrite)

    Theorem: 0-when-match-repeat-range-0

    (defthm 0-when-match-repeat-range-0
      (implies (equal range (repeat-range 0 (nati-finite 0)))
               (equal (numrep-match-repeat-range-p n range)
                      (equal (nfix n) 0))))

    Theorem: numrep-match-repeat-range-p-of-nfix-numrep

    (defthm numrep-match-repeat-range-p-of-nfix-numrep
      (equal (numrep-match-repeat-range-p (nfix numrep)
                                          range)
             (numrep-match-repeat-range-p numrep range)))

    Theorem: numrep-match-repeat-range-p-nat-equiv-congruence-on-numrep

    (defthm numrep-match-repeat-range-p-nat-equiv-congruence-on-numrep
      (implies (acl2::nat-equiv numrep numrep-equiv)
               (equal (numrep-match-repeat-range-p numrep range)
                      (numrep-match-repeat-range-p numrep-equiv range)))
      :rule-classes :congruence)

    Theorem: numrep-match-repeat-range-p-of-repeat-range-fix-range

    (defthm numrep-match-repeat-range-p-of-repeat-range-fix-range
      (equal
           (numrep-match-repeat-range-p numrep (repeat-range-fix range))
           (numrep-match-repeat-range-p numrep range)))

    Theorem: numrep-match-repeat-range-p-repeat-range-equiv-congruence-on-range

    (defthm
     numrep-match-repeat-range-p-repeat-range-equiv-congruence-on-range
     (implies (repeat-range-equiv range range-equiv)
              (equal (numrep-match-repeat-range-p numrep range)
                     (numrep-match-repeat-range-p numrep range-equiv)))
     :rule-classes :congruence)