• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
      • Apt
      • Zfc
      • Acre
      • Milawa
      • Smtlink
      • Abnf
        • Deftreeops
        • Defdefparse
        • Defgrammar
        • Tree-utilities
        • Notation
          • Syntax-abstraction
            • Abstract-repeat
            • Abstract-bin/dec/hex-val-rest-dot-p
            • Abstract-*digit-star-*digit
            • Abstract-*-grouped-terminal
            • Abstract-case-insensitive-string
            • Abstract-grouped-terminals
            • Abstract-hexdig
            • Abstract-hex-val-rest
            • Abstract-grouped-terminal
            • Abstract-dec-val-rest
            • Abstract-bin-val-rest
            • Abstract-rulename
            • Abstract-*hexdig
            • Abstract-*digit
            • Abstract-terminals
            • Abstract-terminal
            • Abstract-rule-/-*cwsp-cnl
            • Abstract-digit
            • Abstract-bin/dec/hex-val
            • Abstract-?repeat
            • Abstract-*bit
            • Abstract-rule
            • Abstract-hex-val
            • Abstract-dec-val
            • Abstract-char-val
              • Abstract-bin-val
              • Abstract-alpha/digit/dash
              • Abstract-*-rule-/-*cwsp-cnl
              • Abstract-*-alpha/digit/dash
              • Abstract-quoted-string
              • Abstract-prose-val
              • Abstract-defined-as
              • Abstract-case-sensitive-string
              • Abstract-bit
              • Abstract-*-dot-1*hexdig
              • Abstract-*-dot-1*digit
              • Abstract-*-dot-1*bit
              • Abstract-rulelist
              • Abstract-num-val
              • Abstract-element
              • Abstract-dot/dash-1*hexdig
              • Abstract-dot/dash-1*digit
              • Abstract-elements
              • Abstract-dot/dash-1*bit
              • Abstract-alpha
              • Abstract-repetition
              • Abstract-concatenation
              • Abstract-conc-rest
              • Abstract-alternation
              • Abstract-alt-rest
              • Abstract-group/option
              • Abstract-fail
              • Abstract-conc-rest-comp
              • Abstract-alt-rest-comp
            • Semantics
            • 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
        • 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
    • Syntax-abstraction

    Abstract-char-val

    A char-val parse tree is abstracted to its corresponding character value notation.

    Signature
    (abstract-char-val tree) → char-val
    Arguments
    tree — Guard (treep tree).
    Returns
    char-val — Type (char-val-p char-val).

    Definitions and Theorems

    Function: abstract-char-val

    (defun abstract-char-val (tree)
     (declare (xargs :guard (treep tree)))
     (b* (((fun (fail))
           (prog2$ (abstract-fail)
                   (char-val-sensitive "")))
          ((unless (tree-case tree :nonleaf))
           (fail))
          (treess (tree-nonleaf->branches tree))
          ((unless (consp treess)) (fail))
          (trees (car treess))
          ((unless (consp trees)) (fail))
          (subtree (car trees))
          ((unless (tree-case subtree :nonleaf))
           (fail))
          (rulename (tree-nonleaf->rulename? subtree)))
       (if (equal rulename
                  (rulename "case-sensitive-string"))
           (char-val-sensitive (abstract-case-sensitive-string subtree))
         (b* (((mv charstring iprefix)
               (abstract-case-insensitive-string subtree)))
           (char-val-insensitive iprefix charstring)))))

    Theorem: char-val-p-of-abstract-char-val

    (defthm char-val-p-of-abstract-char-val
      (b* ((char-val (abstract-char-val tree)))
        (char-val-p char-val))
      :rule-classes :rewrite)