• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
      • Apt
      • Zfc
      • Acre
        • Acre-internals
          • Regex
          • Match-string-at
          • Matchstatelist-measure
          • Parse-primitive
          • Matches-remove-zero-length
          • Parse-repeatop
          • Parse-repeatbase
          • Matchstatelist-in-bounds
          • Parse-range
          • Parse-charset-set
          • Parse-charset-atom
          • Match-regex-locs
          • Parse-octal-charcode
          • Parse-k-backref
          • Parse-g-backref
          • Matchstatelist-all-have-backref
          • Parse-repeatmod
          • Parse-charset-elem
          • Parse-charset-aux
          • Parse-hex-charcode
          • Parse-charset
          • Matchstatelist-indices-lte
          • Matchstatelist-indices-gte
          • Match-exact
          • Matches-add-backref
          • Matchresult
          • Preproc-legible-aux
          • Maybe-backref
          • Match-charset
            • Undup-equiv
            • Find-substr
            • Maybe-backref-extract-substr
            • Matchstatelist-min-index
            • Matchstate-in-bounds
            • Match-add-backref
            • Undup
            • Backref-alist-in-bounds
            • Backref
            • Matchstate
            • Matchresult->matched-substr
            • Matchresult->captured-substr!
            • Matchresult->captured-substr
            • Maybe-backref-in-bounds
            • Matchmode
            • Backref-extract-substr
            • Charset-range
            • Matchstate-measure
            • Backref-in-bounds
            • Rev-keys
            • Parse-regex
            • Undup-exec
            • Get-charset
            • Regex-concat2
            • Preproc-legible
            • Matchresult-in-bounds
            • Regex-disjunct2
            • Backref-alist
            • Named-captures-bindings
            • Captures-bindings
            • Matchstatelist
            • Charset-char-regex
            • Repeatmod-p
          • Parse-and-match-regex
          • Match-regex
          • Parse
          • Matchresult->matchedp
          • Match
        • Milawa
        • Smtlink
        • Abnf
        • 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
    • Acre-internals

    Match-charset

    Signature
    (match-charset set set-index char mode) → *
    Arguments
    set — Guard (stringp set).
    set-index — Guard (natp set-index).
    char — Guard (characterp char).
    mode — Guard (matchmode-p mode).

    Definitions and Theorems

    Function: match-charset

    (defun match-charset (set set-index char mode)
     (declare (xargs :guard (and (stringp set)
                                 (natp set-index)
                                 (characterp char)
                                 (matchmode-p mode))))
     (declare (xargs :guard (<= set-index (strlen set))))
     (let ((__function__ 'match-charset))
       (declare (ignorable __function__))
       (b*
        ((set (lstrfix set))
         (set-index (lnfix set-index))
         ((matchmode mode))
         (char (mbe :logic (acl2::char-fix char)
                    :exec char))
         ((when (mbe :logic (zp (- (strlen set) set-index))
                     :exec (eql set-index (strlen set))))
          nil)
         ((when (if mode.case-insens (str::ichareqv (char set set-index)
                                                    char)
                  (eql (char set set-index) char)))
          t))
        (match-charset set (1+ set-index)
                       char mode))))

    Theorem: match-charset-of-str-fix-set

    (defthm match-charset-of-str-fix-set
      (equal (match-charset (acl2::str-fix set)
                            set-index char mode)
             (match-charset set set-index char mode)))

    Theorem: match-charset-streqv-congruence-on-set

    (defthm match-charset-streqv-congruence-on-set
      (implies (acl2::streqv set set-equiv)
               (equal (match-charset set set-index char mode)
                      (match-charset set-equiv set-index char mode)))
      :rule-classes :congruence)

    Theorem: match-charset-of-nfix-set-index

    (defthm match-charset-of-nfix-set-index
      (equal (match-charset set (nfix set-index)
                            char mode)
             (match-charset set set-index char mode)))

    Theorem: match-charset-nat-equiv-congruence-on-set-index

    (defthm match-charset-nat-equiv-congruence-on-set-index
      (implies (acl2::nat-equiv set-index set-index-equiv)
               (equal (match-charset set set-index char mode)
                      (match-charset set set-index-equiv char mode)))
      :rule-classes :congruence)

    Theorem: match-charset-of-char-fix-char

    (defthm match-charset-of-char-fix-char
      (equal (match-charset set set-index (acl2::char-fix char)
                            mode)
             (match-charset set set-index char mode)))

    Theorem: match-charset-chareqv-congruence-on-char

    (defthm match-charset-chareqv-congruence-on-char
      (implies (acl2::chareqv char char-equiv)
               (equal (match-charset set set-index char mode)
                      (match-charset set set-index char-equiv mode)))
      :rule-classes :congruence)

    Theorem: match-charset-of-matchmode-fix-mode

    (defthm match-charset-of-matchmode-fix-mode
      (equal (match-charset set set-index char (matchmode-fix mode))
             (match-charset set set-index char mode)))

    Theorem: match-charset-matchmode-equiv-congruence-on-mode

    (defthm match-charset-matchmode-equiv-congruence-on-mode
      (implies (matchmode-equiv mode mode-equiv)
               (equal (match-charset set set-index char mode)
                      (match-charset set set-index char mode-equiv)))
      :rule-classes :congruence)