Check if a PFCS is an R1CS.
There must be no definitions, and all the constraints must be in R1CS form.
Function:
(defun r1cs-systemp (sys) (declare (xargs :guard (systemp sys))) (let ((__function__ 'r1cs-systemp)) (declare (ignorable __function__)) (and (endp (system->definitions sys)) (r1cs-constraint-listp (system->constraints sys)))))
Theorem:
(defthm booleanp-of-r1cs-systemp (b* ((yes/no (r1cs-systemp sys))) (booleanp yes/no)) :rule-classes :rewrite)
Theorem:
(defthm r1cs-systemp-of-system-fix-sys (equal (r1cs-systemp (system-fix sys)) (r1cs-systemp sys)))
Theorem:
(defthm r1cs-systemp-system-equiv-congruence-on-sys (implies (system-equiv sys sys-equiv) (equal (r1cs-systemp sys) (r1cs-systemp sys-equiv))) :rule-classes :congruence)