• 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
          • Defbyte
          • Defresult
          • Fold
            • Deffold-reduce
            • Deffold-map
            • Defmake-self
              • Defmake-self-implementation
          • Specific-types
          • Defsubtype
          • Defset
          • Defflatsum
          • Deflist-of-len
          • Pos-list
          • Defomap
          • Defbytelist
          • Defbyte-standard-instances
          • Deffixtype-alias
          • Defbytelist-standard-instances
          • Defunit
          • Byte-list
          • Database
          • Byte
          • String-option
          • Pos-option
          • Nibble
          • Nat-option
          • Ubyte32-option
          • Byte-list20
          • Byte-list32
          • Byte-list64
          • Pseudo-event-form
          • Natoption/natoptionlist
          • Nati
          • Character-list
          • Nat/natlist
          • Maybe-string
          • Nibble-list
          • Natoption/natoptionlist-result
          • Nat/natlist-result
          • Nat-option-list-result
          • Set
          • String-result
          • String-list-result
          • Nat-result
          • Nat-option-result
          • Nat-list-result
          • Maybe-string-result
          • Integer-result
          • Character-result
          • Character-list-result
          • Boolean-result
          • Map
          • Dependencies
          • Bag
          • Pos-set
          • Hex-digit-char-list
          • Dec-digit-char-list
          • Pseudo-event-form-list
          • Nat-option-list
          • Character-any-map
          • Any-nat-map
          • Symbol-set
          • String-set
          • Nat-set
          • Character-set
          • Oct-digit-char-list
          • Bin-digit-char-list
          • Bit-list
        • Isar
        • Kestrel-utilities
        • Set
        • C
        • 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
  • Fold

Defmake-self

Defining ``make-self'' functions for fixtypes.

Introduction

This macro automates the creation of ``make-self'' functions on fixtypes. A ``make-self'' function is one which takes a value of a particular fixtype and returns a standard constructor form which would evaluate to the input value.

The primary motivation for introducing such functions is to produce more legible forms which are consistent across different layouts.

General Form

(defmake-self type
              :parents    ...  ; no default
              :short      ...  ; no default
              :long       ...  ; no default
              :print      ...  ; default :result
  )

Inputs

type

The name of the type or clique for which to create the ``make-self'' functions. ``Make-self'' functions will also be generated for all the necessary type dependencies.

:parents
:short
:long

These, if present, are added to the generated XDOC topic described in the Section `Generated Events' below.

:print

Controls how much information is printed. This is a apt::print-specifier. On nil or :error, only error messages are printed. On :result (the default) or :info, the events to be submitted are printed, in addition to error messages. Finally, all information is printed under :all.

Generated Events

make-self-<clique-name>

An XDOC topic whose name is obtained by adding, at the end of the symbol make-self-, the name of the (possibly singleton) clique to which the type input belongs. If any of the :parents, :short, or :long inputs are provided, they are added to this XDOC topic. This XDOC topic is generated with ACL2::defxdoc+, with :order-topics t, so that the other generated events (described below), which all have this XDOC topic as parent, are listed in order as subtopics.

<type>-make-self

For each type <type> in the same clique specified by the type input, as well as all type dependencies, a ``make-self'' function for that type.

Subtopics

Defmake-self-implementation
Implementation of defmake-self.