Check if an addition expression is well-formed.
(check-add-expression arg1 arg2 arg1-type arg2-type arg1-obligs arg2-obligs expr ctxt) → result
Function:
(defun check-add-expression (arg1 arg2 arg1-type arg2-type arg1-obligs arg2-obligs expr ctxt) (declare (xargs :guard (and (expressionp arg1) (expressionp arg2) (typep arg1-type) (typep arg2-type) (proof-obligation-listp arg1-obligs) (proof-obligation-listp arg2-obligs) (expressionp expr) (contextp ctxt)))) (let ((__function__ 'check-add-expression)) (declare (ignorable __function__)) (check-add/sub/mul-expression arg1 arg2 arg1-type arg2-type arg1-obligs arg2-obligs :type-mismatch-add expr ctxt)))
Theorem:
(defthm type-resultp-of-check-add-expression (b* ((result (check-add-expression arg1 arg2 arg1-type arg2-type arg1-obligs arg2-obligs expr ctxt))) (type-resultp result)) :rule-classes :rewrite)
Theorem:
(defthm check-add-expression-of-expression-fix-arg1 (equal (check-add-expression (expression-fix arg1) arg2 arg1-type arg2-type arg1-obligs arg2-obligs expr ctxt) (check-add-expression arg1 arg2 arg1-type arg2-type arg1-obligs arg2-obligs expr ctxt)))
Theorem:
(defthm check-add-expression-expression-equiv-congruence-on-arg1 (implies (expression-equiv arg1 arg1-equiv) (equal (check-add-expression arg1 arg2 arg1-type arg2-type arg1-obligs arg2-obligs expr ctxt) (check-add-expression arg1-equiv arg2 arg1-type arg2-type arg1-obligs arg2-obligs expr ctxt))) :rule-classes :congruence)
Theorem:
(defthm check-add-expression-of-expression-fix-arg2 (equal (check-add-expression arg1 (expression-fix arg2) arg1-type arg2-type arg1-obligs arg2-obligs expr ctxt) (check-add-expression arg1 arg2 arg1-type arg2-type arg1-obligs arg2-obligs expr ctxt)))
Theorem:
(defthm check-add-expression-expression-equiv-congruence-on-arg2 (implies (expression-equiv arg2 arg2-equiv) (equal (check-add-expression arg1 arg2 arg1-type arg2-type arg1-obligs arg2-obligs expr ctxt) (check-add-expression arg1 arg2-equiv arg1-type arg2-type arg1-obligs arg2-obligs expr ctxt))) :rule-classes :congruence)
Theorem:
(defthm check-add-expression-of-type-fix-arg1-type (equal (check-add-expression arg1 arg2 (type-fix arg1-type) arg2-type arg1-obligs arg2-obligs expr ctxt) (check-add-expression arg1 arg2 arg1-type arg2-type arg1-obligs arg2-obligs expr ctxt)))
Theorem:
(defthm check-add-expression-type-equiv-congruence-on-arg1-type (implies (type-equiv arg1-type arg1-type-equiv) (equal (check-add-expression arg1 arg2 arg1-type arg2-type arg1-obligs arg2-obligs expr ctxt) (check-add-expression arg1 arg2 arg1-type-equiv arg2-type arg1-obligs arg2-obligs expr ctxt))) :rule-classes :congruence)
Theorem:
(defthm check-add-expression-of-type-fix-arg2-type (equal (check-add-expression arg1 arg2 arg1-type (type-fix arg2-type) arg1-obligs arg2-obligs expr ctxt) (check-add-expression arg1 arg2 arg1-type arg2-type arg1-obligs arg2-obligs expr ctxt)))
Theorem:
(defthm check-add-expression-type-equiv-congruence-on-arg2-type (implies (type-equiv arg2-type arg2-type-equiv) (equal (check-add-expression arg1 arg2 arg1-type arg2-type arg1-obligs arg2-obligs expr ctxt) (check-add-expression arg1 arg2 arg1-type arg2-type-equiv arg1-obligs arg2-obligs expr ctxt))) :rule-classes :congruence)
Theorem:
(defthm check-add-expression-of-proof-obligation-list-fix-arg1-obligs (equal (check-add-expression arg1 arg2 arg1-type arg2-type (proof-obligation-list-fix arg1-obligs) arg2-obligs expr ctxt) (check-add-expression arg1 arg2 arg1-type arg2-type arg1-obligs arg2-obligs expr ctxt)))
Theorem:
(defthm check-add-expression-proof-obligation-list-equiv-congruence-on-arg1-obligs (implies (proof-obligation-list-equiv arg1-obligs arg1-obligs-equiv) (equal (check-add-expression arg1 arg2 arg1-type arg2-type arg1-obligs arg2-obligs expr ctxt) (check-add-expression arg1 arg2 arg1-type arg2-type arg1-obligs-equiv arg2-obligs expr ctxt))) :rule-classes :congruence)
Theorem:
(defthm check-add-expression-of-proof-obligation-list-fix-arg2-obligs (equal (check-add-expression arg1 arg2 arg1-type arg2-type arg1-obligs (proof-obligation-list-fix arg2-obligs) expr ctxt) (check-add-expression arg1 arg2 arg1-type arg2-type arg1-obligs arg2-obligs expr ctxt)))
Theorem:
(defthm check-add-expression-proof-obligation-list-equiv-congruence-on-arg2-obligs (implies (proof-obligation-list-equiv arg2-obligs arg2-obligs-equiv) (equal (check-add-expression arg1 arg2 arg1-type arg2-type arg1-obligs arg2-obligs expr ctxt) (check-add-expression arg1 arg2 arg1-type arg2-type arg1-obligs arg2-obligs-equiv expr ctxt))) :rule-classes :congruence)
Theorem:
(defthm check-add-expression-of-expression-fix-expr (equal (check-add-expression arg1 arg2 arg1-type arg2-type arg1-obligs arg2-obligs (expression-fix expr) ctxt) (check-add-expression arg1 arg2 arg1-type arg2-type arg1-obligs arg2-obligs expr ctxt)))
Theorem:
(defthm check-add-expression-expression-equiv-congruence-on-expr (implies (expression-equiv expr expr-equiv) (equal (check-add-expression arg1 arg2 arg1-type arg2-type arg1-obligs arg2-obligs expr ctxt) (check-add-expression arg1 arg2 arg1-type arg2-type arg1-obligs arg2-obligs expr-equiv ctxt))) :rule-classes :congruence)
Theorem:
(defthm check-add-expression-of-context-fix-ctxt (equal (check-add-expression arg1 arg2 arg1-type arg2-type arg1-obligs arg2-obligs expr (context-fix ctxt)) (check-add-expression arg1 arg2 arg1-type arg2-type arg1-obligs arg2-obligs expr ctxt)))
Theorem:
(defthm check-add-expression-context-equiv-congruence-on-ctxt (implies (context-equiv ctxt ctxt-equiv) (equal (check-add-expression arg1 arg2 arg1-type arg2-type arg1-obligs arg2-obligs expr ctxt) (check-add-expression arg1 arg2 arg1-type arg2-type arg1-obligs arg2-obligs expr ctxt-equiv))) :rule-classes :congruence)