• 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
        • Isar
        • Kestrel-utilities
        • Set
        • Soft
        • C
          • Syntax-for-tools
            • Disambiguator
            • Abstract-syntax
            • Parser
            • Validator
            • Printer
            • Formalized-subset
              • Expr-pure-formalp
              • Type-spec-list-integer-formalp
              • Stmts/blocks-formalp
              • Extdecl-formalp
              • Ident-formalp
              • Type-spec-list-formalp
              • Tyname-formalp
                • Pointers-formalp
                • Dirdeclor-obj-formalp
                • Desiniter-formalp
                • Fundef-formalp
                • Decl-obj-formalp
                • Decl-block-formalp
                • Initdeclor-obj-formalp
                • Expr-asg-formalp
                • Structdecl-formalp
                • Initdeclor-block-formalp
                • Decl-struct-formalp
                • Dirdeclor-fun-formalp
                • Dirdeclor-block-formalp
                • Initdeclor-fun-formalp
                • Transunit-ensemble-formalp
                • Param-declor-formalp
                • Initer-formalp
                • Expr-call-formalp
                • Declor-obj-formalp
                • Decl-fun-formalp
                • Param-declon-formalp
                • Structdeclor-formalp
                • Stor-spec-list-formalp
                • Declor-fun-formalp
                • Declor-block-formalp
                • Strunispec-formalp
                • Structdecl-list-formalp
                • Param-declon-list-formalp
                • Desiniter-list-formalp
                • Extdecl-list-formalp
                • Expr-list-pure-formalp
                • Transunit-formalp
                • Const-formalp
                • Stmt-formalp
                • Block-item-list-formalp
                • Block-item-formalp
              • Mapping-to-language-definition
              • Input-files
              • Defpred
              • Output-files
              • Abstract-syntax-operations
              • Validation-information
              • Implementation-environments
              • Concrete-syntax
              • Unambiguity
              • Ascii-identifiers
              • Preprocessing
              • Abstraction-mapping
            • Atc
            • Language
            • Representation
            • Transformation-tools
            • Insertion-sort
            • Pack
          • 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
    • Formalized-subset

    Tyname-formalp

    Check if a type name has formal dynamic semantics.

    Signature
    (tyname-formalp tyname) → yes/no
    Arguments
    tyname — Guard (tynamep tyname).
    Returns
    yes/no — Type (booleanp yes/no).

    In the abstract syntax of the formal language definition, type names are only used in cast expressions, which are required by c::eval-cast to denote integer types (except the plain char type) in order to be supported. Thus we need to ensure that the list of type specifiers and qualifiers only contains supported type specifier sequences corresponding to those types, and that there is no abstract declarator. We must also ensure that there are no type qualifiers, which are not supported in the formal semantics.

    Definitions and Theorems

    Function: tyname-formalp

    (defun tyname-formalp (tyname)
      (declare (xargs :guard (tynamep tyname)))
      (declare (xargs :guard (tyname-unambp tyname)))
      (let ((__function__ 'tyname-formalp))
        (declare (ignorable __function__))
        (b* (((tyname tyname) tyname)
             ((mv okp tyspecs)
              (check-spec/qual-list-all-typespec tyname.specqual)))
          (and okp
               (type-spec-list-integer-formalp tyspecs)
               (not tyname.decl?)))))

    Theorem: booleanp-of-tyname-formalp

    (defthm booleanp-of-tyname-formalp
      (b* ((yes/no (tyname-formalp tyname)))
        (booleanp yes/no))
      :rule-classes :rewrite)

    Theorem: tyname-formalp-of-tyname-fix-tyname

    (defthm tyname-formalp-of-tyname-fix-tyname
      (equal (tyname-formalp (tyname-fix tyname))
             (tyname-formalp tyname)))

    Theorem: tyname-formalp-tyname-equiv-congruence-on-tyname

    (defthm tyname-formalp-tyname-equiv-congruence-on-tyname
      (implies (tyname-equiv tyname tyname-equiv)
               (equal (tyname-formalp tyname)
                      (tyname-formalp tyname-equiv)))
      :rule-classes :congruence)