• 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
          • Defbyte
          • Defresult
          • Fold
          • Defsubtype
          • Defset
          • Specific-types
          • Defflatsum
          • Deflist-of-len
          • Pos-list
          • Defbytelist
          • Defomap
            • Defbyte-standard-instances
            • Deffixtype-alias
            • Defbytelist-standard-instances
            • Defunit
            • Byte-list
            • Byte
            • Database
            • Pos-option
            • Nibble
            • Nat-option
            • String-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
            • Bag
            • Pos-set
            • Hex-digit-char-list
            • Dec-digit-char-list
            • Pseudo-event-form-list
            • Nat-option-list
            • Symbol-set
            • String-set
            • Nat-set
            • Oct-digit-char-list
            • Bin-digit-char-list
            • Bit-list
          • Isar
          • Kestrel-utilities
          • Set
          • Soft
          • C
          • Bv
          • Imp-language
          • Event-macros
          • Java
          • Bitcoin
          • Ethereum
          • Yul
          • Zcash
          • ACL2-programming-language
          • 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
    • Fty-extensions
    • Fty
    • Omaps

    Defomap

    Generate a fixtype of omaps whose keys and values have specified fixtypes.

    Include-book Form

    (include-book "kestrel/fty/defomap" :dir :system)

    Introduction

    This is analogous to deflist, defalist, and defset. Besides the fixtype itself, this macro also generates some theorems about the fixtype. Future versions of this macro may generate more theorems, as needed.

    Aside from the recognizer, fixer, and equivalence for the fixtype, this macro does not generate any operations on the typed omaps. Instead, the generic omap operations can be used on typed omaps. This macro generates theorems about the use of these generic operations on typed omaps.

    Future versions of this macro may be modularized to provide a ``sub-macro'' that generates only the recognizer and theorems about it, without the fixtype (and without the fixer and equivalence), similarly to std::deflist and std::defalist. That sub-macro could be called omap::defomap.

    This macro differs from defmap, which generates an alist.

    General Form

    (defomap type
             :key-type ...
             :val-type ...
             :pred ...
             :fix ...
             :equiv ...
             :parents ...
             :short ...
             :long ...

    Inputs

    type

    The name of the new fixtype.

    :key-type

    The (existing) fixtype of the keys of the new map fixtype.

    :val-type

    The (existing) fixtype of the values of the new map fixtype.

    :pred
    :fix
    :equiv

    The name of the recognizer, fixer, and equivalence for the new fixtype.

    The defaults are type followed by -p, -fix, and -equiv.

    :parents
    :short
    :long

    These are used to generate XDOC documentation for the topic name.

    If any of these is not supplied, the corresponding component is omitted from the generated XDOC topic.

    This macro currently does not perform a thorough validation of its inputs. Erroneous inputs may result in failures of the generated events. Errors should be easy to diagnose, also since this macro has a very simple and readable implementation. Future versions of this macro should perform more thorough input validation.

    Generated Events

    The following are generated, inclusive of XDOC documentation:

    • The recognizer, the fixer, the equivalence, and the fixtype.
    • Several theorems about the recognizer, fixer, equivalence, and omap operations applied to this type of omaps.