• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
      • Apt
      • Zfc
      • Acre
      • Milawa
      • Smtlink
      • Abnf
      • Vwsim
      • Isar
      • Wp-gen
      • Dimacs-reader
      • Pfcs
        • Proof-support
        • Abstract-syntax
          • Syntax-abstraction
            • Abs-*-decimal-digit-to-nat
            • Abs-?-expression-*-comma-expression
            • Abs-?-constraint-*-comma-constraint
            • Abs-*-letter/decimaldigit/underscore
            • Abs-letter/decimaldigit/underscore
            • Abs-?-identifier-*-comma-identifier
            • Abs-*-comma-constraint
            • Abs-definition
            • Abs-*-comma-identifier
            • Abs-*-comma-expression
            • Abs-decimal-digit-to-nat
            • Abs-*-definition
            • Abs-*-constraint
            • Abs-relation-constraint
            • Abs-decimal-digit-to-char
            • Abs-uppercase-letter
            • Abs-lowercase-letter
            • Abs-equality-constraint
            • Check-optional-minus-sign-p
            • Abs-letter
            • Abs-comma-expression
            • Abs-comma-constraint
            • Abs-integer
            • Abs-constraint
            • Abs-comma-identifier
            • Check-?-comma
            • Abs-identifier
            • Abs-system
            • Abs-numeral
              • Abs-primary-expression
              • Abs-multiplication-expression
              • Abs-addition-expression
              • Abs-expression
            • Expression
            • Definition
            • Constraint
            • Definition-option
            • Abstract-syntax-operations
            • System
            • Convenience-constructors
            • System-result
            • Expression-result
            • Expression-list-result
            • Definition-result
            • Definition-list-result
            • Constraint-result
            • Constraint-list-result
            • Expression-list
            • Definition-list
            • Constraint-list
          • R1cs-subset
          • Semantics
          • Abstract-syntax-operations
          • Indexed-names
          • Well-formedness
          • Concrete-syntax
          • R1cs-bridge
          • Parser-interface
        • 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

    Abs-numeral

    Abstract a numeral to a natural number.

    Signature
    (abs-numeral tree) → nat
    Arguments
    tree — Guard (abnf::treep tree).
    Returns
    nat — Type (nat-resultp nat).

    Definitions and Theorems

    Function: abs-numeral

    (defun abs-numeral (tree)
      (declare (xargs :guard (abnf::treep tree)))
      (let ((__function__ 'abs-numeral))
        (declare (ignorable __function__))
        (b* (((okf sub)
              (abnf::check-tree-nonleaf-1 tree "numeral"))
             ((unless (consp sub))
              (reserrf (list :empty-numeral))))
          (abs-*-decimal-digit-to-nat sub))))

    Theorem: nat-resultp-of-abs-numeral

    (defthm nat-resultp-of-abs-numeral
      (b* ((nat (abs-numeral tree)))
        (nat-resultp nat))
      :rule-classes :rewrite)

    Theorem: abs-numeral-of-tree-fix-tree

    (defthm abs-numeral-of-tree-fix-tree
      (equal (abs-numeral (abnf::tree-fix tree))
             (abs-numeral tree)))

    Theorem: abs-numeral-tree-equiv-congruence-on-tree

    (defthm abs-numeral-tree-equiv-congruence-on-tree
      (implies (abnf::tree-equiv tree tree-equiv)
               (equal (abs-numeral tree)
                      (abs-numeral tree-equiv)))
      :rule-classes :congruence)