• 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
          • Language
            • Abstract-syntax
              • Tyspecseq
              • Expr
              • Binop
              • Fileset
              • Obj-declor
              • Abstract-syntax-operations
                • Stmts/blocks-nocallsp
                • Tyspec+declor-to-ident+params+tyname
                • Fundef-list-to-fun-declon-list
                • Fundef-list->name-list
                • Ident+tyname-to-tyspec+declor
                • Tyspec+declor-to-ident+tyname
                • Obj-declon-to-ident+scspec+tyname+init
                • Ident+adeclor-to-obj-declor
                • Ident+adeclor-to-fun-declor
                • Fun-adeclor-to-params+declor
                  • Param-declon-list-to-ident+tyname-lists
                  • Obj-declor-to-ident+adeclor
                  • Fun-declor-to-ident+adeclor
                  • Expr-constp
                  • Fundef-to-fun-declon
                  • Param-declon-to-ident+tyname
                  • Ext-declon-list->fundef-list
                  • Struct-declon-to-ident+tyname
                  • Unop-nonpointerp
                  • Initer-option-nocallsp
                  • Expr-nocallsp
                  • Expr-list-nocallsp
                  • Binop-strictp
                  • Expr-purep
                  • Expr-option-nocallsp
                  • Expr-list-constp
                  • Binop-purep
                  • Obj-declon-nocallsp
                  • Initer-nocallsp
                  • Label-nocallsp
                  • Fundef->name
                  • Expr-list-purep
                  • Block-item-nocallsp
                  • Block-item-list-nocallsp
                  • Stmt-nocallsp
                • Iconst
                • Obj-adeclor
                • Const
                • Fundef
                • Unop
                • File
                • Tag-declon
                • Fun-declor
                • Obj-declon
                • Iconst-length
                • Label
                • Struct-declon
                • Initer
                • Ext-declon
                • Fun-adeclor
                • Expr-option
                • Iconst-base
                • Initer-option
                • Iconst-option
                • Tyspecseq-option
                • Stmt-option
                • Scspecseq
                • Param-declon
                • Obj-declon-option
                • File-option
                • Tyname
                • Transunit
                • Fun-declon
                • Transunit-result
                • Param-declon-list
                • Struct-declon-list
                • Expr-list
                • Tyspecseq-list
                • Identifiers
                • Ext-declon-list
                • Unop-list
                • Tyname-list
                • Fundef-list
                • Fun-declon-list
                • Binop-list
                • Stmt-fixtypes
                • Expr-fixtypes
              • Integer-ranges
              • Implementation-environments
              • Dynamic-semantics
              • Static-semantics
              • Grammar
              • Types
              • Integer-formats-definitions
              • Computation-states
              • Portable-ascii-identifiers
              • Values
              • Integer-operations
              • Object-designators
              • Operations
              • Errors
              • Tag-environments
              • Function-environments
              • Character-sets
              • Flexible-array-member-removal
              • Arithmetic-operations
              • Pointer-operations
              • Real-operations
              • Array-operations
              • Scalar-operations
              • Structure-operations
            • 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
    • Abstract-syntax-operations

    Fun-adeclor-to-params+declor

    Decompose an abstract function declarator into a list of parameter declarations and an abstract object declarator.

    Signature
    (fun-adeclor-to-params+declor declor) → (mv params declor)
    Arguments
    declor — Guard (fun-adeclorp declor).
    Returns
    params — Type (param-declon-listp params).
    declor — Type (obj-adeclorp declor).

    The inverse of this is not well-defined for every abstract object declarator, because the latter may include array declarators, which are not allowed in function declarators. We could define the inverse on object declarators that are restricted not to use array declarators; but we do not need the inverse for now.

    Definitions and Theorems

    Function: fun-adeclor-to-params+declor

    (defun fun-adeclor-to-params+declor (declor)
      (declare (xargs :guard (fun-adeclorp declor)))
      (fun-adeclor-case
           declor :base
           (mv declor.params (obj-adeclor-none))
           :pointer
           (b* (((mv params sub)
                 (fun-adeclor-to-params+declor declor.decl)))
             (mv params
                 (make-obj-adeclor-pointer :decl sub)))))

    Theorem: param-declon-listp-of-fun-adeclor-to-params+declor.params

    (defthm param-declon-listp-of-fun-adeclor-to-params+declor.params
      (b* (((mv ?params ?declor)
            (fun-adeclor-to-params+declor declor)))
        (param-declon-listp params))
      :rule-classes :rewrite)

    Theorem: obj-adeclorp-of-fun-adeclor-to-params+declor.declor

    (defthm obj-adeclorp-of-fun-adeclor-to-params+declor.declor
      (b* (((mv ?params ?declor)
            (fun-adeclor-to-params+declor declor)))
        (obj-adeclorp declor))
      :rule-classes :rewrite)

    Theorem: fun-adeclor-to-params+declor-of-fun-adeclor-fix-declor

    (defthm fun-adeclor-to-params+declor-of-fun-adeclor-fix-declor
      (equal (fun-adeclor-to-params+declor (fun-adeclor-fix declor))
             (fun-adeclor-to-params+declor declor)))

    Theorem: fun-adeclor-to-params+declor-fun-adeclor-equiv-congruence-on-declor

    (defthm
     fun-adeclor-to-params+declor-fun-adeclor-equiv-congruence-on-declor
     (implies (fun-adeclor-equiv declor declor-equiv)
              (equal (fun-adeclor-to-params+declor declor)
                     (fun-adeclor-to-params+declor declor-equiv)))
     :rule-classes :congruence)