• 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
              • Ldm-stmts
              • Ldm-type-spec-list
              • Ldm-exprs
              • Ldm-absdeclor-obj
              • Ldm-declor-fun
              • Ldm-declors/dirdeclors-obj
              • Ldm-dirdeclor-fun
              • Ldm-decl-tag
              • Ldm-struct-declon
              • Ldm-decl-obj
              • Ldm-transunit-ensemble
              • Ldm-dirabsdeclor-obj
              • Ldm-decl-fun
              • Ldm-extdecl
              • Ldm-param-declon
              • Ldm-fundef
              • Ldm-param-declor
              • Ldm-dirdeclor-obj
              • Ldm-struct-declon-list
              • Ldm-stor-spec-list
                • Ldm-param-declon-list
                • Ldm-transunit
                • Ldm-desiniter
                • Ldm-tyname
                • Ldm-isuffix-option
                • Ldm-desiniter-list
                • Ldm-dec/oct/hex-const
                • Ldm-isuffix
                • Ldm-ident
                • Ldm-extdecl-list
                • Ldm-expr-option
                • Ldm-binop
                • Ldm-initer
                • Ldm-const
                • Ldm-enumer-list
                • Ldm-enumer
                • Ldm-label
                • Ldm-lsuffix
                • Ldm-iconst
                • Ldm-declor-obj
                • Ldm-comp-stmt
                • Ldm-expr-list
                • Ldm-expr
                • Ldm-block-item-list
                • Ldm-stmt
                • Ldm-block-item
              • Input-files
              • Compilation-database
              • Printer
              • Output-files
              • Abstract-syntax-operations
              • Implementation-environments
              • Abstract-syntax
              • Concrete-syntax
              • Disambiguation
              • Validation
              • 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
    • Mapping-to-language-definition

    Ldm-stor-spec-list

    Map a list of storage class specifiers to a storage class specifier sequence in the language definition.

    Signature
    (ldm-stor-spec-list stor-specs) → (mv erp scspecseq)
    Arguments
    stor-specs — Guard (stor-spec-listp stor-specs).
    Returns
    scspecseq — Type (c::scspecseqp scspecseq).

    The list must be empty, or a singleton with the extern specifier.

    Definitions and Theorems

    Function: ldm-stor-spec-list

    (defun ldm-stor-spec-list (stor-specs)
     (declare (xargs :guard (stor-spec-listp stor-specs)))
     (let ((__function__ 'ldm-stor-spec-list))
      (declare (ignorable __function__))
      (b* (((reterr) (c::scspecseq-none))
           (stor-specs (stor-spec-list-fix stor-specs)))
       (cond
        ((equal stor-specs nil)
         (retok (c::scspecseq-none)))
        ((equal stor-specs (list (stor-spec-extern)))
         (retok (c::scspecseq-extern)))
        (t (reterr
                (msg "Unsupported storage class specifier sequence ~x0."
                     stor-specs)))))))

    Theorem: scspecseqp-of-ldm-stor-spec-list.scspecseq

    (defthm scspecseqp-of-ldm-stor-spec-list.scspecseq
      (b* (((mv acl2::?erp ?scspecseq)
            (ldm-stor-spec-list stor-specs)))
        (c::scspecseqp scspecseq))
      :rule-classes :rewrite)

    Theorem: ldm-stor-spec-list-ok-when-stor-spec-list-formalp

    (defthm ldm-stor-spec-list-ok-when-stor-spec-list-formalp
      (implies (stor-spec-list-formalp stor-specs)
               (b* (((mv acl2::?erp ?scspecseq)
                     (ldm-stor-spec-list stor-specs)))
                 (not erp))))

    Theorem: ldm-stor-spec-list-of-stor-spec-list-fix-stor-specs

    (defthm ldm-stor-spec-list-of-stor-spec-list-fix-stor-specs
      (equal (ldm-stor-spec-list (stor-spec-list-fix stor-specs))
             (ldm-stor-spec-list stor-specs)))

    Theorem: ldm-stor-spec-list-stor-spec-list-equiv-congruence-on-stor-specs

    (defthm
       ldm-stor-spec-list-stor-spec-list-equiv-congruence-on-stor-specs
      (implies (stor-spec-list-equiv stor-specs stor-specs-equiv)
               (equal (ldm-stor-spec-list stor-specs)
                      (ldm-stor-spec-list stor-specs-equiv)))
      :rule-classes :congruence)