• 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
            • Atc-implementation
              • Atc-abstract-syntax
              • Atc-pretty-printer
              • Atc-event-and-code-generation
                • Atc-symbolic-computation-states
                • Atc-symbolic-execution-rules
                • Atc-gen-ext-declon-lists
                • Atc-function-and-loop-generation
                • Atc-statement-generation
                • Atc-gen-fileset
                • Atc-gen-everything
                • Atc-gen-obj-declon
                • Atc-gen-fileset-event
                • Atc-tag-tables
                  • Atc-tag-info
                  • Atc-type-to-recognizer
                    • Atc-type-to-notflexarrmem-thms
                    • Atc-string-taginfo-alist-to-writer-return-thms
                    • Atc-string-taginfo-alist-to-reader-return-thms
                    • Atc-string-taginfo-alist-to-writers
                    • Atc-string-taginfo-alist-to-readers
                    • Atc-type-to-pointer-type-to-quoted-thms
                    • Atc-type-to-type-to-quoted-thms
                    • Atc-type-to-type-of-value-thm
                    • Atc-type-to-valuep-thm
                    • Atc-type-to-value-kind-thm
                    • Atc-string-taginfo-alist-to-pointer-type-to-quoted-thms
                    • Atc-get-tag-info
                    • Atc-string-taginfo-alist-to-type-to-quoted-thms
                    • Atc-string-taginfo-alist-to-type-of-value-thms
                    • Atc-string-taginfo-alist-to-member-write-thms
                    • Atc-string-taginfo-alist-to-member-read-thms
                    • Atc-string-taginfo-alist-to-value-kind-thms
                    • Atc-string-taginfo-alist-to-recognizers
                    • Atc-string-taginfo-alist-to-flexiblep-thms
                    • Atc-string-taginfo-alist-to-valuep-thms
                    • Atc-string-taginfo-alist-to-not-error-thms
                    • Atc-string-taginfo-alist
                    • Irr-atc-tag-info
                  • Atc-expression-generation
                  • Atc-generation-contexts
                  • Atc-gen-wf-thm
                  • Term-checkers-atc
                  • Atc-variable-tables
                  • Term-checkers-common
                  • Atc-gen-init-fun-env-thm
                  • Atc-gen-appconds
                  • Read-write-variables
                  • Atc-gen-thm-assert-events
                  • Test*
                  • Atc-gen-prog-const
                  • Atc-gen-expr-bool
                  • Atc-theorem-generation
                  • Atc-tag-generation
                  • Atc-gen-expr-pure
                  • Atc-function-tables
                  • Atc-object-tables
                • Fty-pseudo-term-utilities
                • Atc-term-recognizers
                • Atc-input-processing
                • Atc-shallow-embedding
                • Atc-process-inputs-and-gen-everything
                • Atc-table
                • Atc-fn
                • Atc-pretty-printing-options
                • Atc-types
                • Atc-macro-definition
              • Atc-tutorial
              • Pure-expression-execution
            • Transformation-tools
            • 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
    • Atc-tag-tables

    Atc-type-to-recognizer

    ACL2 recognizer corresponding to a C type.

    Signature
    (atc-type-to-recognizer type prec-tags) → recognizer
    Arguments
    type — Guard (typep type).
    prec-tags — Guard (atc-string-taginfo-alistp prec-tags).
    Returns
    recognizer — Type (symbolp recognizer).

    For a supported integer type, the predicate is the recognizer of values of that type. For a structure type, the predicate is the recognizer of structures of that type. For a pointer to integer type, the predicate is the recognizer of that referenced type. For a pointer to structure type, the predicate is the recognizer of structures of that type. For an array of integer type, the predicate is the recognizer of arrays of that element type.

    This is based on our current ACL2 representation of C types, which may be extended in the future. Note that, in the current representation, the predicate corresponding to each type is never a recognizer of pointer values.

    Definitions and Theorems

    Function: atc-type-to-recognizer

    (defun atc-type-to-recognizer (type prec-tags)
     (declare
          (xargs :guard (and (typep type)
                             (atc-string-taginfo-alistp prec-tags))))
     (let ((__function__ 'atc-type-to-recognizer))
      (declare (ignorable __function__))
      (type-case
       type
       :void (raise "Internal error: type ~x0." type)
       :char (raise "Internal error: type ~x0." type)
       :schar 'scharp
       :uchar 'ucharp
       :sshort 'sshortp
       :ushort 'ushortp
       :sint 'sintp
       :uint 'uintp
       :slong 'slongp
       :ulong 'ulongp
       :sllong 'sllongp
       :ullong 'ullongp
       :struct
       (defstruct-info->recognizer
        (atc-tag-info->defstruct (atc-get-tag-info type.tag prec-tags)))
       :pointer
       (type-case
            type.to
            :void (raise "Internal error: type ~x0." type)
            :char (raise "Internal error: type ~x0." type)
            :schar 'scharp
            :uchar 'ucharp
            :sshort 'sshortp
            :ushort 'ushortp
            :sint 'sintp
            :uint 'uintp
            :slong 'slongp
            :ulong 'ulongp
            :sllong 'sllongp
            :ullong 'ullongp
            :struct (defstruct-info->recognizer
                         (atc-tag-info->defstruct
                              (atc-get-tag-info type.to.tag prec-tags)))
            :pointer (raise "Internal error: type ~x0." type)
            :array (raise "Internal error: type ~x0." type))
       :array
       (type-case type.of
                  :void (raise "Internal error: type ~x0." type)
                  :char (raise "Internal error: type ~x0." type)
                  :schar 'schar-arrayp
                  :uchar 'uchar-arrayp
                  :sshort 'sshort-arrayp
                  :ushort 'ushort-arrayp
                  :sint 'sint-arrayp
                  :uint 'uint-arrayp
                  :slong 'slong-arrayp
                  :ulong 'ulong-arrayp
                  :sllong 'sllong-arrayp
                  :ullong 'ullong-arrayp
                  :struct (raise "Internal error: type ~x0." type)
                  :pointer (raise "Internal error: type ~x0." type)
                  :array (raise "Internal error: type ~x0." type)))))

    Theorem: symbolp-of-atc-type-to-recognizer

    (defthm symbolp-of-atc-type-to-recognizer
      (b* ((recognizer (atc-type-to-recognizer type prec-tags)))
        (symbolp recognizer))
      :rule-classes :rewrite)