• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Std
    • Community
    • Proof-automation
    • ACL2
    • Macro-libraries
    • Interfacing-tools
    • Hardware-verification
    • Software-verification
      • Kestrel-books
        • Crypto-hdwallet
        • Apt
        • Error-checking
        • Fty-extensions
        • Isar
        • Kestrel-utilities
        • Set
        • Soft
        • C
          • Syntax-for-tools
          • Atc
          • Language
          • Representation
          • Transformation-tools
            • Simpadd0
              • Simpadd0-implementation
                • Simpadd0-event-generation
                  • Simpadd0-exprs/decls/stmts
                  • Simpadd0-fundef
                  • Simpadd0-expr-cond
                  • Simpadd0-expr-binary
                  • Simpadd0-gen-expr-pure-thm
                  • Simpadd0-gen-block-item-list-thm
                  • Simpadd0-expr-cast
                  • Simpadd0-block-item-stmt
                  • Simpadd0-block-item-list-one
                  • Simpadd0-gen-expr-asg-thm
                  • Simpadd0-gen-block-item-thm
                  • Simpadd0-gen-stmt-thm
                  • Simpadd0-stmt-return
                  • Simpadd0-stmt-expr
                  • Simpadd0-gen-from-params
                  • Simpadd0-expr-unary
                  • Simpadd0-gout
                  • Simpadd0-expr-const
                  • Simpadd0-gen-param-thms
                  • Simpadd0-expr-ident
                  • Simpadd0-gen-init-scope-thm
                    • Simpadd0-gin
                    • Simpadd0-expr-paren
                    • Simpadd0-filepath-transunit-map
                    • Simpadd0-extdecl-list
                    • Simpadd0-extdecl
                    • Simpadd0-transunit-ensemble
                    • Simpadd0-transunit
                    • Simpadd0-gen-var-hyps
                    • Simpadd0-tyspecseq-to-type
                    • Simpadd0-gin-update
                    • Simpadd0-gen-everything
                    • Irr-simpadd0-gout
                  • Simpadd0-process-inputs-and-gen-everything
                  • Simpadd0-fn
                  • Simpadd0-input-processing
                  • Simpadd0-macro-definition
                • Simpadd0-expr-option
                • Simpadd0-structdeclor-list
                • Simpadd0-structdecl-list
                • Simpadd0-spec/qual-list
                • Simpadd0-param-declon-list
                • Simpadd0-initdeclor-list
                • Simpadd0-dirabsdeclor-option
                • Simpadd0-dirabsdeclor
                • Simpadd0-desiniter-list
                • Simpadd0-absdeclor-option
                • Simpadd0-struni-spec
                • Simpadd0-structdeclor
                • Simpadd0-structdecl
                • Simpadd0-statassert
                • Simpadd0-spec/qual
                • Simpadd0-param-declor
                • Simpadd0-param-declon
                • Simpadd0-member-designor
                • Simpadd0-initer-option
                • Simpadd0-initdeclor
                • Simpadd0-genassoc-list
                • Simpadd0-genassoc
                • Simpadd0-expr
                • Simpadd0-enumspec
                • Simpadd0-enumer-list
                • Simpadd0-dirdeclor
                • Simpadd0-desiniter
                • Simpadd0-designor-list
                • Simpadd0-designor
                • Simpadd0-declor-option
                • Simpadd0-decl-spec-list
                • Simpadd0-decl-spec
                • Simpadd0-decl-list
                • Simpadd0-const-expr-option
                • Simpadd0-const-expr
                • Simpadd0-block-item-list
                • Simpadd0-align-spec
                • Simpadd0-absdeclor
                • Simpadd0-type-spec
                • Simpadd0-tyname
                • Simpadd0-stmt
                • Simpadd0-label
                • Simpadd0-initer
                • Simpadd0-expr-list
                • Simpadd0-enumer
                • Simpadd0-declor
                • Simpadd0-decl
                • Simpadd0-block-item
              • Splitgso
              • Constant-propagation
              • Split-fn
              • Specialize
              • Split-all-gso
              • Copy-fn
              • Rename
              • Utilities
            • Insertion-sort
            • Pack
          • Bv
          • Imp-language
          • Event-macros
          • Java
          • Riscv
          • 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
    • Simpadd0-event-generation

    Simpadd0-gen-init-scope-thm

    Generate a theorem about the initial scope of a function.

    Signature
    (simpadd0-gen-init-scope-thm params args parargs arg-types) 
      → 
    (mv thm-event thm-name)
    Arguments
    params — Guard (c::param-declon-listp params).
    args — Guard (symbol-listp args).
    parargs — A term.
    arg-types — Guard (true-listp arg-types).
    Returns
    thm-event — Type (pseudo-event-formp thm-event).
    thm-name — Type (symbolp thm-name).

    The args, parargs, and arg-types inputs are the corresponding outputs of simpadd0-gen-from-params.

    The theorem says that, given values of certain types for the arguments, c::init-scope applied to the list of parameter declarations and to the list of parameter values yields an omap (which we express as an omap::update nest) that associates parameter name and argument value.

    The name of the theorem is used locally to another theorem, so it does not have to be particularly distinguished. But we should check and disambiguate this more thoroughly.

    Definitions and Theorems

    Function: simpadd0-gen-init-scope-thm

    (defun simpadd0-gen-init-scope-thm (params args parargs arg-types)
     (declare (xargs :guard (and (c::param-declon-listp params)
                                 (symbol-listp args)
                                 (true-listp arg-types))))
     (let ((__function__ 'simpadd0-gen-init-scope-thm))
      (declare (ignorable __function__))
      (b*
       ((formula
         (cons
          'implies
          (cons
           (cons 'and arg-types)
           (cons
                (cons 'equal
                      (cons (cons 'c::init-scope
                                  (cons (cons 'quote (cons params 'nil))
                                        (cons (cons 'list args) 'nil)))
                            (cons parargs 'nil)))
                'nil))))
        (hints
         '(("Goal"
            :in-theory '(omap::assoc-when-emptyp
                             (:e omap::emptyp)
                             omap::assoc-of-update c::init-scope
                             c::not-flexible-array-member-p-when-ucharp
                             c::not-flexible-array-member-p-when-scharp
                             c::not-flexible-array-member-p-when-ushortp
                             c::not-flexible-array-member-p-when-sshortp
                             c::not-flexible-array-member-p-when-uintp
                             c::not-flexible-array-member-p-when-sintp
                             c::not-flexible-array-member-p-when-ulongp
                             c::not-flexible-array-member-p-when-slongp
                             c::not-flexible-array-member-p-when-ullongp
                             c::not-flexible-array-member-p-when-sllongp
                             c::remove-flexible-array-member-when-absent
                             c::ucharp-alt-def c::scharp-alt-def
                             c::ushortp-alt-def c::sshortp-alt-def
                             c::uintp-alt-def c::sintp-alt-def
                             c::ulongp-alt-def c::slongp-alt-def
                             c::ullongp-alt-def c::sllongp-alt-def
                             c::type-of-value-when-ucharp
                             c::type-of-value-when-scharp
                             c::type-of-value-when-ushortp
                             c::type-of-value-when-sshortp
                             c::type-of-value-when-uintp
                             c::type-of-value-when-sintp
                             c::type-of-value-when-ulongp
                             c::type-of-value-when-slongp
                             c::type-of-value-when-ullongp
                             c::type-of-value-when-sllongp
                             c::value-fix-when-valuep
                             c::value-list-fix-of-cons
                             c::type-of-value
                             c::type-array c::type-pointer
                             c::type-struct (:e c::adjust-type)
                             (:e c::apconvert-type)
                             (:e c::ident)
                             (:e c::param-declon-list-fix$inline)
                             (:e c::param-declon-to-ident+tyname)
                             (:e c::tyname-to-type)
                             (:e c::type-uchar)
                             (:e c::type-schar)
                             (:e c::type-ushort)
                             (:e c::type-sshort)
                             (:e c::type-uint)
                             (:e c::type-sint)
                             (:e c::type-ulong)
                             (:e c::type-slong)
                             (:e c::type-ullong)
                             (:e c::type-sllong)
                             (:e c::value-list-fix$inline)
                             mv-nth car-cons cdr-cons (:e <<)
                             lemma1 lemma2))))
        (thm-name 'init-scope-thm)
        (thm-event
         (cons
          'defruled
          (cons
           thm-name
           (cons
            formula
            (cons
             ':hints
             (cons hints
                   '(:prep-lemmas
                         ((defruled lemma1 (not (c::errorp nil)))
                          (defruled lemma2
                            (not (c::errorp (omap::update key val map)))
                            :enable (c::errorp omap::update)))))))))))
       (mv thm-event thm-name))))

    Theorem: pseudo-event-formp-of-simpadd0-gen-init-scope-thm.thm-event

    (defthm pseudo-event-formp-of-simpadd0-gen-init-scope-thm.thm-event
     (b* (((mv ?thm-event ?thm-name)
           (simpadd0-gen-init-scope-thm params args parargs arg-types)))
       (pseudo-event-formp thm-event))
     :rule-classes :rewrite)

    Theorem: symbolp-of-simpadd0-gen-init-scope-thm.thm-name

    (defthm symbolp-of-simpadd0-gen-init-scope-thm.thm-name
     (b* (((mv ?thm-event ?thm-name)
           (simpadd0-gen-init-scope-thm params args parargs arg-types)))
       (symbolp thm-name))
     :rule-classes :rewrite)