• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
      • 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
      • Zfc
      • Acre
      • Milawa
      • Smtlink
      • Abnf
      • Vwsim
      • Isar
      • Wp-gen
      • Dimacs-reader
      • Pfcs
      • Legacy-defrstobj
      • C
      • Proof-checker-array
      • Soft
      • Farray
      • Rp-rewriter
      • Instant-runoff-voting
      • Imp-language
      • Sidekick
      • Ethereum
      • Leftist-trees
      • Java
      • Riscv
      • Taspi
      • Bitcoin
      • Zcash
      • Des
      • X86isa
      • Sha-2
      • Yul
      • Proof-checker-itp13
      • Regex
      • ACL2-programming-language
      • Json
      • Jfkr
      • Equational
      • Cryptography
      • Axe
      • Poseidon
      • Where-do-i-place-my-book
      • Aleo
      • Bigmems
      • Builtins
      • Execloader
      • Solidity
      • Paco
      • Concurrent-programs
      • Bls12-377-curves
    • Debugging
    • Community
    • Std
    • Proof-automation
    • Macro-libraries
    • ACL2
    • Interfacing-tools
    • Hardware-verification
    • Software-verification
    • 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.