• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • 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
        • Soft
        • C
          • Syntax-for-tools
            • Disambiguator
            • Abstract-syntax
            • Parser
            • Validator
            • Printer
            • Formalized-subset
              • Expr-pure-formalp
              • Type-spec-list-integer-formalp
              • Stmts/blocks-formalp
              • Extdecl-formalp
              • Ident-formalp
              • Type-spec-list-formalp
              • Tyname-formalp
              • Pointers-formalp
              • Dirdeclor-obj-formalp
              • Desiniter-formalp
              • Fundef-formalp
                • Decl-obj-formalp
                • Decl-block-formalp
                • Initdeclor-obj-formalp
                • Expr-asg-formalp
                • Structdecl-formalp
                • Initdeclor-block-formalp
                • Decl-struct-formalp
                • Dirdeclor-fun-formalp
                • Dirdeclor-block-formalp
                • Initdeclor-fun-formalp
                • Transunit-ensemble-formalp
                • Param-declor-formalp
                • Initer-formalp
                • Expr-call-formalp
                • Declor-obj-formalp
                • Decl-fun-formalp
                • Param-declon-formalp
                • Structdeclor-formalp
                • Stor-spec-list-formalp
                • Declor-fun-formalp
                • Declor-block-formalp
                • Strunispec-formalp
                • Structdecl-list-formalp
                • Param-declon-list-formalp
                • Desiniter-list-formalp
                • Extdecl-list-formalp
                • Expr-list-pure-formalp
                • Transunit-formalp
                • Const-formalp
                • Stmt-formalp
                • Block-item-list-formalp
                • Block-item-formalp
              • Mapping-to-language-definition
              • Input-files
              • Defpred
              • Output-files
              • Abstract-syntax-operations
              • Validation-information
              • Implementation-environments
              • Concrete-syntax
              • Unambiguity
              • Ascii-identifiers
              • Preprocessing
              • Abstraction-mapping
            • Atc
            • 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
    • Formalized-subset

    Fundef-formalp

    Check if a function definition has dynamic formal semantics.

    Signature
    (fundef-formalp fundef) → yes/no
    Arguments
    fundef — Guard (fundefp fundef).
    Returns
    yes/no — Type (booleanp yes/no).

    There must be no GCC extensions. The declaration specifiers must be all type specifiers, and they must form a supported type specifier sequence. The declarator must be one supported for a function. There must be no assembler name specifier or attribute specifiers. There must be no declarations between the declarators and the body. The body must be a compound statement (see ldm-fundef), whose block items are all supported.

    Definitions and Theorems

    Function: fundef-formalp

    (defun fundef-formalp (fundef)
     (declare (xargs :guard (fundefp fundef)))
     (declare (xargs :guard (fundef-unambp fundef)))
     (let ((__function__ 'fundef-formalp))
      (declare (ignorable __function__))
      (b* (((fundef fundef) fundef))
       (and
        (not fundef.extension)
        (b* (((mv okp tyspecs)
              (check-decl-spec-list-all-typespec fundef.spec)))
          (and okp (type-spec-list-formalp tyspecs)))
        (declor-fun-formalp fundef.declor)
        (not fundef.asm?)
        (endp fundef.attribs)
        (endp fundef.decls)
        (stmt-case fundef.body :compound)
        (block-item-list-formalp (stmt-compound->items fundef.body))))))

    Theorem: booleanp-of-fundef-formalp

    (defthm booleanp-of-fundef-formalp
      (b* ((yes/no (fundef-formalp fundef)))
        (booleanp yes/no))
      :rule-classes :rewrite)

    Theorem: fundef-formalp-of-fundef-fix-fundef

    (defthm fundef-formalp-of-fundef-fix-fundef
      (equal (fundef-formalp (fundef-fix fundef))
             (fundef-formalp fundef)))

    Theorem: fundef-formalp-fundef-equiv-congruence-on-fundef

    (defthm fundef-formalp-fundef-equiv-congruence-on-fundef
      (implies (fundef-equiv fundef fundef-equiv)
               (equal (fundef-formalp fundef)
                      (fundef-formalp fundef-equiv)))
      :rule-classes :congruence)