• 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
          • Atc
          • Language
            • Abstract-syntax
              • Tyspecseq
              • Expr
                • Exprp
                • Expr-case
                • Expr-binary
                • Expr-equiv
                • Expr-cond
                • Expr-unary
                • Expr-memberp
                • Expr-member
                • Expr-cast
                • Expr-call
                • Expr-arrsub
                • Expr-kind
                • Expr-preinc
                • Expr-predec
                • Expr-postinc
                • Expr-postdec
                • Expr-ident
                • Expr-const
                • Expr-fix
                • Expr-count
              • Binop
              • Fileset
              • Obj-declor
              • Ident
              • Iconst
              • Obj-adeclor
              • Const
              • Fundef
              • Unop
              • File
              • Tag-declon
              • Fun-declor
              • Obj-declon
              • Iconst-length
              • Abstract-syntax-operations
              • Label
              • Struct-declon
              • Initer
              • Ext-declon
              • Fun-adeclor
              • Expr-option
              • Iconst-base
              • Initer-option
              • Iconst-option
              • Tyspecseq-option
              • Stmt-option
              • Scspecseq
              • Param-declon
              • Obj-declon-option
              • File-option
              • Tyname
              • Transunit
              • Fun-declon
              • Transunit-result
              • Param-declon-list
              • Struct-declon-list
              • Expr-list
              • Tyspecseq-list
              • Ident-set
              • Ident-list
              • Ext-declon-list
              • Unop-list
              • Tyname-list
              • Fundef-list
              • Fun-declon-list
              • Binop-list
              • Stmt-fixtypes
              • Expr-fixtypes
            • Integer-ranges
            • Implementation-environments
            • Dynamic-semantics
            • Static-semantics
            • Grammar
            • Integer-formats
            • Types
            • Portable-ascii-identifiers
            • Values
            • Integer-operations
            • Computation-states
            • Object-designators
            • Operations
            • Errors
            • Tag-environments
            • Function-environments
            • Character-sets
            • Flexible-array-member-removal
            • Arithmetic-operations
            • Pointer-operations
            • Bytes
            • Keywords
            • Real-operations
            • Array-operations
            • Scalar-operations
            • Structure-operations
          • 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
  • Abstract-syntax
  • Expr-fixtypes

Expr

Fixtype of expressions [C17:6.5].

This is a tagged union type, introduced by fty::deftagsum.

Member Tags → Types
:ident → expr-ident
:const → expr-const
:arrsub → expr-arrsub
:call → expr-call
:member → expr-member
:memberp → expr-memberp
:postinc → expr-postinc
:postdec → expr-postdec
:preinc → expr-preinc
:predec → expr-predec
:unary → expr-unary
:cast → expr-cast
:binary → expr-binary
:cond → expr-cond

For now, we only cover some of the primary expressions [C17:6.5.1], namely identifiers and constants. String literals are not covered. Generic selections are not covered. Parenthesized expression are implicitly covered in the abstract syntax, whose structure provides grouping.

Of the postfix expressions [C17:6.5.2], for now we only cover array subscripting, function calls (where we limit the function to be an identifier), structure and union member access (both forms: . directly on structures and unions, as well as -> on pointers to structures and unions), and post-increment/decrement. Richer expressions for functions in function calls (e.g. function pointers) are not covered. Compound literals are not covered.

Of the unary expressions [C17:6.5.3], for now we only cover pre-increment/decrement, and the ones built with the unary operators. Note that the grammar in [C17] does not define as unary operators all the operators of unary expressions, e.g. ++ is not a unary operator grammatically. We follow that here, but use :unary as the tag for the expressions built with the unary operators in unop. Neither sizeof nor _Alignof are covered.

We include cast expressions, but only with the currently limited type names captured by tyname.

We use a general notion of binary expression to represent multiplicative [C17:6.5.5], additive [C17:6.5.6], shift [C17:6.5.7], relational [C17:6.5.8], equality [C17:6.5.9], bitwise conjunction [C17:6.5.10], bitwise exclusive disjunction [C17:6.5.11], bitwise inclusive disjunction [C17:6.5.12], logical conjunction [C17:6.5.13], logical disjunction [C17:6.5.14], and assigment [C17:6.5.16] expressions. The grammar in [C17] classifies these as different kinds of expressions also in order to capture the precedences among the various operators; however, in an abstract syntax, this is not necessary.

We include ternary conditional expressions.

We do not include the comma operator.

Subtopics

Exprp
Recognizer for expr structures.
Expr-case
Case macro for the different kinds of expr structures.
Expr-binary
Expr-equiv
Basic equivalence relation for expr structures.
Expr-cond
Expr-unary
Expr-memberp
Expr-member
Expr-cast
Expr-call
Expr-arrsub
Expr-kind
Get the kind (tag) of a expr structure.
Expr-preinc
Expr-predec
Expr-postinc
Expr-postdec
Expr-ident
Expr-const
Expr-fix
Fixing function for expr structures.
Expr-count
Measure for recurring over expr structures.