Match a list of source fields to some target fields.
(match-field-list inits sources targets ctxt) → (mv yes/no obligs rest-targets)
Function:
(defun match-field-list (inits sources targets ctxt) (declare (xargs :guard (and (initializer-listp inits) (type-listp sources) (field-listp targets) (contextp ctxt)))) (declare (xargs :guard (= (len inits) (len sources)))) (let ((__function__ 'match-field-list)) (declare (ignorable __function__)) (b* (((when (endp inits)) (mv t nil (field-list-fix targets))) (init (car inits)) (source (car sources)) ((mv okp first-obligs targets) (match-field init source targets ctxt)) ((when (not okp)) (mv nil nil nil)) ((mv okp rest-obligs targets) (match-field-list (cdr inits) (cdr sources) targets ctxt)) ((when (not okp)) (mv nil nil nil))) (mv t (append first-obligs rest-obligs) targets))))
Theorem:
(defthm booleanp-of-match-field-list.yes/no (b* (((mv ?yes/no ?obligs ?rest-targets) (match-field-list inits sources targets ctxt))) (booleanp yes/no)) :rule-classes :rewrite)
Theorem:
(defthm proof-obligation-listp-of-match-field-list.obligs (b* (((mv ?yes/no ?obligs ?rest-targets) (match-field-list inits sources targets ctxt))) (proof-obligation-listp obligs)) :rule-classes :rewrite)
Theorem:
(defthm field-listp-of-match-field-list.rest-targets (b* (((mv ?yes/no ?obligs ?rest-targets) (match-field-list inits sources targets ctxt))) (field-listp rest-targets)) :rule-classes :rewrite)
Theorem:
(defthm match-field-list-of-initializer-list-fix-inits (equal (match-field-list (initializer-list-fix inits) sources targets ctxt) (match-field-list inits sources targets ctxt)))
Theorem:
(defthm match-field-list-initializer-list-equiv-congruence-on-inits (implies (initializer-list-equiv inits inits-equiv) (equal (match-field-list inits sources targets ctxt) (match-field-list inits-equiv sources targets ctxt))) :rule-classes :congruence)
Theorem:
(defthm match-field-list-of-type-list-fix-sources (equal (match-field-list inits (type-list-fix sources) targets ctxt) (match-field-list inits sources targets ctxt)))
Theorem:
(defthm match-field-list-type-list-equiv-congruence-on-sources (implies (type-list-equiv sources sources-equiv) (equal (match-field-list inits sources targets ctxt) (match-field-list inits sources-equiv targets ctxt))) :rule-classes :congruence)
Theorem:
(defthm match-field-list-of-field-list-fix-targets (equal (match-field-list inits sources (field-list-fix targets) ctxt) (match-field-list inits sources targets ctxt)))
Theorem:
(defthm match-field-list-field-list-equiv-congruence-on-targets (implies (field-list-equiv targets targets-equiv) (equal (match-field-list inits sources targets ctxt) (match-field-list inits sources targets-equiv ctxt))) :rule-classes :congruence)
Theorem:
(defthm match-field-list-of-context-fix-ctxt (equal (match-field-list inits sources targets (context-fix ctxt)) (match-field-list inits sources targets ctxt)))
Theorem:
(defthm match-field-list-context-equiv-congruence-on-ctxt (implies (context-equiv ctxt ctxt-equiv) (equal (match-field-list inits sources targets ctxt) (match-field-list inits sources targets ctxt-equiv))) :rule-classes :congruence)