• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Std
    • Community
    • 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
              • Expr
              • Exprs/decls/stmts
              • Type-spec
              • Binop
              • Stmt
              • Amb-expr/tyname
                • Amb-expr/tyname-equiv
                • Amb-expr/tyname-p
                • Make-amb-expr/tyname
                • Change-amb-expr/tyname
                • Amb-expr/tyname->tyname
                • Amb-expr/tyname->expr
                • Amb-expr/tyname-fix
                • Amb-expr/tyname-count
              • Dirdeclor
              • Unop
              • Asm-stmt
              • Dec/oct/hex-const
              • Simple-escape
              • Attrib
              • Ident
              • Amb-decl/stmt
              • Dirabsdeclor
              • Decl-spec
              • Structdecl
              • Fundef
              • Transunit-ensemble
              • Asm-name-spec
              • Amb-declor/absdeclor
              • Param-declor
              • Declor
              • Type-qual
              • Absdeclor
              • Strunispec
              • Stor-spec
              • Keyword-uscores
              • Align-spec
              • Label
              • Expr-option
              • Spec/qual
              • Lsuffix
              • Hex-frac-const
              • Desiniter
              • Tyname
              • Iconst
              • Dirabsdeclor-option
              • Dec-frac-const
              • Dec-core-fconst
              • Extdecl
              • Amb?-declor/absdeclor
              • Isuffix
              • Initdeclor
              • Hex-core-fconst
              • Const-expr-option
              • Attrib-spec
              • Structdeclor
              • Escape
              • Decl
              • Amb?-expr/tyname
              • Ident-option
              • Bin-expo
              • Absdeclor-option
              • Statassert
              • Param-declon
              • Member-designor
              • Initer-option
              • Initer
              • Fsuffix
              • Enumspec
              • Declor-option
              • Const
              • Hex-quad
              • Eprefix
              • Const-expr
              • Block-item
              • Oct-escape
              • Inc/dec-op
              • Fun-spec
              • Dec-expo
              • Cprefix-option
              • Asm-name-spec-option
              • Amb?-decl/stmt
              • S-char
              • Isuffix-option
              • Genassoc
              • Fundef-option
              • Fsuffix-option
              • Fconst
              • Eprefix-option
              • Dec-expo-option
              • Cprefix
              • C-char
              • Type-spec-option
              • Sign-option
              • Iconst-option
              • Asm-output
              • Asm-input
              • Const-option
              • Usuffix
              • Univ-char-name
              • Transunit
              • Hprefix
              • Enumer
              • Designor
              • Attrib-name
              • Sign
              • Asm-qual
              • Typequal/attribspec
              • Dec-expo-prefix
              • Bin-expo-prefix
              • Stringlit
              • Cconst
              • Expr/tyname
              • Decl/stmt
              • Declor/absdeclor
              • Asm-clobber
              • Typequal/attribspec-list
              • Decl-spec-list
              • Stringlit-list
              • Spec/qual-list
              • Inc/dec-op-list
              • Desiniter-list
              • S-char-list
              • Param-declon-list
              • Decl-list
              • C-char-list
              • Block-item-list
              • Typequal/attribspec-list-list
              • Structdeclor-list
              • Structdecl-list
              • Initdeclor-list
              • Genassoc-list
              • Filepath-transunit-map
              • Extdecl-list
              • Expr-list
              • Enumer-list
              • Attrib-spec-list
              • Type-spec-list
              • Ident-list
              • Asm-qual-list
              • Asm-output-list
              • Asm-input-list
              • Asm-clobber-list
              • Stor-spec-list
              • Ident-set
              • Ident-option-set
              • Eprefix-option-list
              • Designor-list
              • Attrib-list
            • Parser
            • Validator
            • Printer
            • Formalized-subset
            • Mapping-to-language-definition
            • Input-files
            • Defpred
            • Output-files
            • Abstract-syntax-operations
            • Validation-information
            • Implementation-environments
            • Concrete-syntax
            • Ascii-identifiers
            • Unambiguity
            • 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
  • Abstract-syntax
  • Exprs/decls/stmts

Amb-expr/tyname

Fixtype of ambiguous expressions or type names.

This is a product type introduced by fty::defprod.

Fields
expr — expr
tyname — tyname

Certain parts of the syntax may be either expressions or type names. An example is the argument of sizeof, which is followed by either a parenthesized type name or a parenthesized expression (it can be also followed by a non-parenthesized expression, but in that case there is no ambiguity).

The syntactic overlap between expressions and type names is complex. The simplest case is a single identifier I, which can be either a variable (which is an expression) or a typedef name (which is a type specifier, and thus a type name without abstract declarator). But also I(I1) is ambiguous, if I1 is also an identifier: it could be either a function call (which is an expression), or a typedef name followed by a function abstract declarator, in which case I1 is a parameter declaration consisting of a typedef name I1. Things can be nested: I(I1(I2(...(In)...))). It is also possible to have multiple arguments or parameters, e.g. I(I1,I2), or things can be nested more deeply. There are also cases involving square brackets, such as I[E], where I is an identifier and E is an expression: this can be an array subscripting expression, or a typedef name I followed by an array abstract declarator.

It may take a bit of work to accurately characterize the syntactic ``intersection'' of expressions and type names. Therefore, at least for now, we introduce a fixtype to capture the notiion of an ambiguous expression or type name. A value of this fixtype consists of both an expression and a type name: the idea is that they are the same in concrete syntax, although there is no explicit requirement in this fixtype. Assuming that this requirement is met, a value of this fixtype provides the two possible interpretations, the expression and the type name (both in abstract syntax, of course).

Subtopics

Amb-expr/tyname-equiv
Basic equivalence relation for amb-expr/tyname structures.
Amb-expr/tyname-p
Recognizer for amb-expr/tyname structures.
Make-amb-expr/tyname
Basic constructor macro for amb-expr/tyname structures.
Change-amb-expr/tyname
Modifying constructor for amb-expr/tyname structures.
Amb-expr/tyname->tyname
Get the tyname field from a amb-expr/tyname.
Amb-expr/tyname->expr
Get the expr field from a amb-expr/tyname.
Amb-expr/tyname-fix
Fixing function for amb-expr/tyname structures.
Amb-expr/tyname-count
Measure for recurring over amb-expr/tyname structures.