• 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-alpha

    An ALPHA parse tree is abstracted to its corresponding letter.

    Signature
    (abstract-alpha tree) → letter
    Arguments
    tree — Guard (treep tree).
    Returns
    letter — Type (characterp letter).

    Definitions and Theorems

    Function: abstract-alpha

    (defun abstract-alpha (tree)
      (declare (xargs :guard (treep tree)))
      (b* (((fun (fail))
            (prog2$ (abstract-fail) (code-char 0)))
           ((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))
           (nat (abstract-terminal subtree))
           ((unless (< nat 256)) (fail)))
        (code-char nat)))

    Theorem: characterp-of-abstract-alpha

    (defthm characterp-of-abstract-alpha
      (b* ((letter (abstract-alpha tree)))
        (characterp letter))
      :rule-classes :rewrite)