• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
      • Apt
      • Zfc
      • Acre
      • Milawa
      • Smtlink
      • Abnf
      • Vwsim
      • Isar
      • Pfcs
      • Wp-gen
      • Dimacs-reader
      • Legacy-defrstobj
      • Proof-checker-array
      • Soft
      • C
      • Farray
      • Rp-rewriter
      • Instant-runoff-voting
      • Imp-language
      • Sidekick
      • Leftist-trees
      • Java
      • Taspi
      • Riscv
      • Bitcoin
      • Des
      • Ethereum
      • X86isa
      • Sha-2
      • Yul
      • Zcash
      • Proof-checker-itp13
      • Regex
      • ACL2-programming-language
      • Json
      • Jfkr
      • Equational
      • Cryptography
      • Poseidon
      • Where-do-i-place-my-book
      • Axe
      • Aleo
        • Aleobft
        • Aleovm
          • Circuits
          • Language
            • Grammar
            • Early-version
              • Abstract-syntax
                • Binary-op
                • Literal
                • Instruction
                • Hash-op
                • Literal-type
                • Operand
                • Unary-op
                • Identifier
                • Commit-op
                • Mapping
                • Function
                • Programdef
                • Finalize-type
                • Closure
                  • Closure-fix
                  • Make-closure
                    • Closure-equiv
                    • Closure->outputs
                    • Closure->instrs
                    • Closure->inputs
                    • Change-closure
                    • Closure->name
                    • Closurep
                  • Register-type
                  • Finalizer
                  • Value-type
                  • Record-type
                  • Command
                  • Plaintext-type
                  • Finalization-option
                  • Visibility
                  • Register
                  • Reference
                  • Programid
                  • Locator
                  • Finalization
                  • Entry-type
                  • Regaccess
                  • Program
                  • Interface-type
                  • Ident+ptype
                  • Ident+etype
                  • Function-output
                  • Finalize-output
                  • Finalize-input
                  • Closure-output
                  • Closure-input
                  • Assert-op
                  • Function-input
                  • Equal-op
                  • Finalize-command
                  • Ternary-op
                  • Import
                  • Ident+ptype-list
                  • Operand-list
                  • Ident+etype-list
                  • Programdef-list
                  • Instruction-list
                  • Import-list
                  • Identifier-list
                  • Function-output-list
                  • Function-input-list
                  • Finalize-output-list
                  • Finalize-input-list
                  • Command-list
                  • Closure-output-list
                  • Closure-input-list
                • Parser
                • Concrete-syntax
              • Concrete-syntax
          • Leo
        • Bigmems
        • Builtins
        • Execloader
        • Solidity
        • Paco
        • Concurrent-programs
        • Bls12-377-curves
      • Debugging
      • Std
      • Community
      • Proof-automation
      • ACL2
      • Macro-libraries
      • Interfacing-tools
      • Hardware-verification
      • Software-verification
      • Math
      • Testing-utilities
    • Closure

    Make-closure

    Basic constructor macro for closure structures.

    Syntax
    (make-closure [:name <name>] 
                  [:inputs <inputs>] 
                  [:instrs <instrs>] 
                  [:outputs <outputs>]) 
    

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

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

    Definition

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

    Macro: make-closure

    (defmacro make-closure (&rest args)
      (std::make-aggregate 'closure
                           args
                           '((:name) (:inputs) (:instrs) (:outputs))
                           'make-closure
                           nil))

    Function: closure

    (defun closure (name inputs instrs outputs)
      (declare (xargs :guard (and (identifierp name)
                                  (closure-input-listp inputs)
                                  (instruction-listp instrs)
                                  (closure-output-listp outputs))))
      (declare (xargs :guard t))
      (let ((__function__ 'closure))
        (declare (ignorable __function__))
        (b* ((name (mbe :logic (identifier-fix name)
                        :exec name))
             (inputs (mbe :logic (closure-input-list-fix inputs)
                          :exec inputs))
             (instrs (mbe :logic (instruction-list-fix instrs)
                          :exec instrs))
             (outputs (mbe :logic (closure-output-list-fix outputs)
                           :exec outputs)))
          (cons :closure (list (cons 'name name)
                               (cons 'inputs inputs)
                               (cons 'instrs instrs)
                               (cons 'outputs outputs))))))