• 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
                  • Mapping-fix
                  • Make-mapping
                    • Mapping-equiv
                    • Mapping->value-type
                    • Change-mapping
                    • Mapping->value-name
                    • Mapping->key-type
                    • Mapping->key-name
                    • Mappingp
                    • Mapping->name
                  • Function
                  • Programdef
                  • Finalize-type
                  • Closure
                  • 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
    • Mapping

    Make-mapping

    Basic constructor macro for mapping structures.

    Syntax
    (make-mapping [:name <name>] 
                  [:key-name <key-name>] 
                  [:key-type <key-type>] 
                  [:value-name <value-name>] 
                  [:value-type <value-type>]) 
    

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

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

    Definition

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

    Macro: make-mapping

    (defmacro make-mapping (&rest args)
      (std::make-aggregate 'mapping
                           args
                           '((:name)
                             (:key-name)
                             (:key-type)
                             (:value-name)
                             (:value-type))
                           'make-mapping
                           nil))

    Function: mapping

    (defun mapping (name key-name key-type value-name value-type)
      (declare (xargs :guard (and (identifierp name)
                                  (identifierp key-name)
                                  (finalize-typep key-type)
                                  (identifierp value-name)
                                  (finalize-typep value-type))))
      (declare (xargs :guard t))
      (let ((__function__ 'mapping))
        (declare (ignorable __function__))
        (b* ((name (mbe :logic (identifier-fix name)
                        :exec name))
             (key-name (mbe :logic (identifier-fix key-name)
                            :exec key-name))
             (key-type (mbe :logic (finalize-type-fix key-type)
                            :exec key-type))
             (value-name (mbe :logic (identifier-fix value-name)
                              :exec value-name))
             (value-type (mbe :logic (finalize-type-fix value-type)
                              :exec value-type)))
          (cons :mapping (list (cons 'name name)
                               (cons 'key-name key-name)
                               (cons 'key-type key-type)
                               (cons 'value-name value-name)
                               (cons 'value-type value-type))))))