• 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
          • Specific-types
          • Defsubtype
          • Defset
          • Defflatsum
          • Deflist-of-len
          • Pos-list
          • Defomap
          • Defbytelist
          • Defbyte-standard-instances
          • Deffixtype-alias
          • Defbytelist-standard-instances
          • Defunit
          • Byte-list
          • Database
            • Components-of-flexoption-with-name
            • Flextypes-containing-flextype
              • Flextype-with-name
              • Flextype-with-recognizer
              • Flextype-names-in-flextypes-with-names
              • Flextypes-with-name
              • Flextype->name
              • Flextype->fix
              • Flexprod-field-list->name-list
              • Flextype-list->name-list
              • Flexprod-listp
              • Flexprod-list->kind-list
              • Flexprod-field-listp
            • 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
    • Database

    Flextypes-containing-flextype

    Find, in the FTY table, the information for a type clique containing a type of the given name.

    Signature
    (flextypes-containing-flextype name fty-table) → flextype?
    Arguments
    name — Guard (symbolp name).
    fty-table — Guard (alistp fty-table).

    Each type has a unique name, so we stop as soon as we find a match. We return nil if there is no match.

    Based on the format as described in database, we do an outer loop on the entries of the table, and for each element an inner loop on the elements of the mutually recursive clique (which may be a singleton).

    Definitions and Theorems

    Function: flextypes-containing-flextype-loop

    (defun flextypes-containing-flextype-loop (name flextype-list)
      (declare (xargs :guard (symbolp name)))
      (let ((__function__ 'flextypes-containing-flextype-loop))
        (declare (ignorable __function__))
        (b* (((when (atom flextype-list)) nil)
             (flextype (car flextype-list))
             (foundp (cond ((flexsum-p flextype)
                            (eq name (flexsum->name flextype)))
                           ((flexlist-p flextype)
                            (eq name (flexlist->name flextype)))
                           ((flexalist-p flextype)
                            (eq name (flexalist->name flextype)))
                           ((flextranssum-p flextype)
                            (eq name (flextranssum->name flextype)))
                           ((flexset-p flextype)
                            (eq name (flexset->name flextype)))
                           ((flexomap-p flextype)
                            (eq name (flexomap->name flextype)))
                           (t nil))))
          (or foundp
              (flextypes-containing-flextype-loop
                   name (cdr flextype-list))))))

    Function: flextypes-containing-flextype

    (defun flextypes-containing-flextype (name fty-table)
     (declare (xargs :guard (and (symbolp name)
                                 (alistp fty-table))))
     (let ((__function__ 'flextypes-containing-flextype))
       (declare (ignorable __function__))
       (b*
         (((when (endp fty-table)) nil)
          ((cons & flextypes) (car fty-table))
          ((unless (flextypes-p flextypes))
           (raise "Internal error: malformed type clique ~x0."
                  flextypes))
          (flextype-list (flextypes->types flextypes))
          (foundp
               (flextypes-containing-flextype-loop name flextype-list)))
         (if foundp flextypes
           (flextypes-containing-flextype name (cdr fty-table))))))