• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
      • Apt
      • Zfc
      • Acre
      • Milawa
      • Smtlink
      • Abnf
      • Vwsim
      • Isar
      • Wp-gen
      • Dimacs-reader
      • Pfcs
      • Legacy-defrstobj
      • Proof-checker-array
      • Soft
      • C
      • Farray
      • Rp-rewriter
      • Instant-runoff-voting
      • Imp-language
      • Sidekick
      • Leftist-trees
      • Java
      • Taspi
      • Bitcoin
      • Riscv
      • Des
      • Ethereum
      • X86isa
      • Sha-2
      • Yul
      • Zcash
      • Proof-checker-itp13
      • Regex
      • 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
        • Json
        • Jfkr
        • Equational
        • Cryptography
        • Poseidon
        • Where-do-i-place-my-book
        • Axe
        • Bigmems
        • Builtins
        • Execloader
        • Aleo
        • Solidity
        • Paco
        • Concurrent-programs
        • Bls12-377-curves
      • Debugging
      • Std
      • Proof-automation
      • Macro-libraries
      • ACL2
      • Interfacing-tools
      • Hardware-verification
      • Software-verification
      • 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))))