Check if a finite set of trees is the set of all and only the parse trees of a string.
If this is true, then the string has a finite number of parse trees.
Theorem:
(defthm parse-trees-of-string-p-necc0 (implies (parse-trees-of-string-p trees string rulename rules) (iff (in tree (tree-set-fix trees)) (parse-treep tree string rulename rules))))
Theorem:
(defthm booleanp-of-parse-trees-of-string-p (b* ((yes/no (parse-trees-of-string-p trees string rulename rules))) (booleanp yes/no)) :rule-classes :rewrite)
Theorem:
(defthm parse-trees-of-string-p-necc (implies (and (parse-trees-of-string-p trees string rulename rules) (tree-setp trees)) (iff (in tree trees) (parse-treep tree string rulename rules))))
Theorem:
(defthm parse-trees-of-string-p-of-tree-set-fix-trees (equal (parse-trees-of-string-p (tree-set-fix trees) string rulename rules) (parse-trees-of-string-p trees string rulename rules)))
Theorem:
(defthm parse-trees-of-string-p-tree-set-equiv-congruence-on-trees (implies (tree-set-equiv trees trees-equiv) (equal (parse-trees-of-string-p trees string rulename rules) (parse-trees-of-string-p trees-equiv string rulename rules))) :rule-classes :congruence)
Theorem:
(defthm parse-trees-of-string-p-of-string-fix-string (equal (parse-trees-of-string-p trees (string-fix string) rulename rules) (parse-trees-of-string-p trees string rulename rules)))
Theorem:
(defthm parse-trees-of-string-p-string-equiv-congruence-on-string (implies (string-equiv string string-equiv) (equal (parse-trees-of-string-p trees string rulename rules) (parse-trees-of-string-p trees string-equiv rulename rules))) :rule-classes :congruence)
Theorem:
(defthm parse-trees-of-string-p-of-rulename-fix-rulename (equal (parse-trees-of-string-p trees string (rulename-fix rulename) rules) (parse-trees-of-string-p trees string rulename rules)))
Theorem:
(defthm parse-trees-of-string-p-rulename-equiv-congruence-on-rulename (implies (rulename-equiv rulename rulename-equiv) (equal (parse-trees-of-string-p trees string rulename rules) (parse-trees-of-string-p trees string rulename-equiv rules))) :rule-classes :congruence)
Theorem:
(defthm parse-trees-of-string-p-of-rulelist-fix-rules (equal (parse-trees-of-string-p trees string rulename (rulelist-fix rules)) (parse-trees-of-string-p trees string rulename rules)))
Theorem:
(defthm parse-trees-of-string-p-rulelist-equiv-congruence-on-rules (implies (rulelist-equiv rules rules-equiv) (equal (parse-trees-of-string-p trees string rulename rules) (parse-trees-of-string-p trees string rulename rules-equiv))) :rule-classes :congruence)
Theorem:
(defthm at-most-one-parse-tree-set-of-string (implies (and (tree-setp trees1) (tree-setp trees2) (parse-trees-of-string-p trees1 string rulename rules) (parse-trees-of-string-p trees2 string rulename rules)) (equal trees1 trees2)) :rule-classes nil)
Theorem:
(defthm parse-trees-of-string-p-when-not-string-parsablep (implies (and (not (string-parsablep string rulename rules)) (tree-setp trees)) (equal (parse-trees-of-string-p trees string rulename rules) (equal trees nil))))
Theorem:
(defthm not-string-parsablep-when-parse-trees-of-string-p-of-nil (implies (parse-trees-of-string-p nil string rulename rules) (not (string-parsablep string rulename rules))))
Theorem:
(defthm parse-trees-of-string-p-when-string-unambiguousp (implies (and (string-unambiguousp string rulename rules) (tree-setp trees)) (equal (parse-trees-of-string-p trees string rulename rules) (equal trees (insert (string-parsablep-witness string rulename rules) nil)))))
Theorem:
(defthm string-unambiguousp-when-parse-trees-of-string-p-of-one (implies (and (parse-trees-of-string-p (insert tree nil) string rulename rules) (treep tree)) (string-unambiguousp string rulename rules)))