Recognizer for twisted-edwards-curve structures.
(twisted-edwards-curvep x) → *
Function:
(defun twisted-edwards-curvep (x) (declare (xargs :guard t)) (let ((acl2::__function__ 'twisted-edwards-curvep)) (declare (ignorable acl2::__function__)) (and (mbe :logic (and (alistp x) (equal (strip-cars x) '(p a d))) :exec (fty::alist-with-carsp x '(p a d))) (b* ((p (cdr (std::da-nth 0 x))) (?a (cdr (std::da-nth 1 x))) (?d (cdr (std::da-nth 2 x)))) (and (natp p) (dm::primep p) (> p 2) (fep a p) (fep d p) (not (equal a d)) (not (equal a 0)) (not (equal d 0)))))))
Theorem:
(defthm consp-when-twisted-edwards-curvep (implies (twisted-edwards-curvep x) (consp x)) :rule-classes :compound-recognizer)