• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Std
    • Community
    • Proof-automation
    • ACL2
    • Macro-libraries
    • 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
            • Parser
            • Validator
            • Printer
            • Formalized-subset
              • Expr-pure-formalp
              • Type-spec-list-integer-formalp
              • Stmts/blocks-formalp
              • Extdecl-formalp
              • Ident-formalp
              • Type-spec-list-formalp
              • Tyname-formalp
              • Pointers-formalp
              • Dirdeclor-obj-formalp
              • Desiniter-formalp
              • Fundef-formalp
              • Decl-obj-formalp
              • Decl-block-formalp
              • Initdeclor-obj-formalp
              • Expr-asg-formalp
                • Structdecl-formalp
                • Initdeclor-block-formalp
                • Decl-struct-formalp
                • Dirdeclor-fun-formalp
                • Dirdeclor-block-formalp
                • Initdeclor-fun-formalp
                • Transunit-ensemble-formalp
                • Param-declor-formalp
                • Initer-formalp
                • Expr-call-formalp
                • Declor-obj-formalp
                • Decl-fun-formalp
                • Param-declon-formalp
                • Structdeclor-formalp
                • Stor-spec-list-formalp
                • Declor-fun-formalp
                • Declor-block-formalp
                • Strunispec-formalp
                • Structdecl-list-formalp
                • Param-declon-list-formalp
                • Desiniter-list-formalp
                • Extdecl-list-formalp
                • Expr-list-pure-formalp
                • Transunit-formalp
                • Const-formalp
                • Stmt-formalp
                • Block-item-list-formalp
                • Block-item-formalp
              • 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
    • Formalized-subset

    Expr-asg-formalp

    Check if an expression has formal dynamic semantics, as an assignment expression.

    Signature
    (expr-asg-formalp expr) → yes/no
    Arguments
    expr — Guard (exprp expr).
    Returns
    yes/no — Type (booleanp yes/no).

    These are the expressions supported by c::exec-expr-asg. The expression must be a simple assignment expression. The sub-expressions must have formal dynamic semantics. The left expression must be pure. The right expression must be pure unless the left expression is an identifier, in which case the right expression may be a function call.

    Definitions and Theorems

    Function: expr-asg-formalp

    (defun expr-asg-formalp (expr)
     (declare (xargs :guard (exprp expr)))
     (declare (xargs :guard (expr-unambp expr)))
     (let ((__function__ 'expr-asg-formalp))
      (declare (ignorable __function__))
      (and
       (expr-case expr :binary)
       (binop-case (expr-binary->op expr) :asg)
       (if
        (expr-case (expr-binary->arg1 expr)
                   :ident)
        (and
            (ident-formalp (expr-ident->ident (expr-binary->arg1 expr)))
            (or (expr-pure-formalp (expr-binary->arg2 expr))
                (expr-call-formalp (expr-binary->arg2 expr))))
        (and (expr-pure-formalp (expr-binary->arg1 expr))
             (expr-pure-formalp (expr-binary->arg2 expr)))))))

    Theorem: booleanp-of-expr-asg-formalp

    (defthm booleanp-of-expr-asg-formalp
      (b* ((yes/no (expr-asg-formalp expr)))
        (booleanp yes/no))
      :rule-classes :rewrite)

    Theorem: expr-asg-formalp-of-expr-fix-expr

    (defthm expr-asg-formalp-of-expr-fix-expr
      (equal (expr-asg-formalp (expr-fix expr))
             (expr-asg-formalp expr)))

    Theorem: expr-asg-formalp-expr-equiv-congruence-on-expr

    (defthm expr-asg-formalp-expr-equiv-congruence-on-expr
      (implies (expr-equiv expr expr-equiv)
               (equal (expr-asg-formalp expr)
                      (expr-asg-formalp expr-equiv)))
      :rule-classes :congruence)