• 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
            • Atc-implementation
              • Atc-abstract-syntax
              • Atc-pretty-printer
              • Atc-event-and-code-generation
                • Atc-symbolic-computation-states
                • Atc-symbolic-execution-rules
                • Atc-gen-ext-declon-lists
                • Atc-function-and-loop-generation
                  • Atc-gen-cfun-correct-thm
                  • Atc-typed-formals
                  • Atc-gen-outer-bindings-and-hyps
                  • Atc-gen-fundef
                  • Atc-gen-exec-stmt-while-for-loop
                  • Atc-gen-context-preamble
                  • Atc-gen-pop-frame-thm
                  • Atc-gen-loop-correct-thm
                  • Atc-gen-init-scope-thms
                  • Atc-gen-fun-correct-thm
                  • Atc-gen-fn-result-thm
                  • Atc-gen-loop-body-correct-thm
                  • Atc-gen-loop
                  • Atc-gen-loop-test-correct-thm
                  • Atc-check-guard-conjunct
                  • Atc-find-affected
                  • Atc-gen-cfun-final-compustate
                  • Atc-gen-init-inscope-auto
                  • Atc-gen-init-inscope-static
                  • Atc-gen-push-init-thm
                  • Atc-gen-loop-measure-fn
                  • Atc-gen-fun-endstate
                  • Atc-gen-loop-termination-thm
                  • Atc-gen-formal-thm
                  • Atc-gen-loop-final-compustate
                  • Atc-gen-loop-measure-thm
                  • Atc-gen-object-disjoint-hyps
                  • Atc-loop-body-term-subst
                  • Atc-gen-omap-update-formals
                  • Atc-gen-loop-tthm-formula
                  • Atc-gen-init-inscope
                  • Atc-gen-fn-def*
                  • Atc-gen-param-declon-list
                  • Atc-formal-affectablep
                    • Atc-gen-cfun-fun-env-thm
                    • Atc-gen-add-var-formals
                    • Atc-gen-cfun-fun-env-thm-name
                    • Atc-gen-fn-guard
                    • Atc-filter-exec-fun-args
                    • Atc-gen-context-preamble-aux-aux
                    • Atc-typed-formals-to-extobjs
                    • Atc-formal-affectable-listp
                  • Atc-statement-generation
                  • Atc-gen-fileset
                  • Atc-gen-everything
                  • Atc-gen-obj-declon
                  • Atc-gen-fileset-event
                  • Atc-tag-tables
                  • Atc-expression-generation
                  • Atc-generation-contexts
                  • Atc-gen-wf-thm
                  • Term-checkers-atc
                  • Atc-variable-tables
                  • Term-checkers-common
                  • Atc-gen-init-fun-env-thm
                  • Atc-gen-appconds
                  • Read-write-variables
                  • Atc-gen-thm-assert-events
                  • Test*
                  • Atc-gen-prog-const
                  • Atc-gen-expr-bool
                  • Atc-theorem-generation
                  • Atc-tag-generation
                  • Atc-gen-expr-pure
                  • Atc-function-tables
                  • Atc-object-tables
                • Fty-pseudo-term-utilities
                • Atc-term-recognizers
                • Atc-input-processing
                • Atc-shallow-embedding
                • Atc-process-inputs-and-gen-everything
                • Atc-table
                • Atc-fn
                • Atc-pretty-printing-options
                • Atc-types
                • Atc-macro-definition
              • Atc-tutorial
            • Language
            • Representation
            • Transformation-tools
            • Insertion-sort
            • Pack
          • 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
    • Atc-function-and-loop-generation

    Atc-formal-affectablep

    Check if a formal parameter is a affectable.

    Signature
    (atc-formal-affectablep formal typed-formals) → yes/no
    Arguments
    formal — Guard (symbolp formal).
    typed-formals — Guard (atc-symbol-varinfo-alistp typed-formals).
    Returns
    yes/no — Type (booleanp yes/no).

    By this we mean that the formal parameter either has pointer or array type or refers to an external object. That is, it is the kind of parameter that may be affected in a function, and that therefore must be returned by the function if affected.

    Definitions and Theorems

    Function: atc-formal-affectablep

    (defun atc-formal-affectablep (formal typed-formals)
     (declare
         (xargs :guard (and (symbolp formal)
                            (atc-symbol-varinfo-alistp typed-formals))))
     (let ((__function__ 'atc-formal-affectablep))
       (declare (ignorable __function__))
       (b*
        ((pair (assoc-eq (symbol-fix formal)
                         (atc-symbol-varinfo-alist-fix typed-formals))))
        (and (consp pair)
             (b* ((info (cdr pair))
                  (type (atc-var-info->type info)))
               (or (type-case type :pointer)
                   (type-case type :array)
                   (atc-var-info->externalp info)))))))

    Theorem: booleanp-of-atc-formal-affectablep

    (defthm booleanp-of-atc-formal-affectablep
      (b* ((yes/no (atc-formal-affectablep formal typed-formals)))
        (booleanp yes/no))
      :rule-classes :rewrite)

    Theorem: atc-formal-affectablep-of-symbol-fix-formal

    (defthm atc-formal-affectablep-of-symbol-fix-formal
      (equal (atc-formal-affectablep (symbol-fix formal)
                                     typed-formals)
             (atc-formal-affectablep formal typed-formals)))

    Theorem: atc-formal-affectablep-symbol-equiv-congruence-on-formal

    (defthm atc-formal-affectablep-symbol-equiv-congruence-on-formal
      (implies
           (acl2::symbol-equiv formal formal-equiv)
           (equal (atc-formal-affectablep formal typed-formals)
                  (atc-formal-affectablep formal-equiv typed-formals)))
      :rule-classes :congruence)

    Theorem: atc-formal-affectablep-of-atc-symbol-varinfo-alist-fix-typed-formals

    (defthm
     atc-formal-affectablep-of-atc-symbol-varinfo-alist-fix-typed-formals
     (equal (atc-formal-affectablep
                 formal
                 (atc-symbol-varinfo-alist-fix typed-formals))
            (atc-formal-affectablep formal typed-formals)))

    Theorem: atc-formal-affectablep-atc-symbol-varinfo-alist-equiv-congruence-on-typed-formals

    (defthm
     atc-formal-affectablep-atc-symbol-varinfo-alist-equiv-congruence-on-typed-formals
     (implies
      (atc-symbol-varinfo-alist-equiv typed-formals typed-formals-equiv)
      (equal (atc-formal-affectablep formal typed-formals)
             (atc-formal-affectablep formal typed-formals-equiv)))
     :rule-classes :congruence)