• 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
        • Error-checking
        • Fty-extensions
        • Isar
        • Kestrel-utilities
        • Set
        • C
          • Syntax-for-tools
          • Atc
          • Transformation-tools
            • Simpadd0
            • Proof-generation
              • Xeq-fundef
              • Xeq-expr-binary
              • Xeq-block-item-list-cons
              • Xeq-stmt-ifelse
              • Xeq-expr-cond
              • Xeq-expr-const
              • Gen-param-thms
              • Gen-expr-thm
              • Gen-from-params
              • Xeq-decl-decl
              • Xeq-expr-unary
              • Xeq-stmt-dowhile
              • Xeq-expr-cast
              • Lift-expr-pure-thm
              • Xeq-stmt-while
              • Gout
              • Gen-block-item-list-thm
              • Xeq-stmt-if
              • Gin
              • Xeq-expr-ident
              • Gen-expr-pure-thm
              • Gen-block-item-thm
              • Xeq-stmt-expr
              • Gen-initer-single-thm
              • Gen-init-scope-thm
              • Xeq-stmt-return
              • Gen-decl-thm
              • Gen-stmt-thm
              • Xeq-block-item-decl
              • Xeq-initer-single
              • Xeq-block-item-stmt
              • Xeq-stmt-compound
              • Gen-thm-name
              • Gin-update
              • Gen-var-assertions
                • Tyspecseq-to-type
                • Xeq-block-item-list-empty
                • Gout-no-thm
                • Irr-gout
              • Split-gso
              • Wrap-fn
              • Constant-propagation
              • Specialize
              • Split-fn
              • Split-fn-when
              • Split-all-gso
              • Copy-fn
              • Variables-in-computation-states
              • Rename
              • Utilities
              • Proof-generation-theorems
              • Input-processing
            • Language
            • Representation
            • Insertion-sort
            • Pack
          • 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
    • Proof-generation

    Gen-var-assertions

    Generate assertions about certain variables having values of certain types in a computation state.

    Signature
    (gen-var-assertions vartys compst) → assertions
    Arguments
    vartys — Guard (c::ident-type-mapp vartys).
    compst — An untranslated term.
    Returns
    assertions — Type (true-listp assertions).

    The variables and their types are in the vartys map. For each variable in the map, we generate an assertion saying that the variable can be read from the computation state and it contains a value of the associated type.

    The input compst is the (untranslated) term to use for the computation state (often just a variable).

    Definitions and Theorems

    Function: gen-var-assertions

    (defun gen-var-assertions (vartys compst)
      (declare (xargs :guard (c::ident-type-mapp vartys)))
      (let ((__function__ 'gen-var-assertions))
        (declare (ignorable __function__))
        (b* (((when (omap::emptyp (c::ident-type-map-fix vartys)))
              nil)
             ((mv var type) (omap::head vartys))
             (asrt (cons 'c::compustate-has-var-with-type-p
                         (cons (cons 'quote (cons var 'nil))
                               (cons (cons 'quote (cons type 'nil))
                                     (cons compst 'nil)))))
             (asrts (gen-var-assertions (omap::tail vartys)
                                        compst)))
          (cons asrt asrts))))

    Theorem: true-listp-of-gen-var-assertions

    (defthm true-listp-of-gen-var-assertions
      (b* ((assertions (gen-var-assertions vartys compst)))
        (true-listp assertions))
      :rule-classes :rewrite)

    Theorem: gen-var-assertions-of-ident-type-map-fix-vartys

    (defthm gen-var-assertions-of-ident-type-map-fix-vartys
      (equal (gen-var-assertions (c::ident-type-map-fix vartys)
                                 compst)
             (gen-var-assertions vartys compst)))

    Theorem: gen-var-assertions-ident-type-map-equiv-congruence-on-vartys

    (defthm gen-var-assertions-ident-type-map-equiv-congruence-on-vartys
      (implies (c::ident-type-map-equiv vartys vartys-equiv)
               (equal (gen-var-assertions vartys compst)
                      (gen-var-assertions vartys-equiv compst)))
      :rule-classes :congruence)