(defun tarski-valid-forms (exprs vars &optional strict)
(setq *tarski-invalid-forms* nil)
(setq *sturm-var* nil)
(extra-reset-evalexprs)
(tarski-valid-forms-rec exprs vars strict nil))
(defstep tarski (&optional (fnums *) var (preds? t) dont-fail?)
(let ((fns (extra-get-fnums fnums))
(fn (if (equal (length fns) 1) (car fns) 0))
(expr (when (/= fn 0)
(let ((e (extra-get-formula-from-fnum fn)))
(if preds? (lift-predicates-in-quantifier e (list *real*)) e))))
(quant (cond ((forall-expr? expr) 1)
((exists-expr? expr) -1)
(t 0))) ;; forall: quant > 0, exists: quant < 0, none: 0
(vars (if (/= quant 0)
(mapcar #'(lambda (x) (format nil "~a" (id x)))
(bindings (extra-get-formula-from-fnum fn)))
(enlist-it var)))
(fall (>= (* fn quant) 0))
(unqexpr (when (/= quant 0) (expression expr)))
(conjs (if (/= quant 0)
(let ((exprs (get-ands-expr unqexpr (< quant 0))))
(tarski-valid-forms exprs vars (not fall)))
(let ((exprs (get-ands-expr
(mk-disjunction (mapcar #'formula (extra-get-seqfs fns))) nil)))
(tarski-valid-forms exprs vars))))
(invfms *tarski-invalid-forms*)
(tkvar *sturm-var*)
(qvars (when (/= quant 0) vars))
(msg (cond ((null tkvar)
(format nil"No variable found in formulas ~a." fnums))
((null conjs)
(format nil"The following formula doesn't belong to a system of polynomial constraints on ~a
supported by this strategy:~%~{~a~%~}"
tkvar invfms))
((and (< (* fn quant) 0) (> (length qvars) 1))
(format nil"Formula ~a is not simply quantified." fn))
((not (check-name "TarskiStrategy__"))
(format nil"This strategy requires importing Tarski@strategies.")))))
(if msg
(printf "~a" msg)
(then
(tarski__$ fnums fall conjs tkvar qvars preds?)
(when invfms
(printf "The following formulas don't belong to a system of polynomials constraints on ~a and were not considered by this strategy:~%~{~a~%~}"
tkvar invfms))
(printf "Sequent formed by formulas in ~a~:[, without considering typing information, may not~; doesn't~] hold.~%"
fnums preds?)
(unless dont-fail? (fail))))) "[Tarski] Applies decision procedure for univariate polynomial based on Tarski's Theorem
to formulas in FNUM. Each formula denoted by FNUM is expected to have the form pi Ri qi,
where pi and qi are polynomials on variable VAR and Ri is a relation in {<,<=,>,>=,=,/=}. If FNUM denotes a simply quantified formula, that formula is expected to have one of the forms
- EXISTS (VAR:real) : p0 R0 q0 AND ... AND pn Rn qn
- FORALL (VAR:real) : p0 R0 q0 AND ... AND pi Ri qi IMPLIES pj Rj qj OR ... OR pn Rn qn. If variable VAR is not provided, it is inferred by the strategy from the formulas in FNUM. Type
predicates are introduced as hypotheses when PREDS? is t. If DONT-FAIL? is set to t,
strategy skips instead of failing when sequent cannot be discharged." "Applying Tarski's Theorem to sequent formed by formulas in ~a")
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.