• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Std
    • Community
    • Proof-automation
    • Macro-libraries
    • ACL2
    • Interfacing-tools
    • Hardware-verification
    • Software-verification
      • Kestrel-books
        • Crypto-hdwallet
        • Apt
          • Simplify-defun
          • Isodata
          • 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
              • Ensure-is-untranslate-specifier
                • Ensure-is-untranslate-specifier$
              • Untranslate-specifier-p
              • *untranslate-specifier-keywords*
            • Print-specifier-utilities
            • 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
        • Soft
        • C
        • Bv
        • Imp-language
        • Event-macros
        • Java
        • Bitcoin
        • Ethereum
        • Yul
        • Zcash
        • ACL2-programming-language
        • Prime-fields
        • Json
        • Syntheto
        • File-io-light
        • Cryptography
        • Number-theory
        • Lists-light
        • Axe
        • Builtins
        • Solidity
        • Helpers
        • Htclient
        • Typed-lists-light
        • Arithmetic-light
      • X86isa
      • Axe
      • Execloader
    • Math
    • Testing-utilities
  • Untranslate-specifier-utilities

Ensure-is-untranslate-specifier

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

Signature
(ensure-is-untranslate-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) (untranslate-specifier-p val))) .

Definitions and Theorems

Function: ensure-is-untranslate-specifier

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

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

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

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

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

Subtopics

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