• 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-grouped-terminals

    A ( term1 / ... / termN ) parse tree, where term1, ..., termN are terminal numeric or character value notations, is generally abstracted to its list of natural numbers.

    Signature
    (abstract-grouped-terminals tree) → nats
    Arguments
    tree — Guard (treep tree).
    Returns
    nats — Type (nat-listp nats).

    The parse tree must have a root labeled by no rule name, with a single leaf subtree labeled by a list of natural numbers. That list of natural numbers is returned.

    Definitions and Theorems

    Function: abstract-grouped-terminals

    (defun abstract-grouped-terminals (tree)
      (declare (xargs :guard (treep tree)))
      (b* (((fun (fail)) (abstract-fail))
           ((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)))
        (abstract-terminals subtree)))

    Theorem: nat-listp-of-abstract-grouped-terminals

    (defthm nat-listp-of-abstract-grouped-terminals
      (b* ((nats (abstract-grouped-terminals tree)))
        (nat-listp nats))
      :rule-classes :rewrite)