;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -*- Mode: Lisp -*- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; metit.lisp -- ;; Author : W. Denman ;; Created On : Mar. 27, 2010 ;; Last Modified By: C. Munoz ;; Last Modified On: Jun. 1, 2013 ;; Update Count : ;; Status : Beta stable ;; Thanks to Viorel Preoteasaa <viorel.preoteasa@abo.fi> for comments and bug fixes. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; -------------------------------------------------------------------- ;; PVS ;; Copyright (C) 2006, SRI International. All Rights Reserved.
;; This program is free software; you can redistribute it and/or ;; modify it under the terms of the GNU General Public License ;; as published by the Free Software Foundation; either version 2 ;; of the License, or (at your option) any later version.
;; This program is distributed in the hope that it will be useful, ;; but WITHOUT ANY WARRANTY; without even the implied warranty of ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ;; GNU General Public License for more details.
;; You should have received a copy of the GNU General Public License ;; along with this program; if not, write to the Free Software ;; Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ;; --------------------------------------------------------------------
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; Input is a name-expr and a list of bindings of the form ;; (("Y" . Y2) ("X" . X1)). The bindings are set in translate-metit-bindings ;; Since the metit-named bounded variables travel in the bindings list, when we get ;; the named variable in an expression return the cdr that ;; holds the variable name. Otherwise we have a constant symbol (such as pi) and call ;; metit-interpretation. ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ;; The PVS variables are converted into a MetiTarski representation (uppercase) and are ;; made distinct by appending *metit-id-counter*. This is required because a user ;; might use both cases in a specification and we need to differentiate between x and X. ;; In this case they would be converted to X1 and X2. ;;
;; ;; translate-metit-bindings : Go through a list of bind declarations and create a ;; bind list with their new metit names. tc-eq ensures we only have real variables. ;;
(defun translate-metit-bindings (bind-decls bindings accum)
(cond ((consp bind-decls)
(if (tc-eq (type (car bind-decls)) *real*)
(let ((yname (metit-id-name (id (car bind-decls)))))
(translate-metit-bindings (cdr bind-decls) ;;making bindings here
(cons (cons (string (id (car bind-decls)))
yname)
bindings)
(cons yname accum)))
(error"type of ~a must be real." (id (car bind-decls)))))
(t (values bindings (nreverse accum)))))
;; ;; metit-interpretation : Translate pvs symbol to the MetiTarski representation. Ensures ;; that the resolution (the real meaning of the symbol) is what we want. This is due ;; to the massive overloading in PVS (anything can be overloaded). ;; Answers the question: is + actually the + for the reals? ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; lift-predicates-in-quantifier takes the constraints on the variables (p1 : posreal) ;; and converts it into the proper logical form p1 > 0 & p1 >= 0 and returns ;; a new expression with these propositional atoms in the antecedent ;; ;; The we recursively call translate-metit-bindings to build a cons list of bindvars ;; ((p1 : real. P11)) ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defrule metit (&optional (fnums 1) (timeout 60) options arch about?)
(if (check-name "DisableMetiTarski__")
(printf "MetiTarski has been disabled because MetiTarski@Disable appears in the chain of imported theories.")
(if (is-disabled-oracle 'MetiTarski)
(printf "MetiTarski has been disabled.")
(let ((s-forms (extra-get-seqfs fnums)))
(if s-forms
(let ((result (metit s-forms timeout options arch about?)))
(when result
(trust MetiTarski (case"TRUE") !)))
(printf "Formula(s) ~a not found" fnums))))) "Calls MetiTarski on first order formulas FNUMS. TIMEOUT is a processor time limit
(in seconds). Additional options to MetiTarski can be provided through OPTIONS.
Executables of MetiTarski and z3 are pre-intstalled in the NASA PVS Library.*
By default, the strategy tries to use the versions of MetiTarski and z3 installed
in the system. If the executables are not in the path, the pre-installed versions
are tried. The option ARCH forces the strategy to use the pre-installed version for
a given architecture. If ABOUT? is set to t, the strategy prints information about
MetiTarski and z3 and then exits.
MetiTarski requires an external algebraic decision method (EADM). The default EADM
is z3. However, other EADM are also supported, e.g., QEP and Mathematica. See
MetiTarski's documentation for information about using a different EADM.
If current theory imports MetiTarski@Disable, metit does nothing.
* The files METIT-LICENSE.txt and Z3-LICENSE.txt in nasalib/MetiTarski/dist
contains MetiTarski's and z3's license of use, respectively." "~%Proving formula(s) ~a with MetiTarski")
¤ Dauer der Verarbeitung: 0.15 Sekunden
(vorverarbeitet)
¤
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.