• 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
        • Isar
        • Kestrel-utilities
        • Set
        • C
          • Syntax-for-tools
          • Atc
          • Transformation-tools
            • Simpadd0
            • Proof-generation
              • Xeq-fundef
              • Xeq-expr-cond
              • Xeq-expr-binary
              • Xeq-block-item-list-cons
              • Xeq-stmt-ifelse
              • Xeq-expr-const
              • Xeq-declon-declon
              • Gen-param-thms
              • Gen-from-params
              • Gout
              • Gen-block-item-list-thm
              • Xeq-stmt-while
              • Xeq-stmt-dowhile
              • Gin
              • Xeq-expr-ident
              • Gen-block-item-thm
              • Xeq-stmt-if
              • Xeq-expr-cast
              • Gen-initer-single-thm
              • Gen-init-scope-thm
              • Gen-expr-thm
              • Gen-declon-thm
              • Xeq-expr-unary
              • Gen-stmt-thm
              • Xeq-stmt-return
              • Xeq-stmt-expr
              • Xeq-block-item-declon
              • Xeq-block-item-stmt
              • Xeq-stmt-compound
              • Xeq-initer-single
              • Gen-thm-name
              • Gin-update
              • Gen-var-assertions
              • Tyspecseq-to-type
                • Xeq-block-item-list-empty
                • Gout-no-thm
                • Irr-gout
              • Split-gso
              • Wrap-fn
              • Constant-propagation
              • Specialize
              • Split-fn
              • Split-fn-when
              • Split-all-gso
              • Copy-fn
              • Variables-in-computation-states
              • Rename
              • Utilities
              • Proof-generation-theorems
              • Input-processing
            • Language
            • Representation
            • Insertion-sort
            • Pack
          • 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
    • Proof-generation

    Tyspecseq-to-type

    Map a type specifier sequence from the language formalization to the corresponding type.

    Signature
    (tyspecseq-to-type tyspecseq) → (mv okp type)
    Arguments
    tyspecseq — Guard (c::tyspecseqp tyspecseq).
    Returns
    okp — Type (booleanp okp).
    type — Type (c::typep type).

    For now we only allow certain types.

    Definitions and Theorems

    Function: tyspecseq-to-type

    (defun tyspecseq-to-type (tyspecseq)
      (declare (xargs :guard (c::tyspecseqp tyspecseq)))
      (let ((__function__ 'tyspecseq-to-type))
        (declare (ignorable __function__))
        (c::tyspecseq-case tyspecseq
                           :uchar (mv t (c::type-uchar))
                           :schar (mv t (c::type-schar))
                           :ushort (mv t (c::type-ushort))
                           :sshort (mv t (c::type-sshort))
                           :uint (mv t (c::type-uint))
                           :sint (mv t (c::type-sint))
                           :ulong (mv t (c::type-ulong))
                           :slong (mv t (c::type-slong))
                           :ullong (mv t (c::type-ullong))
                           :sllong (mv t (c::type-sllong))
                           :otherwise (mv nil (c::type-void)))))

    Theorem: booleanp-of-tyspecseq-to-type.okp

    (defthm booleanp-of-tyspecseq-to-type.okp
      (b* (((mv ?okp common-lisp::?type)
            (tyspecseq-to-type tyspecseq)))
        (booleanp okp))
      :rule-classes :rewrite)

    Theorem: typep-of-tyspecseq-to-type.type

    (defthm typep-of-tyspecseq-to-type.type
      (b* (((mv ?okp common-lisp::?type)
            (tyspecseq-to-type tyspecseq)))
        (c::typep type))
      :rule-classes :rewrite)

    Theorem: tyspecseq-to-type-of-tyspecseq-fix-tyspecseq

    (defthm tyspecseq-to-type-of-tyspecseq-fix-tyspecseq
      (equal (tyspecseq-to-type (c::tyspecseq-fix tyspecseq))
             (tyspecseq-to-type tyspecseq)))

    Theorem: tyspecseq-to-type-tyspecseq-equiv-congruence-on-tyspecseq

    (defthm tyspecseq-to-type-tyspecseq-equiv-congruence-on-tyspecseq
      (implies (c::tyspecseq-equiv tyspecseq tyspecseq-equiv)
               (equal (tyspecseq-to-type tyspecseq)
                      (tyspecseq-to-type tyspecseq-equiv)))
      :rule-classes :congruence)