Notion of ambiguous string.
A string is ambiguous iff it has at least two distinct parse trees.
Theorem:
(defthm string-ambiguousp-suff (implies (and (not (equal tree1 tree2)) (parse-treep tree1 string rulename rules) (parse-treep tree2 string rulename rules)) (string-ambiguousp string rulename rules)))
Theorem:
(defthm booleanp-of-string-ambiguousp (b* ((yes/no (string-ambiguousp string rulename rules))) (booleanp yes/no)) :rule-classes :rewrite)
Theorem:
(defthm string-ambiguousp-of-string-fix-string (equal (string-ambiguousp (string-fix string) rulename rules) (string-ambiguousp string rulename rules)))
Theorem:
(defthm string-ambiguousp-string-equiv-congruence-on-string (implies (string-equiv string string-equiv) (equal (string-ambiguousp string rulename rules) (string-ambiguousp string-equiv rulename rules))) :rule-classes :congruence)
Theorem:
(defthm string-ambiguousp-of-rulename-fix-rulename (equal (string-ambiguousp string (rulename-fix rulename) rules) (string-ambiguousp string rulename rules)))
Theorem:
(defthm string-ambiguousp-rulename-equiv-congruence-on-rulename (implies (rulename-equiv rulename rulename-equiv) (equal (string-ambiguousp string rulename rules) (string-ambiguousp string rulename-equiv rules))) :rule-classes :congruence)
Theorem:
(defthm string-ambiguousp-of-rulelist-fix-rules (equal (string-ambiguousp string rulename (rulelist-fix rules)) (string-ambiguousp string rulename rules)))
Theorem:
(defthm string-ambiguousp-rulelist-equiv-congruence-on-rules (implies (rulelist-equiv rules rules-equiv) (equal (string-ambiguousp string rulename rules) (string-ambiguousp string rulename rules-equiv))) :rule-classes :congruence)
Theorem:
(defthm string-parsablep-when-string-ambiguousp (implies (string-ambiguousp string rulename rules) (string-parsablep string rulename rules)))
Theorem:
(defthm at-most-one-parse-tree-when-not-string-ambiguousp (implies (and (not (string-ambiguousp string rulename rules)) (parse-treep tree1 string rulename rules) (parse-treep tree2 string rulename rules)) (equal tree1 tree2)) :rule-classes nil)