• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
      • Apt
      • Zfc
      • Acre
      • Milawa
      • Smtlink
      • Abnf
      • Vwsim
      • Isar
      • Wp-gen
      • Dimacs-reader
      • Pfcs
      • Legacy-defrstobj
      • C
        • Syntax-for-tools
        • Atc
        • Transformation-tools
          • Simpadd0
          • Proof-generation
            • Xeq-fundef
            • Xeq-expr-cond
            • Xeq-expr-binary
            • Xeq-block-item-list-cons
            • Xeq-stmt-ifelse
            • Xeq-expr-const
            • Xeq-declon-declon
            • Gen-param-thms
            • Gen-from-params
            • Gout
            • Gen-block-item-list-thm
            • Xeq-stmt-while
            • Xeq-stmt-dowhile
            • Gin
            • Xeq-expr-ident
            • Gen-block-item-thm
            • Xeq-stmt-if
            • Xeq-expr-cast
            • Gen-initer-single-thm
            • Gen-init-scope-thm
            • Gen-expr-thm
            • Gen-declon-thm
            • Xeq-expr-unary
            • Gen-stmt-thm
            • Xeq-stmt-return
            • Xeq-stmt-expr
            • Xeq-block-item-declon
            • Xeq-block-item-stmt
            • Xeq-stmt-compound
            • Xeq-initer-single
              • Gen-thm-name
              • Gin-update
              • Gen-var-assertions
              • Tyspecseq-to-type
              • Xeq-block-item-list-empty
              • Gout-no-thm
              • Irr-gout
            • Split-gso
            • Wrap-fn
            • Constant-propagation
            • Specialize
            • Split-fn
            • Split-fn-when
            • Split-all-gso
            • Copy-fn
            • Variables-in-computation-states
            • Rename
            • Utilities
            • Proof-generation-theorems
            • Input-processing
          • Language
          • Representation
          • Insertion-sort
          • Pack
        • Proof-checker-array
        • Soft
        • Farray
        • Rp-rewriter
        • Instant-runoff-voting
        • Imp-language
        • Sidekick
        • Ethereum
        • Leftist-trees
        • Java
        • Riscv
        • Taspi
        • Bitcoin
        • Zcash
        • Des
        • X86isa
        • Sha-2
        • Yul
        • Proof-checker-itp13
        • Regex
        • ACL2-programming-language
        • Json
        • Jfkr
        • Equational
        • Cryptography
        • Axe
        • Poseidon
        • Where-do-i-place-my-book
        • Aleo
        • Bigmems
        • Builtins
        • Execloader
        • Solidity
        • Paco
        • Concurrent-programs
        • Bls12-377-curves
      • Debugging
      • Community
      • Std
      • Proof-automation
      • Macro-libraries
      • ACL2
      • Interfacing-tools
      • Hardware-verification
      • Software-verification
      • Math
      • Testing-utilities
    • Proof-generation

    Xeq-initer-single

    Equality lifting transformation of an initializer consisting of a single expression.

    Signature
    (xeq-initer-single expr expr-new expr-thm-name gin) 
      → 
    (mv initer gout)
    Arguments
    expr — Guard (exprp expr).
    expr-new — Guard (exprp expr-new).
    expr-thm-name — Guard (symbolp expr-thm-name).
    gin — Guard (ginp gin).
    Returns
    initer — Type (initerp initer).
    gout — Type (goutp gout).

    Definitions and Theorems

    Function: xeq-initer-single

    (defun xeq-initer-single (expr expr-new expr-thm-name gin)
     (declare (xargs :guard (and (exprp expr)
                                 (exprp expr-new)
                                 (symbolp expr-thm-name)
                                 (ginp gin))))
     (declare (xargs :guard (and (expr-unambp expr)
                                 (expr-annop expr)
                                 (expr-unambp expr-new)
                                 (expr-annop expr-new))))
     (let ((__function__ 'xeq-initer-single))
      (declare (ignorable __function__))
      (b*
       (((gin gin) gin)
        (initer (initer-single expr))
        (initer-new (initer-single expr-new))
        ((unless expr-thm-name)
         (mv initer-new (gout-no-thm gin)))
        ((mv & old-expr) (ldm-expr expr))
        ((mv & new-expr) (ldm-expr expr-new))
        (hints
         (cons
          (cons
           '"Goal"
           (cons
            ':in-theory
            (cons
             ''((:e c::initer-kind)
                (:e c::initer-single)
                (:e c::initer-single->get)
                (:e c::expr-kind)
                (:e c::expr-binary->op)
                (:e c::binop-kind)
                (:e c::type-nonchar-integerp)
                initer-compustate-vars)
             (cons
              ':use
              (cons
               (cons
                (cons ':instance
                      (cons expr-thm-name '((limit (1- limit)))))
                (cons
                 (cons
                  ':instance
                  (cons
                   'initer-single-congruence
                   (cons
                    (cons 'old-expr
                          (cons (cons 'quote (cons old-expr 'nil))
                                'nil))
                    (cons (cons 'new-expr
                                (cons (cons 'quote (cons new-expr 'nil))
                                      'nil))
                          'nil))))
                 (cons
                  (cons
                   ':instance
                   (cons
                    'initer-single-errors
                    (cons (cons 'expr
                                (cons (cons 'quote (cons old-expr 'nil))
                                      'nil))
                          '((fenv old-fenv)))))
                  'nil)))
               'nil)))))
          'nil))
        ((mv thm-event thm-name thm-index)
         (gen-initer-single-thm initer initer-new gin.vartys
                                gin.const-new gin.thm-index hints)))
       (mv initer-new
           (make-gout :events (cons thm-event gin.events)
                      :thm-index thm-index
                      :thm-name thm-name
                      :vartys gin.vartys)))))

    Theorem: initerp-of-xeq-initer-single.initer

    (defthm initerp-of-xeq-initer-single.initer
      (b* (((mv ?initer ?gout)
            (xeq-initer-single expr expr-new expr-thm-name gin)))
        (initerp initer))
      :rule-classes :rewrite)

    Theorem: goutp-of-xeq-initer-single.gout

    (defthm goutp-of-xeq-initer-single.gout
      (b* (((mv ?initer ?gout)
            (xeq-initer-single expr expr-new expr-thm-name gin)))
        (goutp gout))
      :rule-classes :rewrite)

    Theorem: initer-unambp-of-xeq-initer-single

    (defthm initer-unambp-of-xeq-initer-single
      (implies
           (expr-unambp expr-new)
           (b* (((mv ?initer ?gout)
                 (xeq-initer-single expr expr-new expr-thm-name gin)))
             (initer-unambp initer))))

    Theorem: initer-annop-of-xeq-initer-single

    (defthm initer-annop-of-xeq-initer-single
      (implies
           (expr-annop expr-new)
           (b* (((mv ?initer ?gout)
                 (xeq-initer-single expr expr-new expr-thm-name gin)))
             (initer-annop initer))))

    Theorem: initer-aidentp-of-xeq-initer-single

    (defthm initer-aidentp-of-xeq-initer-single
      (implies
           (expr-aidentp expr-new gcc)
           (b* (((mv ?initer ?gout)
                 (xeq-initer-single expr expr-new expr-thm-name gin)))
             (initer-aidentp initer gcc))))