• 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
            • Formalized-subset
            • Mapping-to-language-definition
            • Input-files
            • Compilation-database
            • Printer
            • Output-files
            • Abstract-syntax-operations
            • Implementation-environments
            • Abstract-syntax
            • Concrete-syntax
            • Disambiguation
            • Validation
              • Validator
                • Valid-exprs/decls/stmts
                  • Valid-stmt
                  • Valid-expr
                  • Valid-dirdeclor
                  • Valid-type-spec
                  • Valid-init-declor
                  • Valid-initer
                  • Valid-declor
                  • Valid-decl-spec
                  • Valid-spec/qual
                  • Valid-param-declon
                    • Valid-struct-declon
                    • Valid-struct-declor
                    • Valid-desiniter-list
                    • Valid-designor
                    • Valid-param-declor
                    • Valid-decl-spec-list
                    • Valid-comp-stmt
                    • Valid-spec/qual-list
                    • Valid-designor-list
                    • Valid-block-item
                    • Valid-struct-declor-list
                    • Valid-genassoc-list
                    • Valid-align-spec
                    • Valid-enumer
                    • Valid-declon
                    • Valid-enum-spec
                    • Valid-dirabsdeclor
                    • Valid-declor-option
                    • Valid-initer-option
                    • Valid-expr-list
                    • Valid-block-item-list
                    • Valid-absdeclor
                    • Valid-struct-declon-list
                    • Valid-label
                    • Valid-genassoc
                    • Valid-tyname
                    • Valid-struni-spec
                    • Valid-dirabsdeclor-option
                    • Valid-const-expr
                    • Valid-init-declor-list
                    • Valid-absdeclor-option
                    • Valid-param-declon-list
                    • Valid-desiniter
                    • Valid-const-expr-option
                    • Valid-expr-option
                    • Valid-statassert
                    • Valid-enumer-list
                    • Valid-member-designor
                    • Valid-declon-list
                  • Valid-stmt
                  • Valid-expr
                  • Valid-dirdeclor
                  • Valid-binary
                  • Valid-type-spec
                  • Valid-transunit
                  • Valid-stor-spec-list
                  • Valid-prototype-args
                  • Valid-fundef
                  • Valid-unary
                  • Valid-init-declor
                  • Valid-stringlit-list
                  • Valid-type-spec-list-residual
                  • Valid-transunit-ensemble
                  • Valid-cond
                  • Valid-lookup-ord
                  • Valid-c-char
                  • Valid-funcall
                  • Valid-iconst
                  • Valid-add-ord-objfuns-file-scope
                  • Valid-initer
                  • Valid-declor
                  • Valid-add-ord
                  • Valid-arrsub
                  • Valid-update-ext
                  • Valid-ext-declon-list
                  • Valid-ext-declon
                  • Valid-univ-char-name
                  • Valid-memberp
                  • Valid-add-ord-file-scope
                  • Valid-var
                  • Valid-s-char
                  • Valid-decl-spec
                  • Valid-cconst
                  • Valid-cast
                  • Valid-sizeof/alignof
                  • Valid-stringlit
                  • Valid-spec/qual
                  • Valid-oct-escape
                  • Valid-get-fresh-uid
                  • Valid-param-declon
                    • Valid-struct-declon
                    • Valid-struct-declor
                    • Valid-has-internalp
                    • Valid-escape
                    • Valid-enum-const
                    • Valid-gensel
                    • Valid-const
                    • Valid-desiniter-list
                    • Valid-designor
                    • Valid-param-declor
                    • Valid-dec/oct/hex-const
                    • Valid-s-char-list
                    • Valid-decl-spec-list
                    • Valid-c-char-list
                    • Valid-member
                    • Valid-init-table
                    • Valid-lookup-ord-file-scope
                    • Valid-comp-stmt
                    • Valid-spec/qual-list
                    • Valid-lookup-ext
                    • Valid-designor-list
                    • Valid-fconst
                    • Valid-block-item
                    • Valid-struct-declor-list
                    • Valid-genassoc-list
                    • Valid-align-spec
                    • Valid-enumer
                    • Valid-declon
                    • Valid-simple-escape
                    • Valid-enum-spec
                    • Valid-dirabsdeclor
                    • Valid-declor-option
                    • Valid-pop-scope
                    • Valid-initer-option
                    • Valid-expr-list
                    • Valid-block-item-list
                    • Valid-absdeclor
                    • Valid-struct-declon-list
                    • Valid-push-scope
                    • Valid-label
                    • Valid-genassoc
                    • Valid-tyname
                    • Valid-struni-spec
                    • Valid-dirabsdeclor-option
                    • Valid-const-expr
                    • Valid-init-declor-list
                    • Valid-absdeclor-option
                    • Valid-param-declon-list
                    • Valid-desiniter
                    • Valid-const-expr-option
                    • Valid-table-num-scopes
                    • Valid-expr-option
                    • Valid-statassert
                    • Valid-enumer-list
                    • Valid-member-designor
                    • Valid-declon-list
                    • Valid-empty-scope
                  • Validation-information
                • Gcc-builtins
                • Preprocessing
                • Parsing
              • Atc
              • 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
      • Validator
      • Valid-exprs/decls/stmts

      Valid-param-declon

      Validate a parameter declaration.

      Signature
      (valid-param-declon paramdecl fundef-params-p table ienv) 
        → 
      (mv erp new-paramdecl type return-types new-table)
      Arguments
      paramdecl — Guard (param-declonp paramdecl).
      fundef-params-p — Guard (booleanp fundef-params-p).
      table — Guard (valid-tablep table).
      ienv — Guard (ienvp ienv).
      Returns
      erp — Type (maybe-msgp erp).
      new-paramdecl — Type (param-declonp new-paramdecl).
      type — Type (typep type).
      return-types — Type (type-setp return-types).
      new-table — Type (valid-tablep new-table).

      The fundef-params-p input is t iff we are validating the parameter of a function definition.

      We validate the declaration specifiers, which results in a type, a list of storage class specifiers, and a possibly updated table. We ensure that the list of storage class specifiers is either empty or the singleton register [C17:6.7.6.3/2].

      We validate the parameter declarator, ensuring that it has an identifier if fundef-params-p is t [C17:6.9.1/5]. We adjust the type if necessary [C17:6.7.6.3/7] [C17:6.7.6.3/8]. If the parameter declarator has an identifier, we extend the validation table with it, unless there is already an ordinary identifier with the same name in the same (i.e. current) scope; since parameters have no linkage [C17:6.2.2/6], they can be only declared once in the same scope [C17:6.7/3]. Parameters of function declarations have no linkage [C17:6.2.2/6]. Since storage is allocated for them when the function is called, they are considered defined [C17:6.7/5].