• 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
        • Soft
        • C
          • Syntax-for-tools
            • Disambiguator
            • Parser
            • Validator
            • Printer
            • Formalized-subset
            • Mapping-to-language-definition
            • Input-files
            • Defpred
            • Output-files
            • Abstract-syntax-operations
            • Validation-information
            • Concrete-syntax
            • Ascii-identifiers
            • Unambiguity
            • Preprocessing
            • Abstract-syntax
              • Abstract-syntax-trees
                • Expr
                  • Exprp
                  • Expr-case
                  • Expr-binary
                  • Expr-kind
                  • Expr-unary
                  • Expr-equiv
                  • Expr-cond
                  • Expr-complit
                  • Expr-cast/sub-ambig
                  • Expr-cast/mul-ambig
                  • Expr-cast/call-ambig
                  • Expr-cast/and-ambig
                  • Expr-cast/add-ambig
                  • Expr-va-arg
                  • Expr-tycompat
                  • Expr-offsetof
                  • Expr-memberp
                  • Expr-member
                  • Expr-ident
                  • Expr-gensel
                  • Expr-funcall
                  • Expr-comma
                  • Expr-cast
                  • Expr-arrsub
                  • Expr-alignof
                  • Expr-string
                  • Expr-stmt
                  • Expr-sizeof-ambig
                  • Expr-sizeof
                  • Expr-paren
                  • Expr-extension
                  • Expr-const
                    • Make-expr-const
                    • Expr-const->const
                      • Change-expr-const
                    • Expr-fix
                    • Expr-count
                  • Exprs/decls/stmts
                  • Type-spec
                  • Binop
                  • Stmt
                  • Amb-expr/tyname
                  • 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
                  • Tyname
                  • Absdeclor
                  • Struni-spec
                  • Stor-spec
                  • Keyword-uscores
                  • Align-spec
                  • Label
                  • Expr-option
                  • Spec/qual
                  • Lsuffix
                  • Hex-frac-const
                  • Desiniter
                  • 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
                  • Block-item
                  • Hex-quad
                  • Eprefix
                  • Const-expr
                  • 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
                  • Q-char
                  • Iconst-option
                  • H-char
                  • 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
                  • Q-char-list
                  • Initdeclor-list
                  • H-char-list
                  • Genassoc-list
                  • Filepath-transunit-map
                  • Extdecl-list
                  • Enumer-list
                  • Attrib-spec-list
                  • Type-spec-list
                  • Ident-list
                  • Expr-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
                • Abstract-syntax-irrelevants
                • Abstraction-mapping
              • Implementation-environments
              • Standard
              • Gcc-builtins
              • Purity
            • Atc
            • Language
            • Transformation-tools
            • Representation
            • Insertion-sort
            • Pack
          • Bv
          • Imp-language
          • Event-macros
          • Java
          • Riscv
          • 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
    • Expr-const

    Expr-const->const

    Get the const field from a expr-const.

    Signature
    (expr-const->const x) → const
    Arguments
    x — Guard (exprp x).
    Returns
    const — Type (constp const).

    This is an ordinary field accessor created by fty::defprod.

    Definitions and Theorems

    Function: expr-const->const$inline

    (defun expr-const->const$inline (x)
      (declare (xargs :guard (exprp x)))
      (declare (xargs :guard (equal (expr-kind x) :const)))
      (let ((__function__ 'expr-const->const))
        (declare (ignorable __function__))
        (mbe :logic
             (b* ((x (and (equal (expr-kind x) :const) x)))
               (const-fix (std::da-nth 0 (cdr x))))
             :exec (std::da-nth 0 (cdr x)))))

    Theorem: constp-of-expr-const->const

    (defthm constp-of-expr-const->const
      (b* ((const (expr-const->const$inline x)))
        (constp const))
      :rule-classes :rewrite)

    Theorem: expr-const->const$inline-of-expr-fix-x

    (defthm expr-const->const$inline-of-expr-fix-x
      (equal (expr-const->const$inline (expr-fix x))
             (expr-const->const$inline x)))

    Theorem: expr-const->const$inline-expr-equiv-congruence-on-x

    (defthm expr-const->const$inline-expr-equiv-congruence-on-x
      (implies (expr-equiv x x-equiv)
               (equal (expr-const->const$inline x)
                      (expr-const->const$inline x-equiv)))
      :rule-classes :congruence)

    Theorem: expr-const->const-when-wrong-kind

    (defthm expr-const->const-when-wrong-kind
      (implies (not (equal (expr-kind x) :const))
               (equal (expr-const->const x)
                      (const-fix nil))))