• 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
        • Bv
        • Imp-language
        • Event-macros
        • Java
        • Bitcoin
        • Ethereum
        • Yul
        • Zcash
        • ACL2-programming-language
          • Primitive-functions
          • Translated-terms
          • Values
          • Evaluation
          • Program-equivalence
          • Functions
            • Function
              • Function-fix
              • Function-equiv
              • Make-function
                • Function->params
                • Change-function
                • Function->name
                • Function->body
                • Functionp
              • Function-lookup
              • Function-option
              • Lift-function
              • Lift-function-list
              • Function-set
            • Packages
            • Programs
            • Interpreter
            • Evaluation-states
          • 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
    • Function

    Make-function

    Basic constructor macro for function structures.

    Syntax
    (make-function [:name <name>] 
                   [:params <params>] 
                   [:body <body>]) 
    

    This is the usual way to construct function structures. It simply conses together a structure with the specified fields.

    This macro generates a new function structure from scratch. See also change-function, which can "change" an existing structure, instead.

    Definition

    This is an ordinary make- macro introduced by fty::defprod.

    Macro: make-function

    (defmacro make-function (&rest args)
      (std::make-aggregate 'function
                           args '((:name) (:params) (:body))
                           'make-function
                           nil))

    Function: function

    (defun function (name params body)
      (declare (xargs :guard (and (symbol-valuep name)
                                  (symbol-value-listp params)
                                  (ttermp body))))
      (declare (xargs :guard t))
      (let ((__function__ 'function))
        (declare (ignorable __function__))
        (b* ((name (mbe :logic (symbol-value-fix name)
                        :exec name))
             (params (mbe :logic (symbol-value-list-fix params)
                          :exec params))
             (body (mbe :logic (tterm-fix body)
                        :exec body)))
          (list name params body))))