• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Community
    • Std
    • Proof-automation
    • Macro-libraries
    • ACL2
    • Interfacing-tools
    • Hardware-verification
    • Software-verification
      • Kestrel-books
        • Crypto-hdwallet
        • Apt
          • Isodata
          • Simplify-defun
          • Tailrec
          • Schemalg
          • Restrict
          • Expdata
          • Casesplit
          • Simplify-term
          • Simplify-defun-sk
          • Parteval
          • Solve
          • Wrap-output
          • Propagate-iso
          • Simplify
          • Finite-difference
          • Drop-irrelevant-params
          • Copy-function
          • Lift-iso
          • Rename-params
          • Utilities
            • Defaults-table
            • Xdoc::apt-constructors
            • Input-processors
            • Transformation-table
            • Find-base-cases
            • Untranslate-specifier-utilities
            • Print-specifier-utilities
              • Ensure-is-print-specifier
                • Ensure-is-print-specifier$
              • Print-specifier-p
            • Hints-specifier-utilities
          • Simplify-term-programmatic
          • Simplify-defun-sk-programmatic
          • Simplify-defun-programmatic
          • Simplify-defun+
          • Common-options
          • Common-concepts
        • Error-checking
        • Fty-extensions
        • Isar
        • Kestrel-utilities
        • Set
        • C
        • Soft
        • Bv
        • Imp-language
        • Ethereum
        • Event-macros
        • Java
        • Riscv
        • Bitcoin
        • Zcash
        • Yul
        • ACL2-programming-language
        • Prime-fields
        • Json
        • Syntheto
        • File-io-light
        • Cryptography
        • Number-theory
        • Axe
        • Lists-light
        • Builtins
        • Solidity
        • Helpers
        • Htclient
        • Typed-lists-light
        • Arithmetic-light
      • X86isa
      • Axe
      • Execloader
    • Math
    • Testing-utilities
  • Print-specifier-utilities

Ensure-is-print-specifier

Cause an error if a value is not a print specifier.

Signature
(ensure-is-print-specifier x description 
                           error-erp error-val ctx state) 
 
  → 
(mv erp val state)
Arguments
x — Value to check.
description — Guard (msgp description).
error-erp — Flag to return in case of error.
error-val — Value to return in case of error.
ctx — Context for errors.
Returns
erp — Type (implies erp (equal erp error-erp)).
val — Type (and (implies erp (equal val error-val)) (implies (and (not erp) error-erp) (not val))) .

Definitions and Theorems

Function: ensure-is-print-specifier

(defun ensure-is-print-specifier (x description
                                    error-erp error-val ctx state)
 (declare (xargs :stobjs (state)))
 (declare (xargs :guard (msgp description)))
 (b*
  (((unless (print-specifier-p x))
    (er-soft+
     ctx error-erp error-val
     "~@0 must be a print specifier.  See :DOC APT::PRINT-SPECIFIER."
     description)))
  (value nil)))

Theorem: return-type-of-ensure-is-print-specifier.erp

(defthm return-type-of-ensure-is-print-specifier.erp
  (b* (((mv ?erp ?val acl2::?state)
        (ensure-is-print-specifier x description
                                   error-erp error-val ctx state)))
    (implies erp (equal erp error-erp)))
  :rule-classes :rewrite)

Theorem: return-type-of-ensure-is-print-specifier.val

(defthm return-type-of-ensure-is-print-specifier.val
  (b* (((mv ?erp ?val acl2::?state)
        (ensure-is-print-specifier x description
                                   error-erp error-val ctx state)))
    (and (implies erp (equal val error-val))
         (implies (and (not erp) error-erp)
                  (not val))))
  :rule-classes :rewrite)

Subtopics

Ensure-is-print-specifier$
Calls ensure-is-print-specifier with ctx and state as the last two arguments.