Parse string into a PFCS
(parse-def pfcs-string) → sys
Lexes, tokenizes, and parses a PFCS
If any step fails, returns a reserr.
The parse consumes the entire string or a reserr is returned.
If the parsed PFCS
Since ACL2 strings are sequences of characters with codes from 0 to 255,
Function:
(defun parse-def (pfcs-string) (declare (xargs :guard (stringp pfcs-string))) (let ((__function__ 'parse-def)) (declare (ignorable __function__)) (b* ((cst (parse-from-string-to-cst pfcs-string)) ((when (reserrp cst)) cst) (ast (abs-system cst)) ((when (reserrp ast)) (reserrf (cons :problem-abstracting cst))) (defs (system->definitions ast)) (constraints (system->constraints ast)) ((unless (and (consp defs) (null constraints))) (reserrf (cons :wrong-number-of-system-components cst)))) (first defs))))
Theorem:
(defthm definition-resultp-of-parse-def (b* ((sys (parse-def pfcs-string))) (definition-resultp sys)) :rule-classes :rewrite)