aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorroot <root@localhost.(none)>2009-04-05 01:09:27 +0000
committerroot <root@localhost.(none)>2009-04-05 01:09:27 +0000
commit5c6a5a3d707c01b7e8d084d0e6790eb1b6a59d2b (patch)
tree814e280af798ec29e500b21113a8de48ecceca89
parentTo main tree (diff)
downloadsci-5c6a5a3d707c01b7e8d084d0e6790eb1b6a59d2b.tar.gz
sci-5c6a5a3d707c01b7e8d084d0e6790eb1b6a59d2b.tar.bz2
sci-5c6a5a3d707c01b7e8d084d0e6790eb1b6a59d2b.zip
frama-c and why + dependencies new ebuilds
-rw-r--r--sci-mathematics/apron/Manifest4
-rw-r--r--sci-mathematics/apron/apron-0.9.9.ebuild88
-rw-r--r--sci-mathematics/apron/files/apron-0.9.9-doc.patch1542
-rw-r--r--sci-mathematics/apron/files/apron-0.9.9-ppl.patch318
-rw-r--r--sci-mathematics/frama-c/Manifest5
-rw-r--r--sci-mathematics/frama-c/files/frama-c-20081201-states_hook.patch90
-rw-r--r--sci-mathematics/frama-c/files/frama-c-20081201-stmt_deps.patch206
-rw-r--r--sci-mathematics/frama-c/frama-c-20081201-r1.ebuild87
-rw-r--r--sci-mathematics/frama-c/frama-c-20081201.ebuild74
-rw-r--r--sci-mathematics/gappa/Manifest2
-rw-r--r--sci-mathematics/gappa/gappa-0.11.0.ebuild55
-rw-r--r--sci-mathematics/gappalib-coq/Manifest2
-rw-r--r--sci-mathematics/gappalib-coq/gappalib-coq-0.11.ebuild37
-rw-r--r--sci-mathematics/ltl2ba/Manifest2
-rw-r--r--sci-mathematics/ltl2ba/ltl2ba-1.1.ebuild29
-rw-r--r--sci-mathematics/pff/Manifest2
-rw-r--r--sci-mathematics/pff/pff-8.2.1.2.ebuild36
-rw-r--r--sci-mathematics/pvs/Manifest6
-rw-r--r--sci-mathematics/pvs/files/pvs-4.2-patch-bddp860
-rw-r--r--sci-mathematics/pvs/files/pvs-4.2-patch-make52
-rw-r--r--sci-mathematics/pvs/files/pvs-4.2-patch-sbcl6847
-rw-r--r--sci-mathematics/pvs/pvs-4.2-r1.ebuild83
-rw-r--r--sci-mathematics/pvs/pvs-4.2.ebuild46
-rw-r--r--sci-mathematics/why/Manifest2
-rw-r--r--sci-mathematics/why/why-2.17.ebuild50
25 files changed, 10525 insertions, 0 deletions
diff --git a/sci-mathematics/apron/Manifest b/sci-mathematics/apron/Manifest
new file mode 100644
index 000000000..7d897767f
--- /dev/null
+++ b/sci-mathematics/apron/Manifest
@@ -0,0 +1,4 @@
+AUX apron-0.9.9-doc.patch 64468 RMD160 caa0822b7a166120d4005aaffc306a2a87934829 SHA1 6ec06db79955cb75b9d136e8f3b837ce242c301c SHA256 0c837cc92f67c8ceb6421daae490113f0b6f4cda5b03839b06fd23b6504b1e20
+AUX apron-0.9.9-ppl.patch 10288 RMD160 f2863bd448859a6f32b8a0dec74c4aad28a7b241 SHA1 633d30d09f909c9745ac4b7a2511b313c7388fb2 SHA256 efbb85f5a4412f210becc7ecf91772996f4bbc938e3628ad29ed8f6d33d88819
+DIST apron-0.9.9.tgz 1442889 RMD160 9b9081b4e7b442198975baffc7febf45073381e9 SHA1 31a607622c325869006eff21c2708f37448a7290 SHA256 f016e0b6d24feb7f75c0a0af370bf9d4bd512b86733c7abf25a12f6350718680
+EBUILD apron-0.9.9.ebuild 2357 RMD160 6261a2d30cbe64fbc45dc63c5c24b8219f9a3b8e SHA1 23a99a9b94caba37dca7191676324a8e12fc6a36 SHA256 09fe90643ccebab980b4584b4300f065f2b222d77d588bc2498a4386224f859c
diff --git a/sci-mathematics/apron/apron-0.9.9.ebuild b/sci-mathematics/apron/apron-0.9.9.ebuild
new file mode 100644
index 000000000..c37dac3ec
--- /dev/null
+++ b/sci-mathematics/apron/apron-0.9.9.ebuild
@@ -0,0 +1,88 @@
+# Copyright 1999-2009 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: Exp $
+
+inherit eutils toolchain-funcs
+
+DESCRIPTION="The APRON library is dedicated to the static analysis of the numerical variables of a program by Abstract Interpretation"
+HOMEPAGE="http://apron.cri.ensmp.fr/library/"
+SRC_URI="http://apron.cri.ensmp.fr/library/${P}.tgz"
+
+LICENSE="LGPL-2 GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~ppc ~sparc ~x86"
+IUSE="cxx doc ocaml ppl"
+
+RDEPEND="dev-libs/gmp
+ dev-libs/mpfr
+ ocaml? ( >=dev-lang/ocaml-3.09
+ dev-ml/camlidl )
+ ppl? ( dev-libs/ppl )"
+DEPEND="${RDEPEND}
+ doc? ( app-text/texlive
+ app-text/ghostscript-gpl
+ cxx? ( app-doc/doxygen ) )"
+
+src_unpack() {
+ unpack ${A}
+ cd ${S}
+
+ epatch "${FILESDIR}/${P}-ppl.patch"
+ epatch "${FILESDIR}/${P}-doc.patch"
+
+ mv Makefile.config.model Makefile.config
+ sed -i Makefile.config \
+ -e "s/FLAGS = \\\/FLAGS += \\\/g" \
+ -e "s/-O3 -DNDEBUG/-DNDEBUG/g" \
+ -e "s/APRON_PREFIX = \/usr/APRON_PREFIX = \${DESTDIR}\/usr/g" \
+ -e "s/MLGMPIDL_PREFIX = \/usr\/local/MLGMPIDL_PREFIX = \${DESTDIR}\/usr/g"
+ sed -i apronxx/doc/Doxyfile \
+ -e "s/OUTPUT_DIRECTORY = \/.*/OUTPUT_DIRECTORY = .\//g" \
+ -e "s/STRIP_FROM_PATH = \/.*/STRIP_FROM_PATH = .\//g"
+
+ if use doc; then
+ #we just create the pdf manuals
+ sed -i Makefile -e "s/; make html/; make/g"
+ fi
+
+ if [[ "$(gcc-major-version)" == "4" ]]; then
+ sed -i -e "s/# HAS_LONG_DOUBLE = 1/HAS_LONG_DOUBLE = 1/g" Makefile.config
+ fi
+ if use !ocaml; then
+ sed -i -e "s/HAS_OCAML = 1/HAS_OCAML = 0/g" Makefile.config
+ fi
+ if use ppl; then
+ sed -i -e "s/# HAS_PPL = 1/HAS_PPL = 1/g" Makefile.config
+ fi
+ if use cxx && use ppl; then
+ sed -i -e "s/# HAS_CPP = 1/HAS_CPP = 1/g" Makefile.config
+ else
+ die "USE flag 'cxx' needs USE flag 'ppl' set"
+ fi
+}
+
+src_compile() {
+ emake || emake #dirty hack because of a crappy makefile
+ emake || die "emake failed"
+
+ if use doc; then
+ emake doc || "emake doc failed"
+ fi
+}
+
+src_install(){
+ emake install DESTDIR="${D}" || die "emake install failed"
+ dodoc AUTHORS Changes COPYING README
+
+ if use doc; then
+ dodoc ./apron/apron.pdf
+ if use ocaml; then
+ dodoc ./mlgmpidl/mlgmpidl.pdf ./mlapronidl/mlapronidl.pdf
+ fi
+ if use cxx; then
+ mv ./apronxx/doc/latex/refman.pdf ./apronxx/apronxx.pdf
+ dodoc ./apronxx/apronxx.pdf
+ fi
+ fi
+}
+
diff --git a/sci-mathematics/apron/files/apron-0.9.9-doc.patch b/sci-mathematics/apron/files/apron-0.9.9-doc.patch
new file mode 100644
index 000000000..d29666c4b
--- /dev/null
+++ b/sci-mathematics/apron/files/apron-0.9.9-doc.patch
@@ -0,0 +1,1542 @@
+diff -Naur apron-0.9.9-orig/apron/lgpl.texi apron-0.9.9-patch/apron/lgpl.texi
+--- ./apron/lgpl.texi 1970-01-01 00:00:00.000000000 +0000
++++ ./apron/lgpl.texi 2009-03-22 02:26:16.000000000 +0000
+@@ -0,0 +1,556 @@
++@center Version 2.1, February 1999
++
++@display
++Copyright @copyright{} 1991, 1999 Free Software Foundation, Inc.
++51 Franklin St -- Fifth Floor, Boston, MA 02110-1301, USA
++
++Everyone is permitted to copy and distribute verbatim copies
++of this license document, but changing it is not allowed.
++
++[This is the first released version of the Lesser GPL. It also counts
++as the successor of the GNU Library Public License, version 2, hence the
++version number 2.1.]
++@end display
++
++@subheading Preamble
++
++ The licenses for most software are designed to take away your
++freedom to share and change it. By contrast, the GNU General Public
++Licenses are intended to guarantee your freedom to share and change
++free software---to make sure the software is free for all its users.
++
++ This license, the Lesser General Public License, applies to some
++specially designated software---typically libraries---of the Free
++Software Foundation and other authors who decide to use it. You can use
++it too, but we suggest you first think carefully about whether this
++license or the ordinary General Public License is the better strategy to
++use in any particular case, based on the explanations below.
++
++ When we speak of free software, we are referring to freedom of use,
++not price. Our General Public Licenses are designed to make sure that
++you have the freedom to distribute copies of free software (and charge
++for this service if you wish); that you receive source code or can get
++it if you want it; that you can change the software and use pieces of it
++in new free programs; and that you are informed that you can do these
++things.
++
++ To protect your rights, we need to make restrictions that forbid
++distributors to deny you these rights or to ask you to surrender these
++rights. These restrictions translate to certain responsibilities for
++you if you distribute copies of the library or if you modify it.
++
++ For example, if you distribute copies of the library, whether gratis
++or for a fee, you must give the recipients all the rights that we gave
++you. You must make sure that they, too, receive or can get the source
++code. If you link other code with the library, you must provide
++complete object files to the recipients, so that they can relink them
++with the library after making changes to the library and recompiling
++it. And you must show them these terms so they know their rights.
++
++ We protect your rights with a two-step method: (1) we copyright the
++library, and (2) we offer you this license, which gives you legal
++permission to copy, distribute and/or modify the library.
++
++ To protect each distributor, we want to make it very clear that
++there is no warranty for the free library. Also, if the library is
++modified by someone else and passed on, the recipients should know
++that what they have is not the original version, so that the original
++author's reputation will not be affected by problems that might be
++introduced by others.
++
++ Finally, software patents pose a constant threat to the existence of
++any free program. We wish to make sure that a company cannot
++effectively restrict the users of a free program by obtaining a
++restrictive license from a patent holder. Therefore, we insist that
++any patent license obtained for a version of the library must be
++consistent with the full freedom of use specified in this license.
++
++ Most GNU software, including some libraries, is covered by the
++ordinary GNU General Public License. This license, the GNU Lesser
++General Public License, applies to certain designated libraries, and
++is quite different from the ordinary General Public License. We use
++this license for certain libraries in order to permit linking those
++libraries into non-free programs.
++
++ When a program is linked with a library, whether statically or using
++a shared library, the combination of the two is legally speaking a
++combined work, a derivative of the original library. The ordinary
++General Public License therefore permits such linking only if the
++entire combination fits its criteria of freedom. The Lesser General
++Public License permits more lax criteria for linking other code with
++the library.
++
++ We call this license the @dfn{Lesser} General Public License because it
++does @emph{Less} to protect the user's freedom than the ordinary General
++Public License. It also provides other free software developers Less
++of an advantage over competing non-free programs. These disadvantages
++are the reason we use the ordinary General Public License for many
++libraries. However, the Lesser license provides advantages in certain
++special circumstances.
++
++ For example, on rare occasions, there may be a special need to
++encourage the widest possible use of a certain library, so that it becomes
++a de-facto standard. To achieve this, non-free programs must be
++allowed to use the library. A more frequent case is that a free
++library does the same job as widely used non-free libraries. In this
++case, there is little to gain by limiting the free library to free
++software only, so we use the Lesser General Public License.
++
++ In other cases, permission to use a particular library in non-free
++programs enables a greater number of people to use a large body of
++free software. For example, permission to use the GNU C Library in
++non-free programs enables many more people to use the whole GNU
++operating system, as well as its variant, the GNU/Linux operating
++system.
++
++ Although the Lesser General Public License is Less protective of the
++users' freedom, it does ensure that the user of a program that is
++linked with the Library has the freedom and the wherewithal to run
++that program using a modified version of the Library.
++
++ The precise terms and conditions for copying, distribution and
++modification follow. Pay close attention to the difference between a
++``work based on the library'' and a ``work that uses the library''. The
++former contains code derived from the library, whereas the latter must
++be combined with the library in order to run.
++
++@subheading TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
++
++@enumerate 0
++@item
++This License Agreement applies to any software library or other program
++which contains a notice placed by the copyright holder or other
++authorized party saying it may be distributed under the terms of this
++Lesser General Public License (also called ``this License''). Each
++licensee is addressed as ``you''.
++
++ A ``library'' means a collection of software functions and/or data
++prepared so as to be conveniently linked with application programs
++(which use some of those functions and data) to form executables.
++
++ The ``Library'', below, refers to any such software library or work
++which has been distributed under these terms. A ``work based on the
++Library'' means either the Library or any derivative work under
++copyright law: that is to say, a work containing the Library or a
++portion of it, either verbatim or with modifications and/or translated
++straightforwardly into another language. (Hereinafter, translation is
++included without limitation in the term ``modification''.)
++
++ ``Source code'' for a work means the preferred form of the work for
++making modifications to it. For a library, complete source code means
++all the source code for all modules it contains, plus any associated
++interface definition files, plus the scripts used to control compilation
++and installation of the library.
++
++ Activities other than copying, distribution and modification are not
++covered by this License; they are outside its scope. The act of
++running a program using the Library is not restricted, and output from
++such a program is covered only if its contents constitute a work based
++on the Library (independent of the use of the Library in a tool for
++writing it). Whether that is true depends on what the Library does
++and what the program that uses the Library does.
++
++@item
++You may copy and distribute verbatim copies of the Library's
++complete source code as you receive it, in any medium, provided that
++you conspicuously and appropriately publish on each copy an
++appropriate copyright notice and disclaimer of warranty; keep intact
++all the notices that refer to this License and to the absence of any
++warranty; and distribute a copy of this License along with the
++Library.
++
++ You may charge a fee for the physical act of transferring a copy,
++and you may at your option offer warranty protection in exchange for a
++fee.
++
++@item
++You may modify your copy or copies of the Library or any portion
++of it, thus forming a work based on the Library, and copy and
++distribute such modifications or work under the terms of Section 1
++above, provided that you also meet all of these conditions:
++
++@enumerate a
++@item
++The modified work must itself be a software library.
++
++@item
++You must cause the files modified to carry prominent notices
++stating that you changed the files and the date of any change.
++
++@item
++You must cause the whole of the work to be licensed at no
++charge to all third parties under the terms of this License.
++
++@item
++If a facility in the modified Library refers to a function or a
++table of data to be supplied by an application program that uses
++the facility, other than as an argument passed when the facility
++is invoked, then you must make a good faith effort to ensure that,
++in the event an application does not supply such function or
++table, the facility still operates, and performs whatever part of
++its purpose remains meaningful.
++
++(For example, a function in a library to compute square roots has
++a purpose that is entirely well-defined independent of the
++application. Therefore, Subsection 2d requires that any
++application-supplied function or table used by this function must
++be optional: if the application does not supply it, the square
++root function must still compute square roots.)
++@end enumerate
++
++These requirements apply to the modified work as a whole. If
++identifiable sections of that work are not derived from the Library,
++and can be reasonably considered independent and separate works in
++themselves, then this License, and its terms, do not apply to those
++sections when you distribute them as separate works. But when you
++distribute the same sections as part of a whole which is a work based
++on the Library, the distribution of the whole must be on the terms of
++this License, whose permissions for other licensees extend to the
++entire whole, and thus to each and every part regardless of who wrote
++it.
++
++Thus, it is not the intent of this section to claim rights or contest
++your rights to work written entirely by you; rather, the intent is to
++exercise the right to control the distribution of derivative or
++collective works based on the Library.
++
++In addition, mere aggregation of another work not based on the Library
++with the Library (or with a work based on the Library) on a volume of
++a storage or distribution medium does not bring the other work under
++the scope of this License.
++
++@item
++You may opt to apply the terms of the ordinary GNU General Public
++License instead of this License to a given copy of the Library. To do
++this, you must alter all the notices that refer to this License, so
++that they refer to the ordinary GNU General Public License, version 2,
++instead of to this License. (If a newer version than version 2 of the
++ordinary GNU General Public License has appeared, then you can specify
++that version instead if you wish.) Do not make any other change in
++these notices.
++
++ Once this change is made in a given copy, it is irreversible for
++that copy, so the ordinary GNU General Public License applies to all
++subsequent copies and derivative works made from that copy.
++
++ This option is useful when you wish to copy part of the code of
++the Library into a program that is not a library.
++
++@item
++You may copy and distribute the Library (or a portion or
++derivative of it, under Section 2) in object code or executable form
++under the terms of Sections 1 and 2 above provided that you accompany
++it with the complete corresponding machine-readable source code, which
++must be distributed under the terms of Sections 1 and 2 above on a
++medium customarily used for software interchange.
++
++ If distribution of object code is made by offering access to copy
++from a designated place, then offering equivalent access to copy the
++source code from the same place satisfies the requirement to
++distribute the source code, even though third parties are not
++compelled to copy the source along with the object code.
++
++@item
++A program that contains no derivative of any portion of the
++Library, but is designed to work with the Library by being compiled or
++linked with it, is called a ``work that uses the Library''. Such a
++work, in isolation, is not a derivative work of the Library, and
++therefore falls outside the scope of this License.
++
++ However, linking a ``work that uses the Library'' with the Library
++creates an executable that is a derivative of the Library (because it
++contains portions of the Library), rather than a ``work that uses the
++library''. The executable is therefore covered by this License.
++Section 6 states terms for distribution of such executables.
++
++ When a ``work that uses the Library'' uses material from a header file
++that is part of the Library, the object code for the work may be a
++derivative work of the Library even though the source code is not.
++Whether this is true is especially significant if the work can be
++linked without the Library, or if the work is itself a library. The
++threshold for this to be true is not precisely defined by law.
++
++ If such an object file uses only numerical parameters, data
++structure layouts and accessors, and small macros and small inline
++functions (ten lines or less in length), then the use of the object
++file is unrestricted, regardless of whether it is legally a derivative
++work. (Executables containing this object code plus portions of the
++Library will still fall under Section 6.)
++
++ Otherwise, if the work is a derivative of the Library, you may
++distribute the object code for the work under the terms of Section 6.
++Any executables containing that work also fall under Section 6,
++whether or not they are linked directly with the Library itself.
++
++@item
++As an exception to the Sections above, you may also combine or
++link a ``work that uses the Library'' with the Library to produce a
++work containing portions of the Library, and distribute that work
++under terms of your choice, provided that the terms permit
++modification of the work for the customer's own use and reverse
++engineering for debugging such modifications.
++
++ You must give prominent notice with each copy of the work that the
++Library is used in it and that the Library and its use are covered by
++this License. You must supply a copy of this License. If the work
++during execution displays copyright notices, you must include the
++copyright notice for the Library among them, as well as a reference
++directing the user to the copy of this License. Also, you must do one
++of these things:
++
++@enumerate a
++@item
++Accompany the work with the complete corresponding
++machine-readable source code for the Library including whatever
++changes were used in the work (which must be distributed under
++Sections 1 and 2 above); and, if the work is an executable linked
++with the Library, with the complete machine-readable ``work that
++uses the Library'', as object code and/or source code, so that the
++user can modify the Library and then relink to produce a modified
++executable containing the modified Library. (It is understood
++that the user who changes the contents of definitions files in the
++Library will not necessarily be able to recompile the application
++to use the modified definitions.)
++
++@item
++Use a suitable shared library mechanism for linking with the Library. A
++suitable mechanism is one that (1) uses at run time a copy of the
++library already present on the user's computer system, rather than
++copying library functions into the executable, and (2) will operate
++properly with a modified version of the library, if the user installs
++one, as long as the modified version is interface-compatible with the
++version that the work was made with.
++
++@item
++Accompany the work with a written offer, valid for at
++least three years, to give the same user the materials
++specified in Subsection 6a, above, for a charge no more
++than the cost of performing this distribution.
++
++@item
++If distribution of the work is made by offering access to copy
++from a designated place, offer equivalent access to copy the above
++specified materials from the same place.
++
++@item
++Verify that the user has already received a copy of these
++materials or that you have already sent this user a copy.
++@end enumerate
++
++ For an executable, the required form of the ``work that uses the
++Library'' must include any data and utility programs needed for
++reproducing the executable from it. However, as a special exception,
++the materials to be distributed need not include anything that is
++normally distributed (in either source or binary form) with the major
++components (compiler, kernel, and so on) of the operating system on
++which the executable runs, unless that component itself accompanies the
++executable.
++
++ It may happen that this requirement contradicts the license
++restrictions of other proprietary libraries that do not normally
++accompany the operating system. Such a contradiction means you cannot
++use both them and the Library together in an executable that you
++distribute.
++
++@item
++You may place library facilities that are a work based on the
++Library side-by-side in a single library together with other library
++facilities not covered by this License, and distribute such a combined
++library, provided that the separate distribution of the work based on
++the Library and of the other library facilities is otherwise
++permitted, and provided that you do these two things:
++
++@enumerate a
++@item
++Accompany the combined library with a copy of the same work
++based on the Library, uncombined with any other library
++facilities. This must be distributed under the terms of the
++Sections above.
++
++@item
++Give prominent notice with the combined library of the fact
++that part of it is a work based on the Library, and explaining
++where to find the accompanying uncombined form of the same work.
++@end enumerate
++
++@item
++You may not copy, modify, sublicense, link with, or distribute
++the Library except as expressly provided under this License. Any
++attempt otherwise to copy, modify, sublicense, link with, or
++distribute the Library is void, and will automatically terminate your
++rights under this License. However, parties who have received copies,
++or rights, from you under this License will not have their licenses
++terminated so long as such parties remain in full compliance.
++
++@item
++You are not required to accept this License, since you have not
++signed it. However, nothing else grants you permission to modify or
++distribute the Library or its derivative works. These actions are
++prohibited by law if you do not accept this License. Therefore, by
++modifying or distributing the Library (or any work based on the
++Library), you indicate your acceptance of this License to do so, and
++all its terms and conditions for copying, distributing or modifying
++the Library or works based on it.
++
++@item
++Each time you redistribute the Library (or any work based on the
++Library), the recipient automatically receives a license from the
++original licensor to copy, distribute, link with or modify the Library
++subject to these terms and conditions. You may not impose any further
++restrictions on the recipients' exercise of the rights granted herein.
++You are not responsible for enforcing compliance by third parties with
++this License.
++
++@item
++If, as a consequence of a court judgment or allegation of patent
++infringement or for any other reason (not limited to patent issues),
++conditions are imposed on you (whether by court order, agreement or
++otherwise) that contradict the conditions of this License, they do not
++excuse you from the conditions of this License. If you cannot
++distribute so as to satisfy simultaneously your obligations under this
++License and any other pertinent obligations, then as a consequence you
++may not distribute the Library at all. For example, if a patent
++license would not permit royalty-free redistribution of the Library by
++all those who receive copies directly or indirectly through you, then
++the only way you could satisfy both it and this License would be to
++refrain entirely from distribution of the Library.
++
++If any portion of this section is held invalid or unenforceable under any
++particular circumstance, the balance of the section is intended to apply,
++and the section as a whole is intended to apply in other circumstances.
++
++It is not the purpose of this section to induce you to infringe any
++patents or other property right claims or to contest validity of any
++such claims; this section has the sole purpose of protecting the
++integrity of the free software distribution system which is
++implemented by public license practices. Many people have made
++generous contributions to the wide range of software distributed
++through that system in reliance on consistent application of that
++system; it is up to the author/donor to decide if he or she is willing
++to distribute software through any other system and a licensee cannot
++impose that choice.
++
++This section is intended to make thoroughly clear what is believed to
++be a consequence of the rest of this License.
++
++@item
++If the distribution and/or use of the Library is restricted in
++certain countries either by patents or by copyrighted interfaces, the
++original copyright holder who places the Library under this License may add
++an explicit geographical distribution limitation excluding those countries,
++so that distribution is permitted only in or among countries not thus
++excluded. In such case, this License incorporates the limitation as if
++written in the body of this License.
++
++@item
++The Free Software Foundation may publish revised and/or new
++versions of the Lesser General Public License from time to time.
++Such new versions will be similar in spirit to the present version,
++but may differ in detail to address new problems or concerns.
++
++Each version is given a distinguishing version number. If the Library
++specifies a version number of this License which applies to it and
++``any later version'', you have the option of following the terms and
++conditions either of that version or of any later version published by
++the Free Software Foundation. If the Library does not specify a
++license version number, you may choose any version ever published by
++the Free Software Foundation.
++
++@item
++If you wish to incorporate parts of the Library into other free
++programs whose distribution conditions are incompatible with these,
++write to the author to ask for permission. For software which is
++copyrighted by the Free Software Foundation, write to the Free
++Software Foundation; we sometimes make exceptions for this. Our
++decision will be guided by the two goals of preserving the free status
++of all derivatives of our free software and of promoting the sharing
++and reuse of software generally.
++
++@iftex
++@heading NO WARRANTY
++@end iftex
++@ifinfo
++@center NO WARRANTY
++@end ifinfo
++
++@item
++BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
++WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
++EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
++OTHER PARTIES PROVIDE THE LIBRARY ``AS IS'' WITHOUT WARRANTY OF ANY
++KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
++IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
++PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
++LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
++THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
++
++@item
++IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
++WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
++AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
++FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
++CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
++LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
++RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
++FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
++SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
++DAMAGES.
++@end enumerate
++
++@iftex
++@heading END OF TERMS AND CONDITIONS
++@end iftex
++@ifinfo
++@center END OF TERMS AND CONDITIONS
++@end ifinfo
++
++@page
++@subheading How to Apply These Terms to Your New Libraries
++
++ If you develop a new library, and you want it to be of the greatest
++possible use to the public, we recommend making it free software that
++everyone can redistribute and change. You can do so by permitting
++redistribution under these terms (or, alternatively, under the terms of the
++ordinary General Public License).
++
++ To apply these terms, attach the following notices to the library. It is
++safest to attach them to the start of each source file to most effectively
++convey the exclusion of warranty; and each file should have at least the
++``copyright'' line and a pointer to where the full notice is found.
++
++@smallexample
++@var{one line to give the library's name and an idea of what it does.}
++Copyright (C) @var{year} @var{name of author}
++
++This library is free software; you can redistribute it and/or modify it
++under the terms of the GNU Lesser General Public License as published by
++the Free Software Foundation; either version 2.1 of the License, or (at
++your option) any later version.
++
++This library 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
++Lesser General Public License for more details.
++
++You should have received a copy of the GNU Lesser General Public
++License along with this library; if not, write to the Free Software
++Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
++USA.
++@end smallexample
++
++Also add information on how to contact you by electronic and paper mail.
++
++You should also get your employer (if you work as a programmer) or your
++school, if any, to sign a ``copyright disclaimer'' for the library, if
++necessary. Here is a sample; alter the names:
++
++@smallexample
++Yoyodyne, Inc., hereby disclaims all copyright interest in the library
++`Frob' (a library for tweaking knobs) written by James Random Hacker.
++
++@var{signature of Ty Coon}, 1 April 1990
++Ty Coon, President of Vice
++@end smallexample
++
++That's all there is to it!
++
+diff -Naur apron-0.9.9-orig/apron/rationale.texi apron-0.9.9-patch/apron/rationale.texi
+--- ./apron/rationale.texi 1970-01-01 00:00:00.000000000 +0000
++++ ./apron/rationale.texi 2009-03-22 02:26:16.000000000 +0000
+@@ -0,0 +1,647 @@
++
++@menu
++* General choices::
++* Functionalities of the interface at level 0::
++* Functionalities of the interface at level 1::
++@end menu
++
++@c ===================================================================
++@node General choices, Functionalities of the interface at level 0, APRON Rationale and Functionalities, APRON Rationale and Functionalities
++@section General choices
++@c ===================================================================
++
++@menu
++* Interface levels::
++* Programming language::
++* Compatibility with threads::
++* Interruptions::
++* Memory management::
++* Programming style::
++* Number representation::
++@end menu
++
++@c -------------------------------------------------------------------
++@node Interface levels, Programming language, General choices, General choices
++@subsubheading Interface levels
++
++There are two main goals for the APRON interface: efficiency of the
++implementations, and ease of use for the user. In addition, code
++duplication between libraries should be avoided. As a consequence, two
++levels were identified:
++@table @emph
++@item Level 0
++Choices are guided by the efficiency and the precision of the operations;
++@item Level 1
++Choices are guided by ease of use, and code factorization.
++@end table
++
++The level 0 is directly connected to the underlying (existing)
++library. It includes all the operations that are specific to an
++abstract domain and whose code cannot be shared. The interface should
++be minimal, @emph{unless} there is a strong algorithmical advantage to
++include a combination of more basic operations.
++
++The higher levels offers additional functionalities that are shared by
++all the library connected to the level 0. For instance:
++
++@itemize
++@item
++managing correspondance between numerical dimensions and names
++(characters strings or more generally references);
++@item
++abstraction of non linear expressions in interval linear expressions;
++@item
++automatic call to redimensioning and permutation operations for
++computing
++@iftex
++@tex
++$P(x,y)\sqcap Q(y,z)$
++@end tex
++@end iftex
++@ifnottex
++P(x,y)/\Q(y,z).
++@end ifnottex
++@end itemize
++
++Combination of abstract domain is possible at the level 0. One can
++implement for instance the cartesian or reduced product of two
++different abstract domains, the decomposition of abstract values into
++a product of values of smaller dimensionality, ...
++
++@c -------------------------------------------------------------------
++@node Programming language, Compatibility with threads, Interface levels, General choices
++@subsubheading Programming language
++
++The reference version of the interface is the C version of the interface:
++
++@itemize
++@item
++C can be easily interfaced with most programming languages;
++@item
++Most of the existing libraries implementing abstract domains for
++numerical variables are programmed in C or C++.
++@end itemize
++
++An @sc{OCaml} version is already available. The interface between
++OCaml and C is even generic and any libraries can benefit from it by
++providing the glue for just one function (see XX).
++
++@c -------------------------------------------------------------------
++@node Compatibility with threads, Interruptions, Programming language, General choices
++@subsubheading Compatibility with threads
++
++In order to ensure compatibility with multithreading programming, a
++context is explicitly passed to functions in order to ensure the
++following points:
++
++@itemize
++@item
++the transmission of data specific to each library (non-standard
++options, workspace, ...);
++@item
++the transmission of standard options (selection of algorithms and their
++precision inside a library);
++@item
++the management of exceptions (implemented as error codes in the C
++interface) (@code{not_implemented}, @code{invalid_argument},
++@code{overflow}, @code{timeout}, @code{out_of_space}).
++@end itemize
++
++@c -------------------------------------------------------------------
++@node Interruptions, Memory management, Compatibility with threads, General choices
++@subsubheading Interruptions
++
++Interruptions mechanism is have possible for different cases:
++@table @code
++@item timeout
++if the execution time for an operation exceeds some bound;
++@item out_of_space
++if the space consumption for an operation exceeds some bound;
++@item overflow
++if the magnitude or the space usage of manipulated numbers exceeds some bound;
++@item not_implemented
++if the operation is actually not implemented by the underlying library;
++@item invalid_argument
++if the arguments do not follow the requirements of an operation.
++@end table
++
++@quotation
++For instance, in a convex polyhedra library, the @code{out_of_space}
++exception allows to abort an operation is the result appears to have
++too many constraints and/or generators. If this happens, one can redo
++the operation with another (less precise) algorithm. The
++@code{overflow} may be useful when effective overflows are encountered
++with machine integers or when multiprecision rational numbers have too
++large numerators and denominators. The @code{not_implemented}
++exception allows for a library to be linked to the interface even if
++it does not provide some operation of the interface.
++@end quotation
++
++When an interruption occurs, the function should still return a
++correct result, in the abstract interpretation sense: it should be a
++correct approximation, usable for next operations in the program. The
++top value is always a correct approximation.
++
++@c -------------------------------------------------------------------
++@node Memory management, Programming style, Interruptions, General choices
++@subsubheading Memory management
++
++Memory is managed differently depending on the programming language. Currently:
++
++@itemize
++@item
++No automatic garbage collection in the C interface
++@item
++Use of the @sc{OCaml} runtime garbage collector in the @sc{OCaml} interface
++@end itemize
++
++@c -------------------------------------------------------------------
++@node Programming style, Number representation, Memory management, General choices
++@subsubheading Programming style
++
++Both functional and imperative (i.e., side-effect) signatures are
++supported for operations. This allows to optimize the memory
++allocation and to use whichever version is more convenient for an user
++and the used programming language.
++
++@c -------------------------------------------------------------------
++@node Number representation, , Programming style, General choices
++@subsubheading Number representation
++
++Inside a specific library, any number representation may be used
++(floating-point numbers, machine integers, multiprecision
++integers/rationals, ...). Existing libraries often offers the
++possibility to select different representations.
++
++However, in the interface, this representation should be normalized
++and independent of underlying libraries, without being restrictive
++either. As a consequence, the interface offers the choiced between
++
++@itemize
++@item GMP multiprecision rationals (which implements exact arithmetic);
++@item and machine floating-point numbers (@code{double}).
++@end itemize
++
++@c ===================================================================
++@node Functionalities of the interface at level 0, Functionalities of the interface at level 1, General choices, APRON Rationale and Functionalities
++@section Functionalities of the interface at level 0
++@c ===================================================================
++
++@menu
++* Representation of an abstract value::
++* Semantics of an abstract value::
++* Dimensions::
++* Other datatypes::
++* Control of internal representation::
++* Printing::
++* Serializaton/Deserialization::
++* Constructors::
++* Tests::
++* Property extraction::
++* Lattice operations::
++* Assignement and Substitutions::
++* Operations on dimensions::
++* Other operations::
++@end menu
++
++
++@c -------------------------------------------------------------------
++@node Representation of an abstract value, Semantics of an abstract value, Functionalities of the interface at level 0, Functionalities of the interface at level 0
++@subsubheading Representation of an abstract value
++
++At the level 0 of the interface, an abstract value is a structure
++@verbatim
++struct ap_abstract0_t {
++ ap_manager_t *manager; /* Explicit context */
++ void *value; /* Abstract value representation
++ (only known by the underlying library) */
++}
++@end verbatim
++The context is allocated by the underlying library, and contains an
++array of function pointers pointing to the function of the underlying
++library. Hence, it indicates the effective type of an abstract value.
++
++The validity of the arguments of the functions called through the
++interface is checked before the call to effective functions. In case
++of problem, an @code{invalid_argument} exception is raised.
++
++@c -------------------------------------------------------------------
++@node Semantics of an abstract value, Dimensions, Representation of an abstract value, Functionalities of the interface at level 0
++@subsubheading Semantics of an abstract value
++
++The semantics of an abstract value is a subset
++@iftex
++@tex
++$$X\subseteq {\cal N}^p\times{\cal R}^q$$
++@end tex
++@end iftex
++@ifnottex
++@quotation
++X of N^p x R^q
++@end quotation
++@end ifnottex
++
++@noindent Abstract values are typed according to their dimensionality
++(p,q).
++
++@c -------------------------------------------------------------------
++@node Dimensions, Other datatypes, Semantics of an abstract value, Functionalities of the interface at level 0
++@subsubheading Dimensions
++Dimensions are numbered from 0 to p+q-1 and are typed either as
++integer or real, depending on their rank w.r.t. the dimensionality of
++the abstract value.
++
++@quotation Note
++Taking into account or not the fact that some dimensions are integers
++is left to underlying libraries. Treating them as real is still a
++correct approximation. The behaviour of the libraries in this regard
++may also depend on some options.
++@end quotation
++
++@c -------------------------------------------------------------------
++@node Other datatypes, Control of internal representation, Dimensions, Functionalities of the interface at level 0
++@subsubheading Other datatypes
++
++In addition to abstract values, the interface also manipulates the
++following main datatypes:
++@table @emph
++@item scalar (number)
++Either GMP multiprecision rationals or C @code{double}.
++@item interval
++composed of 2 scalar numbers. With rationals, plus (resp minus) infinity is represented by 1/0 (resp -1/0). With @code{double}, the IEEE754 is assumed and the corresponding standard representation is used.
++@item coefficient
++which is either a scalar or an interval.
++@item (interval) linear expression
++The term linear is used even if the proper term should rather be
++affine. A linear expression is a linear expression in the common
++sense, using only scalar numbers. A quasi-linear expression is a
++linear expression where the constant coefficient is an interval. An
++interval linear expression is a linear expression where any
++coefficient may be an interval. In order to have a unique datatype for
++these variations, we introduced the notion of coefficient described
++above.
++@item ``linear'' constraints
++``Linear'' constraints includes proper linear constraints, linear
++constraints in which the expression can be possibly an interval linear
++expression, linear equalities modulo a number, and linear disequalities.
++@item generators
++A generator system for a subset of @math{X\subseteq R^n} is a finite
++set of vectors, among which one distinguishes @emph{points}
++@math{p_0,\ldots,p_m} and @emph{rays} @math{r_0,\ldots,r_n}, that
++generates @math{X}:
++@iftex
++@tex
++$$X=\{ \lambda_0 \vec{p_0} + \ldots \lambda_m \vec{p_m} + \mu_0 \vec{r_0} +\ldots + \mu_n \vec{r_n} ~|~ \sum_i \lambda_i = 1 ~\wedge~ \forall j: \mu_j\geq 0 \}$$
++@end tex
++@end iftex
++@ifnottex
++@quotation
++X = @{ lambda0 p0 +...+ lambdaM pM + mu0 r0 +...+ muN rN | lambda0 +...+ lambdaN = 1 and forall J : muJ >= 0 @}
++@end quotation
++@end ifnottex
++The APRON datatype for generators distinguishes points (sum of
++coefficients equal to one), rays (positive coefficients), lines (or
++bidirectional rays, with unconstrainted coefficients), integer rays
++(integer positive coefficients) and integer lines (integer
++coefficients).
++@end table
++
++@c -------------------------------------------------------------------
++@node Control of internal representation, Printing, Other datatypes, Functionalities of the interface at level 0
++@subsubheading Control of internal representation
++
++We identified several notions:
++
++@itemize
++@item
++Canonical form
++@item
++Minimal form (in term of space)
++@item
++Approximation notion left to the underlying library (taking into
++account integers or not, ...).
++@end itemize
++
++@c -------------------------------------------------------------------
++@node Printing, Serializaton/Deserialization, Control of internal representation, Functionalities of the interface at level 0
++@subsubheading Printing
++
++There are two printing operations:
++
++@itemize
++@item
++Printing of an abstract value;
++@item
++Printing the difference between two abstract values.
++@end itemize
++
++@noindent The printing format is library dependent. However, the conversion of
++abstract values to constraints (see below) allows a form of
++standardized printing for abstract values.
++
++@c -------------------------------------------------------------------
++@node Serializaton/Deserialization, Constructors, Printing, Functionalities of the interface at level 0
++@subsubheading Serializaton/Deserialization
++
++Serialization and deserialization of abstract values to a memory
++buffer is offered. It is entirely managed by the underlying
++library. In particular, it is up to it to check that a value read from
++the memory buffer has the right format and has not been written by a
++different library.
++
++Serialization is done to a memory buffer instead of to a file
++descriptor because this mechanism is more general and is needed for
++interfacing with languages like @sc{OCaml}.
++
++@c -------------------------------------------------------------------
++@node Constructors, Tests, Serializaton/Deserialization, Functionalities of the interface at level 0
++@subsubheading Constructors
++
++Four basic constructors are offered:
++
++@itemize
++@item
++bottom (empty) and top (universe) values (with a specified dimensionality);
++@item
++abstraction of a bounding box;
++@item
++abstraction of conjunction of linear constraints (in the broad sense).
++@end itemize
++
++@c -------------------------------------------------------------------
++@node Tests, Property extraction, Constructors, Functionalities of the interface at level 0
++@subsubheading Tests
++
++Predicates are offered for testing
++@itemize
++@item
++emptiness and universality of an abstract value:
++@item
++inclusion and equality of two abstract values;
++@item
++inclusion of a dimension into an interval given an abstract value;
++@iftex
++@tex
++$${\it abs}(\vec{x}) \models x_i \in I ~~ ?$$
++@end tex
++@end iftex
++@item
++satisfaction of a linear constraint by the abstract value.
++@iftex
++@tex
++$${\it abs}(\vec{x}) \models {\it cons}(\vec{x}) ~~ {\tt or} ~~ {\it abs}(\vec{x}) \Rightarrow {\it cons}(\vec{x}) ~~ ?$$
++@end tex
++@end iftex
++@end itemize
++
++@c -------------------------------------------------------------------
++@node Property extraction, Lattice operations, Tests, Functionalities of the interface at level 0
++@subsubheading Property extraction
++
++Some properties may be inferred given an abstract values:
++
++@itemize
++@item Interval of variation of a dimension in an abstract value;
++@iftex
++@tex
++$$\bigcap\{ I ~|~ {\it abs}(\vec{x}) \models x_i\in I\}$$
++@end tex
++@end iftex
++
++@item Interval of variation of a linear expression in an abstract value;
++@iftex
++@tex
++$$\bigcap\{ I ~|~ {\it abs}(\vec{x}) \models {\it expr}(\vec{x})\in I\}$$
++@end tex
++@end iftex
++@item Conversion to a bounding box
++@iftex
++@tex
++$$\bigcap\{ B ~|~ {\it abs}(\vec{x}) \subseteq B \}$$
++@end tex
++@end iftex
++@item Conversion to a set of linear constraints (in the broad sense).
++@end itemize
++
++@noindent Notice that the second operation implements linear programming if it
++is exact. The third operation is not minimal, as it can be implemented
++using the first one, but it was convenient to include it. But the
++fourth operation is minimal and cannot be implemented using the second
++one, as the number of linear expression is infinite.
++
++@c -------------------------------------------------------------------
++@node Lattice operations, Assignement and Substitutions, Property extraction, Functionalities of the interface at level 0
++@subsubheading Lattice operations
++
++@itemize
++@item
++Least upper bound and greatest lower bound of two abstract values, and of arrays of abstract values;
++@item
++Intersection with one or several linear constraints;
++@iftex
++@tex
++$$\alpha\left(\gamma({\it abs}(\vec{x})) \cap \bigcap_i {\it cons}_i(\vec{x})\right)$$
++@end tex
++@end iftex
++@item
++Addition of rays (for instance for implement generalized time elapse
++operator in linear hybrid systems).
++@iftex
++@tex
++$$\alpha\left(\left\{ \vec{x} + \sum_i \lambda_i \vec{r}_i ~|~ \vec{x}\in\gamma({\it abs}), \lambda_i\geq 0\right\}\right)$$
++@end tex
++@end iftex
++@end itemize
++
++@c -------------------------------------------------------------------
++@node Assignement and Substitutions, Operations on dimensions, Lattice operations, Functionalities of the interface at level 0
++@subsubheading Assignement and Substitutions
++
++@itemize
++@item
++of a dimension by a (interval) linear expression
++@iftex
++@tex
++
++Assignement:
++$$\alpha\left(\biggl(
++\exists x_i: \Bigl(\gamma({\it abs}(\vec{x})) \cap x_i'={\it expr}(\vec{x})\Bigr)\biggr)[x_i\leftarrow x_i']\right)$$
++Substitution:
++$$\alpha\biggl(
++\exists x_i': \Bigl(\gamma({\it abs}(\vec{x}))[x_i'\leftarrow x_i] \cap x_i'={\it expr}(\vec{x})\Bigr)\biggr)$$
++
++@end tex
++@end iftex
++@item
++in parallel of several dimensions by several (interval) linear expressions
++@iftex
++@tex
++
++Assignement:
++$$\alpha\left(\biggl(
++\exists \vec{x}: \Bigl(\gamma({\it abs}(\vec{x})) \cap \bigcap_i x_i'={\it expr}_i(\vec{x})\Bigr)\biggr)[\vec{x}\leftarrow \vec{x'}]\right)$$
++Substitution:
++$$\alpha\biggl(
++\exists \vec{x'}: \Bigl(\gamma({\it abs}(\vec{x'})) \cap \bigcap_i x_i'={\it expr}(\vec{x})\Bigr)\biggr)$$
++
++@end tex
++@end iftex
++@end itemize
++
++@noindent Parallel assignement and substitution ar enot minimal operations, but
++for some abstract domains implementing them directly results in more
++efficient or more precise operations.
++
++@c -------------------------------------------------------------------
++@node Operations on dimensions, Other operations, Assignement and Substitutions, Functionalities of the interface at level 0
++@subsubheading Operations on dimensions
++
++@itemize
++@item
++Projection/Elimination of one or several dimensions with constant
++dimensionality;
++@iftex
++@tex
++
++Elimination: $$\exists x_i:{\it abs}(\vec{x})$$
++
++Projection: $$(\exists x_i:{\it abs}(\vec{x}))\cap x_i=0$$
++@end tex
++@end iftex
++@item
++Addition/Removal/Permutation of dimensions with corresponding change
++of dimensionality (with the exception of permutation). These
++operations allows to resize abstract values, and reorganize
++dimensions.
++@item
++Expansion and folding of dimensions. This is useful for the
++abstraction of arrays, where a dimension may represent several
++variables.
++@iftex
++@tex
++
++Expansion of $i$ into $i$, $j_1$, $j_2$ assuming $x_{j_1}$, $x_{j_2}$ are new dimensions:
++$${\it abs}(\vec{x}) \sqcap {\it abs}(\vec{x})[x_{j_1}\leftarrow x_i] \sqcap {\it abs}(\vec{x})[x_{j_2}\leftarrow x_i] ...
++$$
++Folding of $j_0$ and $j_1$ into $j_0$:
++$$(\exists x_{j_1}:{\it abs}(\vec{x})) \sqcup (\exists x_{j_0}:{\it abs}(\vec{x})[x_{j_0}\leftarrow x_{j_1}]
++$$
++@end tex
++@end iftex
++
++
++@end itemize
++
++@c -------------------------------------------------------------------
++@node Other operations, , Operations on dimensions, Functionalities of the interface at level 0
++@subsubheading Other operations
++
++Widening, either simple or with threshold, is offered. A generic
++widening with threshold function is offered in the interface.
++
++Topological closure (i.e., relaxation of strict inequalities) is
++offered.
++
++@c ===================================================================
++@node Functionalities of the interface at level 1, , Functionalities of the interface at level 0, APRON Rationale and Functionalities
++@section Functionalities of the interface at level 1
++@c ===================================================================
++
++We focus on the changes brought by the level 1 w.r.t. the level 0.
++
++@menu
++* Variables and Environments::
++* Semantics and Representation of an abstract value::
++* Operations on environments::
++* Dynamic typing w.r.t. environments::
++* Operations on variables in abstract values::
++@end menu
++
++@c -------------------------------------------------------------------
++@node Variables and Environments, Semantics and Representation of an abstract value, Functionalities of the interface at level 1, Functionalities of the interface at level 1
++@subsubheading Variables
++
++Dimensions are replaced by @emph{variables}.
++
++In the C interface, variables are defined by a generic type
++(@code{char*}, structured type, ...), equipped with the operations
++@code{compare}, @code{copy}, @code{free}, @code{to_string}. In the
++@sc{OCaml}, for technical reasons, the type is just the @code{string}
++type.
++
++@emph{Environments} manages the correspondance between the numerical
++dimensions of level 0 and the variables of level 1.
++
++@c -------------------------------------------------------------------
++@node Semantics and Representation of an abstract value, Operations on environments, Variables and Environments, Functionalities of the interface at level 1
++@subsubheading Semantics and Representation of an abstract value
++
++The semantics of an abstract value is a subset
++@iftex
++@tex
++$$X\subseteq V\rightarrow ({\cal N}\cup{\cal R})$$
++@end tex
++@end iftex
++@ifnottex
++@quotation
++X -> (N+R).
++@end quotation
++@end ifnottex
++where @math{X} is a set of variables.
++@noindent
++Abstract values are typed according to their environment.
++
++It is represented by a structure
++@verbatim
++struct ap_abstract1_t {
++ ap_abstract0_t *abstract0;
++ ap_environment_t *env;
++};
++@end verbatim
++Other datatypes of level 0 are extend in the same way. For instance,
++@verbatim
++struct ap_linexpr1_t {
++ ap_linexpr0_t *linexpr0;
++ ap_environment_t *env;
++};
++@end verbatim
++
++@c -------------------------------------------------------------------
++@node Operations on environments, Dynamic typing w.r.t. environments, Semantics and Representation of an abstract value, Functionalities of the interface at level 1
++@subsubheading Operations on environments
++
++@itemize
++@item creation, merging, destruction
++@item addition/removal/renaming of variables
++@end itemize
++
++@c -------------------------------------------------------------------
++@node Dynamic typing w.r.t. environments, Operations on variables in abstract values, Operations on environments, Functionalities of the interface at level 1
++@subsubheading Dynamic typing w.r.t. environments
++
++For binary operations on abstract values, the environments should be
++the same.
++
++For operations involving an abstract value and an other datatype
++(expression, constraint, ...), one checks that the environment of
++the expression is a subenvironment of the environment of the abstract
++value, and one resize if necessary.
++
++@c -------------------------------------------------------------------
++@node Operations on variables in abstract values, , Dynamic typing w.r.t. environments, Functionalities of the interface at level 1
++@subsubheading Operations on variables in abstract values
++
++Operations on dimensions are lifted to operations on variables:
++
++@itemize
++@item
++Projection/Elimination of one or several variables with constant
++environment;
++@item
++Addition/Removal/Renaming of variables with corresponding change
++of environment;
++@item
++Change of environment (possibly combining removal and addition of variables);
++@item
++Expansion and folding of variables.
++@end itemize
+diff -Naur apron-0.9.9-orig/mlapronidl/index.html apron-0.9.9-patch/mlapronidl/index.html
+--- ./mlapronidl/index.html 1970-01-01 00:00:00.000000000 +0000
++++ ./mlapronidl/index.html 2009-03-22 02:26:16.000000000 +0000
+@@ -0,0 +1,215 @@
++<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
++<html>
++<head>
++<link rel="stylesheet" href="style.css" type="text/css">
++<meta content="text/html; charset=iso-8859-1" http-equiv="Content-Type">
++<link rel="Start" href="index.html">
++<link title="Index of types" rel=Appendix href="index_types.html">
++<link title="Index of exceptions" rel=Appendix href="index_exceptions.html">
++<link title="Index of values" rel=Appendix href="index_values.html">
++<link title="Index of modules" rel=Appendix href="index_modules.html">
++<link title="Scalar" rel="Chapter" href="Scalar.html">
++<link title="Interval" rel="Chapter" href="Interval.html">
++<link title="Coeff" rel="Chapter" href="Coeff.html">
++<link title="Var" rel="Chapter" href="Var.html">
++<link title="Environment" rel="Chapter" href="Environment.html">
++<link title="Linexpr1" rel="Chapter" href="Linexpr1.html">
++<link title="Lincons1" rel="Chapter" href="Lincons1.html">
++<link title="Generator1" rel="Chapter" href="Generator1.html">
++<link title="Texpr1" rel="Chapter" href="Texpr1.html">
++<link title="Tcons1" rel="Chapter" href="Tcons1.html">
++<link title="Abstract1" rel="Chapter" href="Abstract1.html">
++<link title="Dim" rel="Chapter" href="Dim.html">
++<link title="Linexpr0" rel="Chapter" href="Linexpr0.html">
++<link title="Lincons0" rel="Chapter" href="Lincons0.html">
++<link title="Generator0" rel="Chapter" href="Generator0.html">
++<link title="Texpr0" rel="Chapter" href="Texpr0.html">
++<link title="Tcons0" rel="Chapter" href="Tcons0.html">
++<link title="Manager" rel="Chapter" href="Manager.html">
++<link title="Abstract0" rel="Chapter" href="Abstract0.html">
++<link title="Box" rel="Chapter" href="Box.html">
++<link title="Oct" rel="Chapter" href="Oct.html">
++<link title="Polka" rel="Chapter" href="Polka.html">
++<link title="Ppl" rel="Chapter" href="Ppl.html">
++<link title="PolkaGrid" rel="Chapter" href="PolkaGrid.html">
++<link title="Mpz" rel="Chapter" href="Mpz.html">
++<link title="Mpq" rel="Chapter" href="Mpq.html">
++<link title="Mpf" rel="Chapter" href="Mpf.html">
++<link title="Mpfr" rel="Chapter" href="Mpfr.html">
++<link title="Gmp_random" rel="Chapter" href="Gmp_random.html"><title></title>
++<link title="Mpzf" rel="Chapter" href="Mpzf.html">
++<link title="Mpqf" rel="Chapter" href="Mpqf.html">
++<link title="Mpftf" rel="Chapter" href="Mpftf.html">
++</head>
++<body>
++<center><h1></h1></center>
++<a href="index_types.html">Index of types</a><br>
++<a href="index_exceptions.html">Index of exceptions</a><br>
++<a href="index_values.html">Index of values</a><br>
++<a href="index_modules.html">Index of modules</a><br>
++<br/><br>
++
++<h1>Managers</h1>
++
++Managers are allocated by abstract domains and defines the
++effective type of abstract values. Information about compilation
++and linking is provided in modules implementing a specific
++abstract domain.
++
++<table class="indextable">
++<tr><td><a href="Manager.html">Manager</a></td><td><div class="info">
++APRON Managers
++</div>
++</td></tr>
++<tr><td><a href="Box.html">Box</a></td><td><div class="info">
++BOX: intervals abstract domain
++</div>
++</td></tr>
++<tr><td><a href="Oct.html">Oct</a></td><td><div class="info">
++OCT: octagon abstract domain.
++</div>
++</td></tr>
++<tr><td><a href="Polka.html">Polka</a></td><td><div class="info">
++POLKA: Convex Polyhedra and Linear Equalities abstract domain
++</div>
++</td></tr>
++<tr><td><a href="Ppl.html">PPL</a></td><td><div class="info">
++PPL: Convex Polyhedra and Linear Congruences abstract domain
++</div>
++</td></tr>
++<tr><td><a href="PolkaGrid.html">PolkaGrid</a></td><td><div class="info">
++PolkaGrid: reduced product of (NewPolka) Convex Polyhedra and (PPL) Linear Congruences abstract domain
++</div>
++</td></tr>
++</table>
++
++<h1>Coefficients</h1>
++<table class="indextable">
++<tr><td><a href="Scalar.html">Scalar</a></td><td><div class="info">
++APRON Scalar numbers.
++</div>
++</td></tr>
++<tr><td><a href="Interval.html">Interval</a></td><td><div class="info">
++APRON Intervals on scalars
++</div>
++</td></tr>
++<tr><td><a href="Coeff.html">Coeff</a></td><td><div class="info">
++APRON Coefficients (either scalars or intervals)
++</div>
++</td></tr>
++</table>
++
++<h1>Level 1 of APRON interface</h1>
++<table class="indextable">
++<tr><td><a href="Var.html">Var</a></td><td><div class="info">
++APRON Variables
++</div>
++</td></tr>
++<tr><td><a href="Environment.html">Environment</a></td><td><div class="info">
++APRON Environments binding dimensions to names
++</div>
++</td></tr>
++<tr><td><a href="Linexpr1.html">Linexpr1</a></td><td><div class="info">
++APRON Linear Expressions of level 1
++</div>
++</td></tr>
++<tr><td><a href="Lincons1.html">Lincons1</a></td><td><div class="info">
++APRON Linear Constraints and array of constraints of level 1
++</div>
++</td></tr>
++<tr><td><a href="Generator1.html">Generator1</a></td><td><div class="info">
++APRON Generators and array of generators of level 1
++</div>
++</td></tr>
++<tr><td><a href="Texpr1.html">Texpr1</a></td><td><div class="info">
++APRON Non-Linear Expressions of level 1
++</div>
++</td></tr>
++<tr><td><a href="Tcons1.html">Tcons1</a></td><td><div class="info">
++APRON Non-Linear Constraints and array of constraints of level 1
++</div>
++</td></tr>
++<tr><td><a href="Abstract1.html">Abstract1</a></td><td><div class="info">
++APRON Abstract values of level 1
++</div>
++</td></tr>
++<tr><td><a href="Parser.html">Parser</a></td><td><div class="info">
++APRON Parser for expressions, constraints and generators
++</div>
++</td></tr>
++</table>
++
++<h1>Level 0 of APRON interface</h1>
++
++Normally not needed for a user.
++
++<table class="indextable">
++<tr><td><a href="Dim.html">Dim</a></td><td><div class="info">
++APRON Dimensions and related types
++</div>
++</td></tr>
++<tr><td><a href="Linexpr0.html">Linexpr0</a></td><td><div class="info">
++APRON Linear expressions of level 0
++</div>
++</td></tr>
++<tr><td><a href="Lincons0.html">Lincons0</a></td><td><div class="info">
++APRON Linear constraints of level 0
++</div>
++</td></tr>
++<tr><td><a href="Generator0.html">Generator0</a></td><td><div class="info">
++APRON Generators of level 0
++</div>
++</td></tr>
++<tr><td><a href="Texpr0.html">Texpr0</a></td><td><div class="info">
++APRON Non-Linear Expressions of level 0
++</div>
++</td></tr>
++<tr><td><a href="Tcons0.html">Tcons0</a></td><td><div class="info">
++APRON Non-Linear Constraints and array of constraints of level 0
++</div>
++</td></tr>
++<tr><td><a href="Abstract0.html">Abstract0</a></td><td><div class="info">
++APRON Abstract value of level 0
++</div>
++</td></tr>
++</table>
++
++
++<h1>Misc</h1>
++
++<table class="indextable">
++<tr><td><a href="Mpz.html">Mpz</a></td><td><div class="info">
++GMP multi-precision integers
++</div>
++</td></tr>
++<tr><td><a href="Mpq.html">Mpq</a></td><td><div class="info">
++GMP multiprecision rationals
++</div>
++</td></tr>
++<tr><td><a href="Mpf.html">Mpf</a></td><td><div class="info">
++GMP multiprecision floating-point numbers
++</div>
++<tr><td><a href="Mpfr.html">Mpfr</a></td><td><div class="info">
++MPFR Multiprecision floating-point numbers with guaranteed rounding
++</div>
++</td></tr>
++<tr><td><a href="Gmp_random.html">Gmp_random</a></td><td><div class="info">
++GMP random generation functions
++</div>
++</td></tr>
++<tr><td><a href="Mpzf.html">Mpzf</a></td><td><div class="info">
++GMP multi-precision integers, functional version
++</div>
++</td></tr>
++<tr><td><a href="Mpqf.html">Mpqf</a></td><td><div class="info">
++GMP multi-precision rationals, functional version
++</div>
++</td></tr>
++<tr><td><a href="Mpfrf.html">Mpfrf</a></td><td><div class="info">
++MPFR multi-precision floating-point numbers, functional version
++</div>
++</td></tr>
++</table>
++
++</body>
++</html>
+diff -Naur apron-0.9.9-orig/ppl/ap_ppl.texi apron-0.9.9-patch/ppl/ap_ppl.texi
+--- ./ppl/ap_ppl.texi 1970-01-01 00:00:00.000000000 +0000
++++ ./ppl/ap_ppl.texi 2009-03-22 02:26:16.000000000 +0000
+@@ -0,0 +1,108 @@
++@c This file is part of the APRON Library, released under LGPL
++@c license. Please read the COPYING file packaged in the distribution
++
++@c to be included from apron.texi
++
++The @sc{APRON PPL} library is an APRON wrapper around the
++@uref{http://www.cs.unipr.it/ppl/, Parma Polyhedra Library (PPL)}. The
++wrapper offers the convex polyhedra and linear congruences abstract
++domains.
++
++@menu
++* Use of APRON PPL::
++* Allocating APRON PPL managers::
++* APRON PPL standard options::
++@end menu
++
++@c ===================================================================
++@node Use of APRON PPL, Allocating APRON PPL managers,,PPL
++@subsection Use of APRON PPL
++@c ===================================================================
++
++To use APRON PPL in C, you need of course to install PPL, @emph{after
++having patched it} following the recommendations of the @file{README}
++file. You need also to add
++@example
++#include "apron_ppl.h"
++@end example
++in your source file(s) and add @samp{-I$(APRON_PREFIX)/include} in the
++command line in your Makefile.
++
++You should also link your object files with the APRON PPL library to
++produce an executable, @emph{using} @samp{g++} (instead of @samp{gcc},
++because @file{libppl.a} is a C++ library), and adding something like
++@samp{-L$(APRON_PREFIX)/lib -lapron_ppl -L$(PPL_PREFIX)/lib -lppl
++-L$(GMP_PREFIX)/lib -lgmpxx} in the command line in your Makefile
++(followed by the standard @samp{-lapron -litvmpq -litvdbl
++-L$(MPFR_PREFIX)/lib -lmpfr -L$(GMP_PREFIX)/lib -lgmp}). The
++@file{libgmpxx.a} library is the C++ wrapper on top of the GMP
++library. Ensure that your GMP installation contains it, as it is not
++always installed by default.
++
++All scalars of type @code{double} are converted to scalars of type
++@code{mpq_t} inside APRON PPL, as APRON PPL works internally with exact
++rational arithmetics. So when possible it is better for the user (in
++term of efficiency) to convert already @code{double} scalars to
++@code{mpq_t} scalars.
++
++The wrapper library is available in debug mode
++(@samp{libapron_ppl_debug.a}).
++
++@c ===================================================================
++@node Allocating APRON PPL managers, APRON PPL standard options, Use of APRON PPL, PPL
++@subsection Allocating APRON PPL managers
++@c ===================================================================
++
++@deftypefun ap_manager_t* ap_ppl_poly_manager_alloc (bool @var{strict})
++Allocate a APRON manager for convex polyhedra, linked to the PPL
++library.
++
++The @var{strict} option, when true, enables strict constraints in polyhedra
++(like @code{x>0}). Managers in strict mode or in loose mode
++(strict constraints disabled) are not compatible, and so are
++corresponding abstract values.
++@end deftypefun
++
++@deftypefun ap_manager_t* ap_ppl_grid_manager_alloc ()
++Allocate an APRON manager for linear equalities, linked to the PPL
++library.
++@end deftypefun
++
++@c ===================================================================
++@node APRON PPL standard options, , Allocating APRON PPL managers, PPL
++@subsection APRON PPL standard options
++@c ===================================================================
++
++Currently, the only options available are related to the widening
++operators.
++
++@multitable @columnfractions .2 .06 .74
++
++@item Function @tab algo @tab Comments
++@item
++@item widening
++@tab <=0
++@tab CH78 standard widening (Cousot & Halbwachs, POPL'1978).
++@item
++@tab >0
++@tab BHRZ03 widening (Bagnara, Hill, Ricci & Zafanella, SAS'2003)
++@item
++@item widening_threshold
++@tab <=0
++@tab standard widening with threshold
++@item
++@tab =1
++@tab standard widening with threshold, intersected by the bounding box of the convex hull pof the two arguments
++@item
++@tab <=0
++@tab standard widening with threshold
++@item
++@tab =1
++@tab standard widening with threshold, intersected by the bounding box of the convex hull of the second argument. This is actually an extrapolation rather than a widening (termination is not guaranteed)
++@item
++@tab =2
++@tab BHRZ03 widening with threshold
++@item
++@tab =3
++@tab BHRZ03 widening with threshold, intersected by the bounding box of the convex hull of the second argument. This is actually an extrapolation rather than a widening (termination is not guaranteed)
++@end multitable
diff --git a/sci-mathematics/apron/files/apron-0.9.9-ppl.patch b/sci-mathematics/apron/files/apron-0.9.9-ppl.patch
new file mode 100644
index 000000000..906457361
--- /dev/null
+++ b/sci-mathematics/apron/files/apron-0.9.9-ppl.patch
@@ -0,0 +1,318 @@
+diff -Naur apron-0.9.9-orig/ppl/README apron-0.9.9-patch/ppl/README
+--- apron-0.9.9-orig/ppl/README 2007-11-29 15:34:47.000000000 +0000
++++ apron-0.9.9-patch/ppl/README 2009-03-22 01:50:01.000000000 +0000
+@@ -2,7 +2,7 @@
+ #
+ # APRON Library / Parma Polyhedra Library
+ #
+-# Copyright (C) Antoine Mine' 2006
++# Copyright (C) Antoine Mine' 2006-2009
+
+ # This file is part of the APRON Library, released under GPL license.
+ # Please read the COPYING file packaged in the distribution
+@@ -13,7 +13,7 @@
+ Requirements:
+ - APRON
+ - ITV
+-- PPL library version 0.9, with GMP support
++- PPL library version 0.9 or 0.10, with GMP support
+ - GMPXX (normally installed with GMP)
+ - for apron_ppl_test: NewPolka APRON module
+
+@@ -21,19 +21,15 @@
+ will automatically build and install this module.
+
+
+-IMPORTANT
+-
+-!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+-
+- PPL 0.9 misses Grid_Generator::coefficient and must be patched
+-
+- please apply ppl.patch against PPL 0.9 as follows:
+-
++9/2/2009 changes
++- the wrapper has been updated to compile PPL version 0.10
++- it should still compile with version 0.9 of PPL provided that you apply
++the provided patch
+ 1. go to the directoy containing the ppl-0.9 directory
+ 2. type 'patch -p0 <PREFIX/apron/ppl/ppl.patch'
+ and then compile ppl
+-
+-!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
++- you can also compile with version 0.10 of PPL _without applying any patch_
++- calls to depreciated _and_minimize functions have been removed
+
+
+ What is provided:
+@@ -51,8 +47,7 @@
+ - Polyhedra and grids are experimental but tested
+ - semantics of assign and subst on grids with integer variables is not
+ fully aggreed upon and may change
+-- no support for other domains in PPL (BD_Shape, Powerset)
+-- only PPL 0.9 was tested, other PPL version might not work
++- no support for other domains in PPL (BD_Shape, Octagonal_Shape, Powerset)
+ - not implemented: fprintfdiff, (de)serialize_raw
+ - precision could be improved for:
+ . sat_lincons
+diff -Naur apron-0.9.9-orig/ppl/ppl_grid.cc apron-0.9.9-patch/ppl/ppl_grid.cc
+--- apron-0.9.9-orig/ppl/ppl_grid.cc 2008-06-05 15:26:58.000000000 +0000
++++ apron-0.9.9-patch/ppl/ppl_grid.cc 2009-03-22 01:50:01.000000000 +0000
+@@ -17,8 +17,8 @@
+ #include <assert.h>
+ #include "ap_generic.h"
+ #include "ap_ppl.h"
+-#include "ppl_grid.hh"
+ #include "ppl_user.hh"
++#include "ppl_grid.hh"
+
+ #include <ppl.hh>
+ using namespace std;
+@@ -60,13 +60,18 @@
+ void PPL_Grid::reduce()
+ {
+ for (size_t i=0;i<intdim;i++)
+- p->add_congruence_and_minimize((Variable(i) %=0) / 1);
++ p->add_congruence((Variable(i) %=0) / 1);
+ }
+
+ void PPL_Grid::forget_dim(size_t dim)
+ {
+- if (intdim>dim) p->add_generator_and_minimize(Grid_Generator::parameter(Variable(dim)));
+- else p->add_generator_and_minimize(Grid_Generator::line(Variable(dim)));
++#ifndef PPL_0_9
++ if (intdim>dim) p->add_grid_generator(Grid_Generator::parameter(Variable(dim)));
++ else p->add_grid_generator(Grid_Generator::grid_line(Variable(dim)));
++#else
++ if (intdim>dim) p->add_generator(Grid_Generator::parameter(Variable(dim)));
++ else p->add_generator(Grid_Generator::line(Variable(dim)));
++#endif
+ }
+
+ PPL_Grid::~PPL_Grid() { delete p; }
+@@ -221,7 +226,11 @@
+ ((PPL_Grid*)a)->reduce();
+ /* the calls force in-place minimisation */
+ (void)a->p->minimized_congruences();
++#ifndef PPL_0_9
++ (void)a->p->minimized_grid_generators();
++#else
+ (void)a->p->minimized_generators();
++#endif
+ }
+ CATCH_WITH_VOID(AP_FUNID_MINIMIZE);
+ }
+@@ -235,7 +244,11 @@
+ ((PPL_Grid*)a)->reduce();
+ /* the calls force in-place minimisation */
+ (void)a->p->minimized_congruences();
++#ifndef PPL_0_9
++ (void)a->p->minimized_grid_generators();
++#else
+ (void)a->p->minimized_generators();
++#endif
+ }
+ CATCH_WITH_VOID(AP_FUNID_CANONICALIZE);
+ }
+@@ -244,6 +257,14 @@
+ {
+ man->result.flag_exact = man->result.flag_best = true;
+ try {
++ ((PPL_Grid*)a)->reduce();
++ /* the calls force in-place minimisation */
++ (void)a->p->minimized_congruences();
++#ifndef PPL_0_9
++ (void)a->p->minimized_grid_generators();
++#else
++ (void)a->p->minimized_generators();
++#endif
+ return a->p->total_memory_in_bytes();
+ }
+ CATCH_WITH_VAL(AP_FUNID_HASH,0);
+@@ -305,7 +326,11 @@
+ ap_lincons0_array_clear(&ar);
+ /* dump generators */
+ fprintf(stream,"generators: ");
++#ifndef PPL_0_9
++ ap_generator0_array_t ar2 = ap_ppl_to_generator_array(a->p->grid_generators());
++#else
+ ap_generator0_array_t ar2 = ap_ppl_to_generator_array(a->p->generators());
++#endif
+ ap_generator0_array_fprint(stream,&ar2,NULL);
+ ap_generator0_array_clear(&ar2);
+ }
+@@ -371,7 +396,7 @@
+ Congruence_System c;
+ if (!ap_ppl_of_box(c,tinterval,intdim,realdim))
+ man->result.flag_exact = man->result.flag_best = false;
+- r->p->add_recycled_congruences_and_minimize(c);
++ r->p->add_recycled_congruences(c);
+ return r;
+ }
+ CATCH_WITH_DIM(AP_FUNID_OF_BOX,intdim,realdim);
+@@ -520,7 +545,11 @@
+ {
+ man->result.flag_exact = man->result.flag_best = true;
+ try {
++#ifndef PPL_0_9
++ Grid_Generator g = Grid_Generator::grid_line(Variable(dim));
++#else
+ Grid_Generator g = Grid_Generator::line(Variable(dim));
++#endif
+ return a->p->relation_with(g) == Poly_Gen_Relation::subsumes();
+ }
+ CATCH_WITH_VAL(AP_FUNID_IS_DIMENSION_UNCONSTRAINED,false);
+@@ -671,7 +700,11 @@
+ {
+ man->result.flag_exact = man->result.flag_best = true;
+ try {
++#ifndef PPL_0_9
++ return ap_ppl_to_generator_array(a->p->grid_generators());
++#else
+ return ap_ppl_to_generator_array(a->p->generators());
++#endif
+ }
+ CATCH_WITH_VAL(AP_FUNID_TO_GENERATOR_ARRAY,ap_ppl_generator_universe(a->p->space_dimension()));
+ }
+@@ -706,7 +739,11 @@
+ try {
+ PPL_Grid* r = destructive ? a1 : new PPL_Grid(*a1);
+ /* TODO: should we use join_assign_if_exact? */
++#ifndef PPL_0_9
++ r->p->upper_bound_assign(*a2->p);
++#else
+ r->p->join_assign(*a2->p);
++#endif
+ return r;
+ }
+ CATCH_WITH_GRID(AP_FUNID_JOIN,a1);
+@@ -738,7 +775,11 @@
+ PPL_Grid* r = new PPL_Grid(*tab[0]);
+ for (size_t i=1;i<size;i++)
+ /* TODO: should we use join_assign_if_exact? */
++#ifndef PPL_0_9
++ r->p->upper_bound_assign(*tab[i]->p);
++#else
+ r->p->join_assign(*tab[i]->p);
++#endif
+ return r;
+ }
+ CATCH_WITH_GRID(AP_FUNID_JOIN_ARRAY,tab[0]);
+@@ -757,7 +798,7 @@
+ Congruence_System c;
+ if (!ap_ppl_of_lincons_array(intern->itv,c,array))
+ man->result.flag_exact = man->result.flag_best = false;
+- r->p->add_recycled_congruences_and_minimize(c);
++ r->p->add_recycled_congruences(c);
+ return r;
+ }
+ CATCH_WITH_GRID(AP_FUNID_MEET_LINCONS_ARRAY,a);
+@@ -790,7 +831,11 @@
+ Grid_Generator_System c;
+ if (!ap_ppl_of_generator_array(intern->itv,c,array))
+ man->result.flag_exact = man->result.flag_best = false;
+- r->p->add_recycled_generators_and_minimize(c);
++#ifndef PPL_0_9
++ r->p->add_recycled_grid_generators(c);
++#else
++ r->p->add_recycled_generators(c);
++#endif
+ r->reduce();
+ }
+ return r;
+@@ -949,7 +994,7 @@
+ r->forget_dim(tdim[i]);
+ if (project) {
+ for (size_t i=0;i<size;i++)
+- r->p->add_constraint_and_minimize(Variable(tdim[i])==0);
++ r->p->add_constraint(Variable(tdim[i])==0);
+ }
+ else {
+ r->reduce();
+diff -Naur apron-0.9.9-orig/ppl/ppl_poly.cc apron-0.9.9-patch/ppl/ppl_poly.cc
+--- apron-0.9.9-orig/ppl/ppl_poly.cc 2008-06-05 15:24:40.000000000 +0000
++++ apron-0.9.9-patch/ppl/ppl_poly.cc 2009-03-22 01:50:01.000000000 +0000
+@@ -17,10 +17,9 @@
+ #include <assert.h>
+ #include "ap_generic.h"
+ #include "ap_linearize.h"
+-
+ #include "ap_ppl.h"
+-#include "ppl_poly.hh"
+ #include "ppl_user.hh"
++#include "ppl_poly.hh"
+
+ #include <ppl.hh>
+ using namespace std;
+@@ -237,6 +236,8 @@
+ {
+ man->result.flag_exact = man->result.flag_best = true;
+ try {
++ (void)a->p->minimized_constraints();
++ (void)a->p->minimized_generators();
+ return a->p->total_memory_in_bytes();
+ }
+ CATCH_WITH_VAL(AP_FUNID_HASH,0);
+diff -Naur apron-0.9.9-orig/ppl/ppl_user.cc apron-0.9.9-patch/ppl/ppl_user.cc
+--- apron-0.9.9-orig/ppl/ppl_user.cc 2008-01-22 14:20:38.000000000 +0000
++++ apron-0.9.9-patch/ppl/ppl_user.cc 2009-03-22 01:50:01.000000000 +0000
+@@ -83,7 +83,11 @@
+ ap_linexpr0_t* e;
+ int i, n = c.space_dimension();
+ /* special, inconsistent case */
++#ifndef PPL_0_9
++ if (c.is_inconsistent())
++#else
+ if (c.is_trivial_false())
++#endif
+ return ap_lincons0_make_unsat();
+ /* other cases */
+ e = ap_linexpr0_alloc(AP_LINEXPR_DENSE,n);
+@@ -629,9 +633,15 @@
+ }
+ ap_ppl_of_linexpr(intern,l,den,c->linexpr0,1);
+ switch (c->gentyp) {
++#ifndef PPL_0_9
++ case AP_GEN_VERTEX: r = Grid_Generator::grid_point(l,den); return true;
++ case AP_GEN_RAY: r = Grid_Generator::grid_line(l); return false;
++ case AP_GEN_LINE: r = Grid_Generator::grid_line(l); return true;
++#else
+ case AP_GEN_VERTEX: r = Grid_Generator::point(l,den); return true;
+ case AP_GEN_RAY: r = Grid_Generator::line(l); return false;
+ case AP_GEN_LINE: r = Grid_Generator::line(l); return true;
++#endif
+ case AP_GEN_RAYMOD: r = Grid_Generator::parameter(l,den); return false;
+ case AP_GEN_LINEMOD: r = Grid_Generator::parameter(l,den); return true;
+ default:
+@@ -647,7 +657,11 @@
+ {
+ bool exact = true;
+ size_t i;
++#ifndef PPL_0_9
++ Grid_Generator c = Grid_Generator::grid_point();
++#else
+ Grid_Generator c = Grid_Generator::point();
++#endif
+ r.clear();
+ for (i=0;i<a->size;i++) {
+ if (ap_ppl_ap_generator0_select(&a->p[i])){
+diff -Naur apron-0.9.9-orig/ppl/ppl_user.hh apron-0.9.9-patch/ppl/ppl_user.hh
+--- apron-0.9.9-orig/ppl/ppl_user.hh 2007-11-29 15:38:54.000000000 +0000
++++ apron-0.9.9-patch/ppl/ppl_user.hh 2009-03-22 01:50:01.000000000 +0000
+@@ -34,6 +34,16 @@
+ using namespace std;
+ using namespace Parma_Polyhedra_Library;
+ */
++
++#ifndef PPL_VERSION_MAJOR
++#error "no version information"
++#endif
++
++#if (PPL_VERSION_MAJOR==0) && (PPL_VERSION_MINOR <= 9)
++#define PPL_0_9
++#endif
++
++
+ /* ********************************************************************** */
+ /* Types and exceptions */
+ /* ********************************************************************** */
diff --git a/sci-mathematics/frama-c/Manifest b/sci-mathematics/frama-c/Manifest
new file mode 100644
index 000000000..780c97b22
--- /dev/null
+++ b/sci-mathematics/frama-c/Manifest
@@ -0,0 +1,5 @@
+AUX frama-c-20081201-states_hook.patch 3549 RMD160 15c095e75262d1acd70d00d10f9421d91b4f833a SHA1 bd2adb7de2590641da44c861961fd05249b27824 SHA256 a649b99d8fd932de3a681464909ca3cf55dca3d60f547e4a343620f8323b1c3b
+AUX frama-c-20081201-stmt_deps.patch 8682 RMD160 85978998893cfc96d731e9c9c59043ad25c92e92 SHA1 5870e6785fdaa29d542897fe29c87aa5eadee1d6 SHA256 69604af7d8eaf72f767e1b867832ddb7a640bfd15992c16747e3abe0b324970f
+DIST frama-c-Lithium-20081201.tar.gz 9475352 RMD160 8624cf142b627af8800d6712f2adde6f86527ac0 SHA1 e724cd21d77e44645e9369763c848e59cced110b SHA256 56e504a7a475a79880b5e830362aa6d337bbd9bfe4492a546990118b806120a7
+EBUILD frama-c-20081201-r1.ebuild 2690 RMD160 2eb666c48d163a36f112670f1376071a855498b3 SHA1 05bb053fbc99a56e33528bba7f0df100a5c5795c SHA256 cca1db0b8851dff50af305a853739fe56ea2eba858ecc3cbf96f6c7273406fa2
+EBUILD frama-c-20081201.ebuild 2067 RMD160 282200d602933937c7b31e5b06162b11d4d9176b SHA1 cc3233697faa9550354a7fe6cf308bbe3e6c5dcd SHA256 06f00630197cc4fc1a91eca9dde70c8bd1a7a6dedd64aa4ee6feb2285063a04a
diff --git a/sci-mathematics/frama-c/files/frama-c-20081201-states_hook.patch b/sci-mathematics/frama-c/files/frama-c-20081201-states_hook.patch
new file mode 100644
index 000000000..d4b46e38a
--- /dev/null
+++ b/sci-mathematics/frama-c/files/frama-c-20081201-states_hook.patch
@@ -0,0 +1,90 @@
+diff -ru frama-c-Lithium-20081201/Makefile.in frama-c-states_hook/Makefile.in
+--- frama-c-Lithium-20081201/Makefile.in 2008-12-16 10:29:49.000000000 +0100
++++ frama-c-states_hook/Makefile.in 2009-01-17 18:44:46.000000000 +0100
+@@ -857,6 +857,7 @@
+ src/memory_state/memzone_type.cmo \
+ src/memory_state/widen_type.cmo \
+ src/memory_state/relations_type.cmo \
++ src/memory_state/state_set.cmo \
+ src/logic/why_output.cmo
+
+ ACMX = $(ACMO:.cmo=.cmx)
+@@ -1023,7 +1024,7 @@
+ PLUGIN_ENABLE:=@ENABLE_VALUE@
+ PLUGIN_NAME:=Value
+ PLUGIN_DIR:=src/value
+-PLUGIN_CMO:= state_set kf_state eval kinstr register
++PLUGIN_CMO:= kf_state eval kinstr register
+ PLUGIN_GUI_CMO:=register_gui
+ PLUGIN_HAS_MLI:=yes
+ PLUGIN_GUI_HAS_MLI:=yes
+diff -ru frama-c-Lithium-20081201/src/kernel/db.ml frama-c-states_hook/src/kernel/db.ml
+--- frama-c-Lithium-20081201/src/kernel/db.ml 2008-12-16 10:29:48.000000000 +0100
++++ frama-c-states_hook/src/kernel/db.ml 2009-01-17 18:22:38.000000000 +0100
+@@ -257,6 +257,12 @@
+ type t = (kernel_function * kinstr) list * state InstrHashtbl.t
+ end)
+
++ module Record_Value_Superposition_Callbacks =
++ Hook.Build
++ (struct
++ type t = (kernel_function * kinstr) list * State_set.t InstrHashtbl.t
++ end)
++
+ module Call_Value_Callbacks =
+ Hook.Build
+ (struct type t = state * (Db_types.kernel_function * kinstr) list end)
+diff -ru frama-c-Lithium-20081201/src/kernel/db.mli frama-c-states_hook/src/kernel/db.mli
+--- frama-c-Lithium-20081201/src/kernel/db.mli 2008-12-16 10:29:48.000000000 +0100
++++ frama-c-states_hook/src/kernel/db.mli 2009-01-17 18:23:57.000000000 +0100
+@@ -248,6 +248,9 @@
+ module Record_Value_Callbacks:
+ Hook.S with type param = (kernel_function * kinstr) list
+ * state Cilutil.InstrHashtbl.t
++ module Record_Value_Superposition_Callbacks:
++ Hook.S with type param = (kernel_function * kinstr) list
++ * State_set.t Cilutil.InstrHashtbl.t
+
+ (** Actions to perform at each treatment of a "call" statement.
+ @plugin development guide *)
+diff -ru frama-c-Lithium-20081201/src/value/eval.ml frama-c-states_hook/src/value/eval.ml
+--- frama-c-Lithium-20081201/src/value/eval.ml 2008-12-16 10:29:49.000000000 +0100
++++ frama-c-states_hook/src/value/eval.ml 2009-01-17 18:21:06.000000000 +0100
+@@ -2526,8 +2526,26 @@
+ (*Format.printf "Done Merging current@.";*)
+
+ if not degenerate &&
+- not (Db.Value.Record_Value_Callbacks.is_empty ())
++ ((not (Db.Value.Record_Value_Callbacks.is_empty ())) ||
++ (not (Db.Value.Record_Value_Superposition_Callbacks.is_empty ())))
+ then begin
++ let stack_for_callbacks = for_callbacks_stack () in
++
++ if not (Db.Value.Record_Value_Callbacks.is_empty ())
++ then begin
++ let current_superpositions = InstrHashtbl.create 17 in
++ InstrHashtbl.iter
++ (fun k record ->
++ InstrHashtbl.add current_superpositions k record.superposition)
++ current_table;
++
++(* Format.printf "[values] now calling Record_Value_Superposition callbacks@."; *)
++ Db.Value.Record_Value_Superposition_Callbacks.apply
++ (stack_for_callbacks, current_superpositions);
++
++ end ;
++ if not (Db.Value.Record_Value_Callbacks.is_empty ())
++ then begin
+ (* Format.printf "[values] now calling Record_Value callbacks@."; *)
+
+ let current_states = InstrHashtbl.create 17 in
+@@ -2537,7 +2555,8 @@
+ current_table;
+
+ Db.Value.Record_Value_Callbacks.apply
+- ((for_callbacks_stack ()), current_states);
++ (stack_for_callbacks, current_states);
++ end
+ end;
+ InstrHashtbl.clear current_table;
+
diff --git a/sci-mathematics/frama-c/files/frama-c-20081201-stmt_deps.patch b/sci-mathematics/frama-c/files/frama-c-20081201-stmt_deps.patch
new file mode 100644
index 000000000..a0ab888ba
--- /dev/null
+++ b/sci-mathematics/frama-c/files/frama-c-20081201-stmt_deps.patch
@@ -0,0 +1,206 @@
+diff -Naur frama-c-Lithium-20081201-orig/src/ai/base.ml frama-c-Lithium-20081201-patch/src/ai/base.ml
+--- frama-c-Lithium-20081201-orig/src/ai/base.ml 2008-12-16 10:29:48.000000000 +0100
++++ frama-c-Lithium-20081201-patch/src/ai/base.ml 2009-02-16 14:43:59.000000000 +0100
+@@ -188,6 +188,11 @@
+ assert (Int.eq size Int.zero);
+ Unknown (Int.zero, Bit_utils.max_bit_address ())
+
++let get_varinfo t =
++ match t with
++ | Var (t,_) | Initialized_Var (t,_) -> t
++ | _ -> assert false
++
+ let create_varinfo varinfo =
+ assert (not varinfo.vlogic);
+ Var (varinfo,validity_from_type varinfo)
+diff -Naur frama-c-Lithium-20081201-orig/src/ai/base.mli frama-c-Lithium-20081201-patch/src/ai/base.mli
+--- frama-c-Lithium-20081201-orig/src/ai/base.mli 2008-12-16 10:29:48.000000000 +0100
++++ frama-c-Lithium-20081201-patch/src/ai/base.mli 2009-02-16 14:43:59.000000000 +0100
+@@ -55,6 +55,7 @@
+ val is_local: t -> Cil_types.fundec -> bool
+ val is_hidden_variable : t -> bool
+ val validity_from_type : Cil_types.varinfo -> validity
++val get_varinfo : t -> Cil_types.varinfo
+ val create_varinfo : Cil_types.varinfo -> t
+ val create_logic : Cil_types.varinfo -> validity -> t
+ val create_initialized : Cil_types.varinfo -> validity -> t
+diff -Naur frama-c-Lithium-20081201-orig/src/from/register.ml frama-c-Lithium-20081201-patch/src/from/register.ml
+--- frama-c-Lithium-20081201-orig/src/from/register.ml 2008-12-16 10:29:48.000000000 +0100
++++ frama-c-Lithium-20081201-patch/src/from/register.ml 2009-02-16 14:43:55.000000000 +0100
+@@ -572,7 +572,7 @@
+ Db.Value.is_reachable (Values_To_Use.get_state (Kstmt stmt))
+
+ (* Remove all local variables and formals from table *)
+- let externalize return fundec state =
++ let externalize return fundec state strip =
+ let deps_return = (match return.skind with
+ | Return (Some (Lval v),_) ->
+ let deps, looking_for =
+@@ -596,9 +596,10 @@
+ Lmap_bitwise.From_Model.LOffset.empty
+ | _ -> assert false)
+ in
+- let deps_table = Lmap_bitwise.From_Model.filter_base
++ let deps_table = if strip then Lmap_bitwise.From_Model.filter_base
+ (fun v -> not (Base.is_formal_or_local v fundec))
+ state.deps_table
++ else state.deps_table
+ in
+ { deps_return = deps_return;
+ Function_Froms.deps_table = deps_table }
+@@ -617,7 +618,7 @@
+ else Dataflow.GUnreachable
+ end
+
+-let compute_using_cfg kf = match kf.fundec with
++let compute_using_cfg kf ksid = match kf.fundec with
+ | Declaration _ -> assert false
+ | Definition (f,_) ->
+ try
+@@ -656,6 +657,10 @@
+ Format.printf "[from] stack with %s\n@\n" (get_name g))
+ call_stack;*)
+
++ let sid,strip = match ksid with
++ None -> ret_id.sid,true
++ | Some id -> id,false
++ in
+ let last_from =
+ try
+ if Db.Value.is_reachable (Values_To_Use.get_state (Kstmt ret_id))
+@@ -663,7 +668,8 @@
+ Computer.externalize
+ ret_id
+ f
+- (Computer.StmtStartData.find ret_id.sid)
++ (Computer.StmtStartData.find sid)
++ strip
+ else
+ raise Not_found
+ with Not_found -> begin
+@@ -806,7 +812,7 @@
+
+ let result = match kf.fundec with
+ | Definition _ ->
+- compute_using_cfg kf
++ compute_using_cfg kf None
+ | Declaration _ ->
+ compute_using_prototype kf
+ in
+@@ -846,7 +852,8 @@
+ let () =
+ force_compute := From2.compute;
+ Db.From.compute := (fun kf -> ignore (Functionwise_From_to_use.memo kf));
+- Db.From.get := Functionwise_From_to_use.memo
++ Db.From.get := Functionwise_From_to_use.memo;
++ Db.From.compute_using_cfg := From2.compute_using_cfg
+
+ let () = Db.From.pretty :=
+ (fun fmt v ->
+diff -Naur frama-c-Lithium-20081201-orig/src/kernel/db.ml frama-c-Lithium-20081201-patch/src/kernel/db.ml
+--- frama-c-Lithium-20081201-orig/src/kernel/db.ml 2009-02-14 00:10:32.000000000 +0100
++++ frama-c-Lithium-20081201-patch/src/kernel/db.ml 2009-02-16 14:43:55.000000000 +0100
+@@ -437,6 +437,7 @@
+ let is_computed = mk_fun "From.is_computed"
+ let pretty = mk_fun "From.pretty"
+ let get = mk_fun "From.get"
++ let compute_using_cfg = mk_fun "From.compute_using_cfg"
+ let self = ref Project.Computation.dummy
+
+ let display = mk_fun "From.display"
+diff -Naur frama-c-Lithium-20081201-orig/src/kernel/db.mli frama-c-Lithium-20081201-patch/src/kernel/db.mli
+--- frama-c-Lithium-20081201-orig/src/kernel/db.mli 2009-02-14 00:10:32.000000000 +0100
++++ frama-c-Lithium-20081201-patch/src/kernel/db.mli 2009-02-16 14:43:55.000000000 +0100
+@@ -299,6 +299,7 @@
+ @return true iff the analysis has been performed *)
+
+ val get : (kernel_function -> Function_Froms.t) p_ref
++ val compute_using_cfg : (kernel_function -> int option -> Function_Froms.t) p_ref
+ val access : (Locations.Zone.t -> from_model -> Locations.Zone.t) p_ref
+ val find_deps_no_transitivity : (kinstr -> exp -> Locations.Zone.t) p_ref
+ val self: Project.Computation.t p_ref
+diff -Naur frama-c-Lithium-20081201-orig/src/memory_state/lmap_bitwise.ml frama-c-Lithium-20081201-patch/src/memory_state/lmap_bitwise.ml
+--- frama-c-Lithium-20081201-orig/src/memory_state/lmap_bitwise.ml 2008-12-16 10:29:49.000000000 +0100
++++ frama-c-Lithium-20081201-patch/src/memory_state/lmap_bitwise.ml 2009-02-16 14:43:57.000000000 +0100
+@@ -67,6 +67,7 @@
+ val find_base: t -> Zone.t -> LOffset.t
+ exception Cannot_fold
+ val fold : (Zone.t -> bool * y -> 'a -> 'a) -> t -> 'a -> 'a
++ val fold_base : (Base.t -> LOffset.t -> 'a -> 'a) -> t -> 'a -> 'a
+ val map2 : ((bool * y) option -> (bool * y) option -> bool * y)
+ -> t -> t -> t
+ val copy_paste : f:(bool * y -> bool * y) -> location -> location -> t -> t
+@@ -142,6 +143,11 @@
+ m
+ acc
+
++ let fold_base f m acc=
++ match m with
++ | Top -> raise Cannot_fold
++ | Map m -> LBase.fold f m acc
++
+ let pretty fmt m =
+ match m with
+ Top -> Format.fprintf fmt "@[<v>FROMTOP@]"
+diff -Naur frama-c-Lithium-20081201-orig/src/memory_state/lmap_bitwise.mli frama-c-Lithium-20081201-patch/src/memory_state/lmap_bitwise.mli
+--- frama-c-Lithium-20081201-orig/src/memory_state/lmap_bitwise.mli 2008-12-16 10:29:49.000000000 +0100
++++ frama-c-Lithium-20081201-patch/src/memory_state/lmap_bitwise.mli 2009-02-16 14:43:57.000000000 +0100
+@@ -66,7 +66,7 @@
+ val map_and_merge : (y -> y) -> t -> t -> t
+ (** [map_and_merge f m1 m2] maps [f] on values in [m1] and [add_exact]
+ all elements of the mapped [m1] to [m2] *)
+-
++
+ val filter_base : (Base.t -> bool) -> t -> t
+ val find : t -> Zone.t -> y
+ val find_base: t -> Zone.t -> LOffset.t
+@@ -77,6 +77,7 @@
+ associates to a zone a boolean representing the possibility that the
+ zone was not modified, and a value of type y. May raise
+ [Cannot_fold]. *)
++ val fold_base : (Base.t -> LOffset.t -> 'a -> 'a) -> t -> 'a -> 'a
+
+ val map2 : ((bool * y) option -> (bool * y) option -> bool * y)
+ -> t -> t -> t
+diff -Naur frama-c-Lithium-20081201-orig/src/memory_state/offsetmap.ml frama-c-Lithium-20081201-patch/src/memory_state/offsetmap.ml
+--- frama-c-Lithium-20081201-orig/src/memory_state/offsetmap.ml 2008-12-16 10:29:49.000000000 +0100
++++ frama-c-Lithium-20081201-patch/src/memory_state/offsetmap.ml 2009-02-16 14:44:02.000000000 +0100
+@@ -122,6 +122,8 @@
+
+ val iter_contents : (y -> unit) -> t -> Int.t -> unit
+ (** Iter on the contents of offsetmap of given size *)
++
++ val fold : (Int.t * Int.t -> Int.t * Int.t * y -> 'a -> 'a) -> t -> 'a -> 'a
+ end
+
+
+@@ -1399,6 +1401,8 @@
+ Int_Interv.check_coverage itv concerned_intervals;
+ with Is_not_included -> f V.top);
+ List.iter (fun (_,(_,_,b)) -> f b) concerned_intervals
++
++ let fold f m = Int_Interv_Map.fold f m
+
+ end
+
+@@ -1674,6 +1678,8 @@
+
+ let iter_contents f o size =
+ M.iter_contents f o.v size
++
++ let fold f v = M.fold f v.v
+
+ end
+
+diff -Naur frama-c-Lithium-20081201-orig/src/memory_state/offsetmap.mli frama-c-Lithium-20081201-patch/src/memory_state/offsetmap.mli
+--- frama-c-Lithium-20081201-orig/src/memory_state/offsetmap.mli 2008-12-16 10:29:49.000000000 +0100
++++ frama-c-Lithium-20081201-patch/src/memory_state/offsetmap.mli 2009-02-16 14:44:02.000000000 +0100
+@@ -124,6 +124,8 @@
+
+ val iter_contents : (y -> unit) -> t -> Int.t -> unit
+ (** Iter on the contents of offsetmap of given size *)
++
++ val fold : (Int.t * Int.t -> Int.t * Int.t * y -> 'a -> 'a) -> t -> 'a -> 'a
+ end
+
+ module Make(V : Lattice_With_Isotropy.S):
diff --git a/sci-mathematics/frama-c/frama-c-20081201-r1.ebuild b/sci-mathematics/frama-c/frama-c-20081201-r1.ebuild
new file mode 100644
index 000000000..a5a1974e4
--- /dev/null
+++ b/sci-mathematics/frama-c/frama-c-20081201-r1.ebuild
@@ -0,0 +1,87 @@
+# Copyright 1999-2009 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: Exp $
+
+inherit autotools eutils
+
+DESCRIPTION="Frama-C is a suite of tools dedicated to the analysis of the source code of software written in C."
+HOMEPAGE="http://www.frama-c.cea.fr/"
+SRC_URI="http://www.frama-c.cea.fr/download/${PN/-c/-c-Lithium}-${PV/_/+}.tar.gz"
+
+LICENSE="LGPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~ppc ~sparc ~x86"
+
+IUSE="apron coq doc gappa gtk pff pvs stateshook"
+RESTRICT="strip"
+
+RDEPEND="!sci-mathematics/why
+ sci-mathematics/ltl2ba
+ apron? ( sci-mathematics/apron )
+ coq? ( sci-mathematics/coq )
+ gappa? ( sci-mathematics/gappalib-coq )
+ pff? ( sci-mathematics/pff )
+ pvs? ( sci-mathematics/pvs )"
+
+DEPEND="${RDEPEND}
+ >=dev-lang/ocaml-3.09
+ gtk? ( >=dev-ml/lablgtk-2.6 )"
+
+S="${WORKDIR}/${PN/-c/-c-Lithium}-${PV/_/+}"
+
+src_unpack(){
+ unpack ${A}
+ cd "${S}"
+
+ if use stateshook; then
+ einfo "moving state_set.ml* from value/ to memory_state/ ..."
+ mv src/value/state_set.ml* src/memory_state/ || die
+ epatch "${FILESDIR}/${P}-states_hook.patch"
+ epatch "${FILESDIR}/frama-c-20081201-stmt_deps.patch"
+ fi
+
+ sed -i why/Makefile.in \
+ -e "s/\$(COQLIB)/\$(DESTDIR)\/\$(COQLIB)/g" \
+ -e "s/-w \$(DESTDIR)\/\$(COQLIB)/-w \$(COQLIB)/g" \
+ -e "s/\$(PVSLIB)\/why/\$(DESTDIR)\/\$(PVSLIB)\/why/g" \
+ -e "s/\$(MIZFILES)/\$(DESTDIR)\/\$(MIZFILES)/g" \
+ -e "s/@MIZARLIB@/\$(DESTDIR)\/@MIZARLIB@/g"
+
+ sed -i configure.in -e "s/--mandir=\$mandir --enable-apron=\$HAS_APRON/ \
+ --mandir=\$mandir --host=\$host --build=\$build --enable-apron=\$HAS_APRON/g"
+ eautoreconf
+}
+
+src_compile() {
+ if use gtk; then
+ myconf="--enable-gui"
+ else
+ myconf="--disable-gui"
+ fi
+
+ econf ${myconf} || die "econf failed"
+ #Makfile need a fix to enable parallel building for the 'depend' rule
+ emake -j1 depend || die "emake depend failed"
+ emake all top DESTDIR="/" || die "emake failed"
+}
+
+src_install(){
+ emake install DESTDIR="${D}" || die "emake install failed"
+ dodoc Changelog doc/README
+ for i in why/CHANGES why/COPYING why/README why/Version;
+ do mv $i $i.why; done
+ dodoc why/CHANGES.why why/COPYING.why why/README.why why/Version.why
+ doman why/doc/why.1
+
+ if use doc; then
+ mv why/doc/manual.ps why/doc/why-manual.ps
+ dodoc doc/manuals/* why/doc/why-manual.ps
+ fi
+
+ if use stateshook; then
+ ewarn "USE flag 'stateshook' is enabled, it is not officially supported so do not report any bug upstream !"
+ ewarn "The value analysis does not keep all the several states attached to a statement but just their union."
+ ewarn "With this patch you can access all these states through a hook while the analysis is taking place."
+ fi
+}
+
diff --git a/sci-mathematics/frama-c/frama-c-20081201.ebuild b/sci-mathematics/frama-c/frama-c-20081201.ebuild
new file mode 100644
index 000000000..91c5fb33e
--- /dev/null
+++ b/sci-mathematics/frama-c/frama-c-20081201.ebuild
@@ -0,0 +1,74 @@
+# Copyright 1999-2009 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: Exp $
+
+inherit autotools eutils
+
+DESCRIPTION="Frama-C is a suite of tools dedicated to the analysis of the source code of software written in C."
+HOMEPAGE="http://www.frama-c.cea.fr/"
+SRC_URI="http://www.frama-c.cea.fr/download/${PN/-c/-c-Lithium}-${PV/_/+}.tar.gz"
+
+LICENSE="LGPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~ppc ~sparc ~x86"
+
+IUSE="apron coq doc gappa gtk pff pvs"
+RESTRICT="strip"
+
+RDEPEND="!sci-mathematics/why
+ sci-mathematics/ltl2ba
+ apron? ( sci-mathematics/apron )
+ coq? ( sci-mathematics/coq )
+ gappa? ( sci-mathematics/gappalib-coq )
+ pff? ( sci-mathematics/pff )
+ pvs? ( sci-mathematics/pvs )"
+
+DEPEND="${RDEPEND}
+ >=dev-lang/ocaml-3.09
+ gtk? ( >=dev-ml/lablgtk-2.6 )"
+
+S="${WORKDIR}/${PN/-c/-c-Lithium}-${PV/_/+}"
+
+src_unpack(){
+ unpack ${A}
+ cd "${S}"
+
+ sed -i why/Makefile.in \
+ -e "s/\$(COQLIB)/\$(DESTDIR)\/\$(COQLIB)/g" \
+ -e "s/-w \$(DESTDIR)\/\$(COQLIB)/-w \$(COQLIB)/g" \
+ -e "s/\$(PVSLIB)\/why/\$(DESTDIR)\/\$(PVSLIB)\/why/g" \
+ -e "s/\$(MIZFILES)/\$(DESTDIR)\/\$(MIZFILES)/g" \
+ -e "s/@MIZARLIB@/\$(DESTDIR)\/@MIZARLIB@/g"
+
+ sed -i configure.in -e "s/--mandir=\$mandir --enable-apron=\$HAS_APRON/ \
+ --mandir=\$mandir --host=\$host --build=\$build --enable-apron=\$HAS_APRON/g"
+ eautoreconf
+}
+
+src_compile() {
+ if use gtk; then
+ myconf="--enable-gui"
+ else
+ myconf="--disable-gui"
+ fi
+
+ econf ${myconf} || die "econf failed"
+ #Makfile need a fix to enable parallel building for the 'depend' rule
+ emake -j1 depend || die "emake depend failed"
+ emake all top DESTDIR="/" || die "emake failed"
+}
+
+src_install(){
+ emake install DESTDIR="${D}" || die "emake install failed"
+ dodoc Changelog doc/README
+ for i in why/CHANGES why/COPYING why/README why/Version;
+ do mv $i $i.why; done
+ dodoc why/CHANGES.why why/COPYING.why why/README.why why/Version.why
+ doman why/doc/why.1
+
+ if use doc; then
+ mv why/doc/manual.ps why/doc/why-manual.ps
+ dodoc doc/manuals/* why/doc/why-manual.ps
+ fi
+}
+
diff --git a/sci-mathematics/gappa/Manifest b/sci-mathematics/gappa/Manifest
new file mode 100644
index 000000000..ad61f650d
--- /dev/null
+++ b/sci-mathematics/gappa/Manifest
@@ -0,0 +1,2 @@
+DIST gappa-0.11.0.tar.gz 241040 RMD160 ed6197ba8a9ab3b20ea77bce8d44d7ad6b3974dc SHA1 91cc38cccf214280911aba50744b3dc40e397580 SHA256 cd129fe7586f29dbb62d5d4e200362c84d83af2735f69cc4f113fe2910410171
+EBUILD gappa-0.11.0.ebuild 1313 RMD160 56cd02144c4b35f5a9546e6fc1fdbe9bc6062ca6 SHA1 1aabbd1abd5af060bb44b3cdd7ef2c48b48cc504 SHA256 f6e35474f467d01673b814bfe360b8a7714a7e85ce9b8b46e450843801ae11b5
diff --git a/sci-mathematics/gappa/gappa-0.11.0.ebuild b/sci-mathematics/gappa/gappa-0.11.0.ebuild
new file mode 100644
index 000000000..c742352ac
--- /dev/null
+++ b/sci-mathematics/gappa/gappa-0.11.0.ebuild
@@ -0,0 +1,55 @@
+# Copyright 1999-2009 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: Exp $
+
+DESCRIPTION="A tool to help verifying and proving properties on floating-point or fixed-point arithmetic."
+HOMEPAGE="http://lipforge.ens-lyon.fr/www/gappa/"
+SRC_URI="http://lipforge.ens-lyon.fr/frs/download.php/150/${P}.tar.gz"
+
+LICENSE="CeCILL GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~ppc ~sparc ~x86"
+
+IUSE="doc"
+
+RDEPEND="dev-libs/gmp
+ dev-libs/mpfr
+ dev-libs/boost"
+
+DEPEND="${RDEPEND}
+ doc? ( app-text/texlive
+ app-text/ghostscript-gpl
+ app-doc/doxygen )"
+
+src_unpack() {
+ unpack ${A}
+ cd ${S}
+
+ sed -i doc/doxygen/Doxyfile \
+ -e "s/GENERATE_LATEX = NO/GENERATE_LATEX = YES/g" \
+ -e "s/USE_PDFLATEX = NO/USE_PDFLATEX = YES/g" \
+ -e "s/PDF_HYPERLINKS = NO/PDF_HYPERLINKS = YES/g"
+}
+
+src_compile(){
+ econf || die "econf failed"
+ emake DESTDIR="/" || die "emake failed"
+
+ if use doc; then
+ cd doc/doxygen
+ doxygen Doxyfile || die "doxygen failed"
+ cd ${S}
+ emake -C doc/doxygen/latex || die "emake doc failed"
+ fi
+}
+
+src_install(){
+ emake install DESTDIR="${D}" || die "emake install failed"
+ dodoc AUTHORS NEWS README
+
+ if use doc; then
+ mv doc/doxygen/latex/refman.pdf ./gappa.pdf
+ dodoc ./gappa.pdf
+ fi
+}
+
diff --git a/sci-mathematics/gappalib-coq/Manifest b/sci-mathematics/gappalib-coq/Manifest
new file mode 100644
index 000000000..6ef4ea6b2
--- /dev/null
+++ b/sci-mathematics/gappalib-coq/Manifest
@@ -0,0 +1,2 @@
+DIST gappalib-coq-0.11.tar.gz 103864 RMD160 7472643ec1c66567a39431980a3c9bc26af2d6c3 SHA1 2a2a15d49a68b288786159b4730535a12246bce6 SHA256 4042609dcaa5f5833deb6fa8cfa643cdb05e51b118f9aff89b00647f7d526873
+EBUILD gappalib-coq-0.11.ebuild 885 RMD160 9f3afe6efa93669ec376b5051e6d4bb877a7977e SHA1 4178fed1956ae75171b7c23fd0d0f9333c32da31 SHA256 62ab61cfa6556145c187c5a107abcd4cb484043098bba65eccd27942c49e854e
diff --git a/sci-mathematics/gappalib-coq/gappalib-coq-0.11.ebuild b/sci-mathematics/gappalib-coq/gappalib-coq-0.11.ebuild
new file mode 100644
index 000000000..fe2100eb2
--- /dev/null
+++ b/sci-mathematics/gappalib-coq/gappalib-coq-0.11.ebuild
@@ -0,0 +1,37 @@
+# Copyright 1999-2009 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: Exp $
+
+DESCRIPTION="This library allows the certificates Gappa generates to be imported by the Coq."
+HOMEPAGE="http://lipforge.ens-lyon.fr/www/gappa/"
+SRC_URI="http://lipforge.ens-lyon.fr/frs/download.php/151/${P}.tar.gz"
+
+LICENSE="LGPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~ppc ~sparc ~x86"
+
+IUSE=""
+
+RDEPEND="sci-mathematics/gappa
+ sci-mathematics/coq"
+
+DEPEND="${RDEPEND}"
+
+src_unpack(){
+ unpack ${A}
+ cd ${S}
+
+ sed -i configure -e "s/if test \"\$libdir\" = '\${exec_prefix}\/lib';/ \
+ if test \"\$libdir\" = '\${exec_prefix}\/lib' -o "\$libdir" = \"\${prefix}\/lib64\";/g"
+}
+
+src_compile(){
+ econf || die "econf failed"
+ emake DESTDIR="/" || die "emake failed"
+}
+
+src_install(){
+ emake install DESTDIR="${D}" || die "emake install failed"
+ dodoc NEWS README AUTHORS
+}
+
diff --git a/sci-mathematics/ltl2ba/Manifest b/sci-mathematics/ltl2ba/Manifest
new file mode 100644
index 000000000..2a02e42b4
--- /dev/null
+++ b/sci-mathematics/ltl2ba/Manifest
@@ -0,0 +1,2 @@
+DIST ltl2ba-1.1.tar.gz 29629 RMD160 fcc694a7a12ca500c90d94761f98f2bdce5a9747 SHA1 763325e7801037d2c1a67aba889ea97b389f7d28 SHA256 a66bf05bc3fd030f19fd0114623d263870d864793b1b0a2ccf6ab6a40e7be09b
+EBUILD ltl2ba-1.1.ebuild 612 RMD160 deef0c5ab683242c0d13561b6d70d438408715d4 SHA1 0b7162239dca05b773be86b3dde2718290bf1c8a SHA256 e7c424cc00b8391011f8816b5d3e7c96265fbf734eafc75b345336ad2cf9523b
diff --git a/sci-mathematics/ltl2ba/ltl2ba-1.1.ebuild b/sci-mathematics/ltl2ba/ltl2ba-1.1.ebuild
new file mode 100644
index 000000000..94f03a487
--- /dev/null
+++ b/sci-mathematics/ltl2ba/ltl2ba-1.1.ebuild
@@ -0,0 +1,29 @@
+# Copyright 1999-2009 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: Exp $
+
+DESCRIPTION="Fast LTL to Büchi Automata Translation"
+HOMEPAGE="http://www.lsv.ens-cachan.fr/~gastin/${PN}/"
+SRC_URI="http://www.lsv.ens-cachan.fr/~gastin/${PN}/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~ppc ~sparc ~x86"
+IUSE=""
+
+RDEPEND=""
+DEPEND=""
+
+src_compile() {
+ sed -i Makefile \
+ -e "s/CC=gcc/#CC=gcc/g" \
+ -e "s/CFLAGS= -O3 -ansi -DNXT/CFLAGS+= -ansi -DNXT/g"
+
+ emake || die "emake failed"
+}
+
+src_install() {
+ dobin ltl2ba || die "dobin failed"
+ dodoc README
+}
+
diff --git a/sci-mathematics/pff/Manifest b/sci-mathematics/pff/Manifest
new file mode 100644
index 000000000..53273afb9
--- /dev/null
+++ b/sci-mathematics/pff/Manifest
@@ -0,0 +1,2 @@
+DIST Float1.2-8.2.tgz 322949 RMD160 5ef8a68e4c10d8cffe4cd8d3eb5d5d2c1394fb60 SHA1 ab9b01cf953e32c100ed21e9980adf68553aaed1 SHA256 df61debf5afb2cbf44be6a605622b1645ba07be1912bb154ef79009d7eb235b2
+EBUILD pff-8.2.1.2.ebuild 775 RMD160 0097b3a270cbe10f215f7d26dc1e010eb965f894 SHA1 e03367f4e28c6269f28aa26e295b52a51fb498d6 SHA256 b68e4b83555634e52eee1a0d40c4aa60ffc80729fe8e1b476e1d6bc24d1faae8
diff --git a/sci-mathematics/pff/pff-8.2.1.2.ebuild b/sci-mathematics/pff/pff-8.2.1.2.ebuild
new file mode 100644
index 000000000..33672f0f5
--- /dev/null
+++ b/sci-mathematics/pff/pff-8.2.1.2.ebuild
@@ -0,0 +1,36 @@
+# Copyright 1999-2009 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: Exp $
+
+DESCRIPTION="Library for reasoning about floating point numbers in coq."
+HOMEPAGE="http://lipforge.ens-lyon.fr/www/pff/"
+SRC_URI="http://lipforge.ens-lyon.fr/frs/download.php/147/Float${PV/#????/}-${PV/%????/}.tgz"
+
+LICENSE="LGPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~ppc ~sparc ~x86"
+
+IUSE=""
+
+RDEPEND="sci-mathematics/coq"
+
+DEPEND="${RDEPEND}"
+
+S="${WORKDIR}/Float"
+
+src_unpack() {
+ unpack ${A}
+ cd "${S}"
+
+ sed -i -e "s|\`\$(COQC) -where\`/user-contrib| \
+ \$(DESTDIR)/\`\$(COQC) -where\`/user-contrib|g" Makefile
+}
+
+src_compile(){
+ emake DESTDIR="/" || die "emake failed"
+}
+
+src_install(){
+ emake install DESTDIR="${D}" || die "emake install failed"
+}
+
diff --git a/sci-mathematics/pvs/Manifest b/sci-mathematics/pvs/Manifest
new file mode 100644
index 000000000..c699efe75
--- /dev/null
+++ b/sci-mathematics/pvs/Manifest
@@ -0,0 +1,6 @@
+AUX pvs-4.2-patch-bddp 30976 RMD160 775e3abb61e9dbf3eab6c350667f2794951effac SHA1 e7365a472f650537eac450cdf97d09cd6977707b SHA256 362a9607b53db739da0893aea7041591eb9f66ca0632d274396ea67b3d69006c
+AUX pvs-4.2-patch-make 2255 RMD160 12330628838ad7114c4861c0ba6de31bee0ae2d2 SHA1 479ca8b2ba0ce0210af569db8dc8d395ffabc181 SHA256 18f623bd039816edc2e09c17017e5d340e13c891001c275f44d71db223c0d237
+AUX pvs-4.2-patch-sbcl 224495 RMD160 8a4f8efb35c165aedeba2c9718e3c88d7a40935e SHA1 8ad658caca0f4a83dd094ba7324259a9d84db7f2 SHA256 c810463328e759c654a0d7693a22203c35f169748504b25ae4476d2f6ff62151
+DIST pvs-4.2-source.tgz 7951811 RMD160 90551627a059d633024d7a78dc6a72799f186e06 SHA1 5b53780cf449f8957613c6fc225ffecb2b454e25 SHA256 ac29bb19400fff2d794c1c8f7ef5747e8d83c66ddbe4249c8423ed7dca305309
+EBUILD pvs-4.2-r1.ebuild 2282 RMD160 e7e0b430d49d7411f77e59ccd143ca0f79aa2163 SHA1 c5ec6c342c103b919344455ff284af91aa1b7de0 SHA256 c53d6066455a597a99d000cb559994685ef2757639be289ec10f05d9d0719468
+EBUILD pvs-4.2.ebuild 1058 RMD160 aeedf7473a6dde7093a3c4615e7f036850ba1f19 SHA1 161ff414c8bad9e8e17351241bdba932f511e793 SHA256 a9a5c113dfd95f0d1b9246e9e66fb12fd218f9e7a90840c18e11e063dbd56438
diff --git a/sci-mathematics/pvs/files/pvs-4.2-patch-bddp b/sci-mathematics/pvs/files/pvs-4.2-patch-bddp
new file mode 100644
index 000000000..1bc4681af
--- /dev/null
+++ b/sci-mathematics/pvs/files/pvs-4.2-patch-bddp
@@ -0,0 +1,860 @@
+diff -Naur pvs4.2-orig/BDD/bdd/ex/test.pl pvs4.2-bddp/BDD/bdd/ex/test.pl
+--- pvs4.2-orig/BDD/bdd/ex/test.pl 2007-07-02 20:07:41.000000000 +0000
++++ pvs4.2-bddp/BDD/bdd/ex/test.pl 2009-03-24 18:49:23.000000000 +0000
+@@ -8,11 +8,11 @@
+
+ (y implies x) and (y equiv a or not a) -> (x equiv y) .
+
+-not E :- ((A and W) implies P), /* Superman */
+- (not A implies I),
++not F :- ((B and W) implies P), /* Superman */
++ (not B implies I),
+ (not W implies M),
+ (not P),
+- (E implies not I and not M) .
++ (F implies not I and not M) .
+
+ /* Portrait in the casket */
+ G :-
+diff -Naur pvs4.2-orig/BDD/bdd/src/appl.c pvs4.2-bddp/BDD/bdd/src/appl.c
+--- pvs4.2-orig/BDD/bdd/src/appl.c 2007-07-02 20:07:41.000000000 +0000
++++ pvs4.2-bddp/BDD/bdd/src/appl.c 2009-03-24 18:49:23.000000000 +0000
+@@ -105,7 +105,7 @@
+ int flag;
+
+ /* LET introduced names come first! */
+- if (lookup (aux_table, s, len, &info.voidptr, LOOKUP) != NOT_PRESENT) {
++ if (lookup (aux_table, s, len, &info.voidptr, LOOKUP_PTR) != NOT_PRESENT) {
+ /* This name is indeed used for a secondary variable. */
+ if (!BDD_VOID_P (info.bddptr)) {
+ BDD_GC_PROTECT (info.bddptr);
+@@ -118,7 +118,7 @@
+ }
+
+ /* Here define as primary variable: */
+- flag = (int) INSERT;
++ flag = INSERT;
+ index = lookup (var_table, s, len, NULL, &flag);
+ if (flag == INDEED_INSERTED) {
+ var_count++;
+@@ -132,12 +132,12 @@
+ int index;
+ int flag;
+
+- if (lookup (aux_table, s, len, NULL, LOOKUP) != NOT_PRESENT)
++ if (lookup (aux_table, s, len, NULL, LOOKUP_PTR) != NOT_PRESENT)
+ if (warnings)
+ fprintf (stderr,
+ "Warning: secondary variable %s already exists.\n", s);
+
+- flag = (int) INSERT;
++ flag = INSERT;
+ index = lookup (var_table, s, len, NULL, &flag);
+ if (flag == INDEED_INSERTED) {
+ var_count++;
+@@ -148,12 +148,12 @@
+
+ int make_sub_var (char *s, int len)
+ {
+- if (lookup (var_table, s, len, NULL, LOOKUP) != NOT_PRESENT)
++ if (lookup (var_table, s, len, NULL, LOOKUP_PTR) != NOT_PRESENT)
+ if (warnings)
+ fprintf (stderr,
+ "Warning: primary variable %s already exists.\n", s);
+
+- return lookup (aux_table, s, len, NULL, INSERT);
++ return lookup (aux_table, s, len, NULL, INSERT_PTR);
+ }
+
+ BDDPTR make_definition (int id_index, BDDPTR function)
+diff -Naur pvs4.2-orig/BDD/bdd/src/bdd.c pvs4.2-bddp/BDD/bdd/src/bdd.c
+--- pvs4.2-orig/BDD/bdd/src/bdd.c 2007-09-05 00:04:00.000000000 +0000
++++ pvs4.2-bddp/BDD/bdd/src/bdd.c 2009-03-24 18:49:23.000000000 +0000
+@@ -214,13 +214,13 @@
+ falls apart. This is tested in bdd_alloc().
+ */
+ #define BDD_F_MASK 0x80000000
+-#define BDD_F_SET(F) ((BDDPTR) (((int) (F)) | BDD_F_MASK))
++#define BDD_F_SET(F) ((BDDPTR) (BITS (F) | BDD_F_MASK))
+ #define BDD_F_SET_SAVE(F) \
+ (bdd_ok_to_use_MSB ? BDD_F_SET(F) \
+ : (fputs( \
+ "[bdd]: Not allowed to use MSB of BDD pointer.\n", stderr), \
+ exit(1), BDD_VOID))
+-#define BDD_FUNC_P(F) (bdd_ok_to_use_MSB && (((int) (F)) & BDD_F_MASK))
++#define BDD_FUNC_P(F) (bdd_ok_to_use_MSB && (BITS (F) & BDD_F_MASK))
+
+ /* ------------------------------------------------------------------------ */
+ /* LOCAL TYPE DEFINITIONS */
+@@ -592,8 +592,8 @@
+
+ if ((reason = bdd_valid_p (f)) != 0) {
+ fprintf (stderr,
+- "[bdd_check_valid]: 0x%x, %s%s%s.\n",
+- (Nat) f, mess[reason],
++ "[bdd_check_valid]: %p, %s%s%s.\n",
++ f, mess[reason],
+ text ? ", " : "", text);
+ exit (1);
+ }
+@@ -967,7 +967,7 @@
+ static Nat ceil_log2(Nat n)
+ {
+ Nat mask = 0x0000FFFF;
+- Bool not2pow = 0;
++ Nat not2pow = 0;
+ Nat r = 0;
+ Nat d = 16;
+
+@@ -991,19 +991,20 @@
+ /* Using muliplicative method in hashing. Constant A according Knuth:
+ A = (PHI - 1) * 2^32, with PHI = golden ratio = (1 + sqrt(5))/2
+ PHI-1 = 0.61803 39887 49894 84820 ...
+- A = 26544357690 = -1640531527 = 0x9E3779B9U
++ A = 2654435769 = -1640531527 = 0x9E3779B9U
++ The nearest prime number is 2654435761 = 0x9E3779B1U
+ */
+
+ /* Hashes Nat `k' to a value in the range [0..2^log2size-1]. */
+-#define BDD_HASH(k,log2size) div_pow2(0x9E3779B9U*(k), NAT_BIT-(log2size))
++#define BDD_HASH(k,log2size) div_pow2(0x9E3779B1U*(k), NAT_BIT-(log2size))
+
+ #define hash_U(T, E, log2size) \
+- BDD_HASH((((Nat) (T) >> 2) ^ ((Nat) (E) << 3)), (log2size))
++ BDD_HASH((Nat)((BITS (T) >> 2) ^ (BITS (E) << 3)), (log2size))
+
+ /* ((((v) ^ ((int) T << 7) ^ ((int) (E) << 9)) & INT_MAX) % size)*/
+
+ #define hash_C(F, G, H, log2size) \
+- BDD_HASH((((Nat) F) ^ ((Nat) (G) << 7) ^ ((Nat) (H) << 9)), (log2size))
++ BDD_HASH((Nat)(BITS (F) ^ (BITS (G) << 7) ^ (BITS (H) << 9)), (log2size))
+
+ static
+ BDDPTR bdd_lookup_computed_table_no_reclaim (BDDPTR F, BDDPTR G, BDDPTR H)
+@@ -3100,11 +3101,11 @@
+ fprintf (global_fp, "%3d, [%3d], ", BDD_VARID (v), BDD_RANK (v));
+ fprintf (global_fp, "(M:%s), ", BDD_MARK (v) ? "1" : "0");
+
+- fprintf (global_fp, "&v: 0x%08x, Refs: %3d, Then: 0x%08x, Else: 0x%08x\n",
+- (Nat) v,
++ fprintf (global_fp, "&v: %p, Refs: %3d, Then: %p, Else: %p\n",
++ v,
+ BDD_REFCOUNT (v),
+- (Nat) BDD_THEN (v),
+- (Nat) BDD_ELSE (v));
++ BDD_THEN (v),
++ BDD_ELSE (v));
+ }
+
+ void bdd_print_node (FILE *fp, BDDPTR v)
+diff -Naur pvs4.2-orig/BDD/bdd/src/bdd_fns.c pvs4.2-bddp/BDD/bdd/src/bdd_fns.c
+--- pvs4.2-orig/BDD/bdd/src/bdd_fns.c 2007-07-02 20:07:41.000000000 +0000
++++ pvs4.2-bddp/BDD/bdd/src/bdd_fns.c 2009-03-24 18:49:23.000000000 +0000
+@@ -833,7 +833,7 @@
+
+ static int rank_less_or_equal (void *a, void *b)
+ {
+- return BDD_VAR_RANK ((int) a) - BDD_VAR_RANK ((int) b);
++ return BDD_VAR_RANK ((int) (long) a) - BDD_VAR_RANK ((int) (long) b);
+ }
+
+ /* Destructively reorders `vars' to obtain all variable elements in
+@@ -848,8 +848,9 @@
+
+ static void collect_cube_vars_action (int index, int neg, int first)
+ {
+- list_of_cube_varids = bdd_list_append_cont ((void *) (neg ? -index : index),
+- list_of_cube_varids);
++ list_of_cube_varids =
++ bdd_list_append_cont ((void *) (long) (neg ? -index : index),
++ list_of_cube_varids);
+ }
+
+ BDD_LIST bdd_cube_as_list_of_vars (BDDPTR cube)
+@@ -2544,7 +2545,7 @@
+ static int occupancy = 0;
+
+ #define hash_sop(a) \
+- ((((int) a) & INT_MAX) % SOP_CACHE_SIZE)
++ ((BITS (a) & INT_MAX) % SOP_CACHE_SIZE)
+
+ /* Looks up BDD f in sop_cache and when a sum-of-cubes list is present
+ for it returns a full copy of the list (list elements are BDD cubes
+diff -Naur pvs4.2-orig/BDD/bdd/src/bdd.h pvs4.2-bddp/BDD/bdd/src/bdd.h
+--- pvs4.2-orig/BDD/bdd/src/bdd.h 2007-07-02 20:07:41.000000000 +0000
++++ pvs4.2-bddp/BDD/bdd/src/bdd.h 2009-03-24 18:49:23.000000000 +0000
+@@ -31,7 +31,7 @@
+ /* IMPORTANT NOTICE!!!
+
+ This package freely uses the two least significant bits of a pointer
+- value, which by the way is also assumed to be a 32-bit quantity.
++ value, which is assumed to be a 32-bit or 64-bit quantity.
+ It therefore is assumed that BDD structs are all aligned on a word
+ boundary (for addresses both bits are always 0). Since the package
+ does it own BDD nodes allocation in blocks, this is always assured.
+@@ -76,12 +76,15 @@
+ #define BDD_MAXRANK BDD_MAXVARID
+
+ /* Attributed edges masks: output and input inverters: */
+-#define BDD_O_INV_MASK 0x1
+-#define BDD_I_INV_MASK 0x2
++#define BDD_O_INV_MASK 0x1L
++#define BDD_I_INV_MASK 0x2L
+ #define BDD_INV_MASK (BDD_O_INV_MASK | BDD_I_INV_MASK)
+
++/* Look at edge as a set of bits: */
++#define BITS(F) ((long) F)
++
+ /* Look at edge as a real pointer: */
+-#define PTR(F) ((BDDPTR) (((int) (F)) & ~BDD_INV_MASK))
++#define PTR(F) ((BDDPTR) (BITS (F) & ~BDD_INV_MASK))
+
+ /* Access to various fields of BDD node: */
+ /* Not guarded against BDD_VOID arg! */
+@@ -158,23 +161,23 @@
+ #define BDD_DEAD_P(F) (BDD_REFCOUNT (F) == 0)
+
+ /* Test whether edge v is postive or negative: */
+-#define BDD_NEG_P(F) (!!(((int) (F)) & BDD_O_INV_MASK))
+-#define BDD_POS_P(F) !BDD_NEG_P (F)
++#define BDD_POS_P(F) (!(BITS (F) & BDD_O_INV_MASK))
++#define BDD_NEG_P(F) !BDD_POS_P (F)
+
+ #define BDD_O_INV_EDGE_P(F) BDD_NEG_P (F)
+
+ /* Test whether edge v refers to inverted input node: */
+-#define BDD_I_INV_EDGE_P(F) (!!(((int) (F)) & BDD_I_INV_MASK))
++#define BDD_I_INV_EDGE_P(F) (!!(BITS (F) & BDD_I_INV_MASK))
+
+ /* Setting and clearing of edge attribute bits: */
+-#define BDD_O_OFF(F) ((BDDPTR) (((int) (F)) & ~BDD_O_INV_MASK))
+-#define BDD_O_SET_U(F) ((BDDPTR) (((int) (F)) | BDD_O_INV_MASK))
++#define BDD_O_OFF(F) ((BDDPTR) (BITS (F) & ~BDD_O_INV_MASK))
++#define BDD_O_SET_U(F) ((BDDPTR) (BITS (F) | BDD_O_INV_MASK))
+ /* Special case for BDD_X and user terminals. Never have O_INV bit set! */
+ #define BDD_O_SET(F) ((BDD_TERM_P (F) && !BDD_BOOL_P (F)) ? (F) \
+ : BDD_O_SET_U (F))
+
+-#define BDD_I_OFF(F) ((BDDPTR) (((int) (F)) & ~BDD_I_INV_MASK))
+-#define BDD_I_SET_U(F) ((BDDPTR) (((int) (F)) | BDD_I_INV_MASK))
++#define BDD_I_OFF(F) ((BDDPTR) (BITS (F) & ~BDD_I_INV_MASK))
++#define BDD_I_SET_U(F) ((BDDPTR) (BITS (F) | BDD_I_INV_MASK))
+ /* Special case for terminals. Never have I_INV bit set! */
+ #define BDD_I_SET(F) (BDD_TERM_P (F) ? (F) : BDD_I_SET_U (F))
+
+@@ -244,7 +247,7 @@
+ /* Are functions each other's complement:
+ (Only correct when bdd_use_neg_edges == 1)
+ */
+-#define BDD_COMPL_P(F1, F2) ((((int) F1) ^ ((int) F2)) == BDD_O_INV_MASK)
++#define BDD_COMPL_P(F1, F2) ((BITS (F1) ^ BITS (F2)) == BDD_O_INV_MASK)
+
+ /* The rank value of variable id; lowest rank is 0. */
+ #define BDD_VAR_RANK(v) (((v) == BDD_TERMID) \
+@@ -335,6 +338,9 @@
+ unsigned int inedge_cnt : NR_INEDGE_COUNT_BITS;
+ unsigned int pos_size : NR_SIZE_BITS;
+ unsigned int neg_size : NR_SIZE_BITS;
++#if BITS64 == 1
++ unsigned int padding;
++#endif
+ } factor1_aux;
+
+ typedef struct {
+@@ -342,6 +348,9 @@
+ unsigned int root_flag : 1;
+ unsigned int subexpr_flag : 1;
+ unsigned int subexpr_index : NR_INDEX_BITS;
++#if BITS64 == 1
++ unsigned int padding;
++#endif
+ } factor2_aux;
+
+ /* ------------------------------------------------------------------------ */
+@@ -363,6 +372,9 @@
+ unsigned int length0 : 31;
+ unsigned int follow_then1 : 1;
+ unsigned int length1 : 31;
++#if BITS64 == 1
++ unsigned long padding;
++#endif
+ } path_rec;
+
+ /* ------------------------------------------------------------------------ */
+@@ -418,6 +430,9 @@
+ unsigned flag :1; /* Left/Right flag used in BDD traversal */
+ unsigned mark :1; /* mark bit used in BDD traversal */
+ unsigned refcount:BDD_NR_RC_BITS; /* saturating reference count */
++#if BITS64 == 1
++ unsigned padding;
++#endif
+ BDDPTR then_link; /* child for variable = 1 */
+ BDDPTR else_link; /* child for variable = 0 */
+ BDDPTR next; /* chaining in unique table */
+diff -Naur pvs4.2-orig/BDD/bdd/src/bdd_list.h pvs4.2-bddp/BDD/bdd/src/bdd_list.h
+--- pvs4.2-orig/BDD/bdd/src/bdd_list.h 2007-07-02 20:07:41.000000000 +0000
++++ pvs4.2-bddp/BDD/bdd/src/bdd_list.h 2009-03-24 18:49:23.000000000 +0000
+@@ -27,8 +27,8 @@
+ #define BDD_LIST_END_FOR_EACH_ELEM END_FOR_EACH_LIST_ELEM
+ #define BDD_ELEM_CALLOC CALLOC_LIST_ELEM
+ #define BDD_ELEM_CONTENTS(e) ((BDDPTR) ELEM_CONTENTS(e))
+-#define BDD_ELEM_CONTENTS_I(e) ((int) ELEM_CONTENTS(e))
+-#define BDD_ELEM_SET_CONTENTS(e,v) (ELEM_CONTENTS(e) = (void *) (v))
++#define BDD_ELEM_CONTENTS_I(e) ((int) (long) ELEM_CONTENTS(e))
++#define BDD_ELEM_SET_CONTENTS(e,v) (ELEM_CONTENTS(e) = (void *) (long)(v))
+ #define BDD_LIST_FIRST LIST_FIRST
+ #define BDD_LIST_NEXT LIST_NEXT
+ #define BDD_LIST_LAST LIST_LAST
+diff -Naur pvs4.2-orig/BDD/bdd/src/bdd_quant.c pvs4.2-bddp/BDD/bdd/src/bdd_quant.c
+--- pvs4.2-orig/BDD/bdd/src/bdd_quant.c 2007-07-02 20:07:41.000000000 +0000
++++ pvs4.2-bddp/BDD/bdd/src/bdd_quant.c 2009-03-24 18:49:23.000000000 +0000
+@@ -777,14 +777,15 @@
+ /* Using muliplicative method in hashing. Constant A according Knuth:
+ A = (PHI - 1) * 2^32, with PHI = golden ratio = (1 + sqrt(5))/2
+ PHI-1 = 0.61803 39887 49894 84820 ...
+- A = 26544357690 = -1640531527 = 0x9E3779B9U
++ A = 2654435769 = -1640531527 = 0x9E3779B9U
++ The nearest prime number is 2654435761 = 0x9E3779B1U
+ */
+
+ /* Hashes Nat `k' to a value in the range [0..2^log2size-1]. */
+-#define BDD_HASH(k,log2size) div_pow2(0x9E3779B9U*(k), NAT_BIT-(log2size))
++#define BDD_HASH(k,log2size) div_pow2(0x9E3779B1U*(k), NAT_BIT-(log2size))
+
+ #define hash_and_smooth(a, b) \
+- BDD_HASH((((Nat) (a)) ^ ((Nat) (b) << 15)), BDD_AND_SMOOTH_CACHE_LOG2SIZE)
++ BDD_HASH((Nat)((BITS (a)) ^ (BITS (b) << 15)), BDD_AND_SMOOTH_CACHE_LOG2SIZE)
+
+ static BDDPTR bdd_lookup_and_smooth_cache (BDDPTR f, BDDPTR g)
+ {
+diff -Naur pvs4.2-orig/BDD/bdd/src/bdd_vfns.c pvs4.2-bddp/BDD/bdd/src/bdd_vfns.c
+--- pvs4.2-orig/BDD/bdd/src/bdd_vfns.c 2007-07-02 20:07:41.000000000 +0000
++++ pvs4.2-bddp/BDD/bdd/src/bdd_vfns.c 2009-03-24 18:49:23.000000000 +0000
+@@ -40,7 +40,7 @@
+ BDDPTR *F;
+
+ F = CALLOC_ARRAY (size+1, BDDPTR);
+- F[0] = (BDDPTR) size;
++ F[0] = (BDDPTR) (long) size;
+ return F+1;
+ }
+ return NULL;
+diff -Naur pvs4.2-orig/BDD/bdd/src/bdd_vfns.h pvs4.2-bddp/BDD/bdd/src/bdd_vfns.h
+--- pvs4.2-orig/BDD/bdd/src/bdd_vfns.h 2007-07-02 20:07:41.000000000 +0000
++++ pvs4.2-bddp/BDD/bdd/src/bdd_vfns.h 2009-03-24 18:49:23.000000000 +0000
+@@ -10,7 +10,7 @@
+ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+ */
+
+-#define BDDVEC_SIZE(F) ((F) ? ((int *) F)[-1] : 0)
++#define BDDVEC_SIZE(F) ((F) ? (int) BITS (F[-1]) : 0)
+
+ extern BDDPTR *MakeBDDVec (int size);
+ extern void FreeBDDVec (BDDPTR *F);
+diff -Naur pvs4.2-orig/BDD/bdd/src/ChangeLog pvs4.2-bddp/BDD/bdd/src/ChangeLog
+--- pvs4.2-orig/BDD/bdd/src/ChangeLog 2007-07-02 20:07:41.000000000 +0000
++++ pvs4.2-bddp/BDD/bdd/src/ChangeLog 2009-03-24 18:49:23.000000000 +0000
+@@ -1,3 +1,17 @@
++2008-08-06 Jerry James <loganjerry@gmail.com>
++
++ * Makefile
++ * appl.c
++ * bdd.c:
++ * bdd.h:
++ * bdd_fns.c:
++ * bdd_list.h:
++ * bdd_quant.c:
++ * bdd_vfns.c:
++ * bdd_vfns.h
++ * template.c:
++ * yacc.y: Support compilation on 64-bit machines.
++
+ Thu Apr 16 10:25:56 1998 Geert Janssen <geert@cobra.ics.ele.tue.nl>
+
+ * bdd_quant.c (bdd_lookup_and_smooth_cache): also using
+diff -Naur pvs4.2-orig/BDD/bdd/src/main.c pvs4.2-bddp/BDD/bdd/src/main.c
+--- pvs4.2-orig/BDD/bdd/src/main.c 2007-07-02 20:07:41.000000000 +0000
++++ pvs4.2-bddp/BDD/bdd/src/main.c 2009-03-24 18:49:23.000000000 +0000
+@@ -309,7 +309,7 @@
+
+ var_table = make_hashtab (3);
+ /* Let's not use entry nr. 0 for fun: */
+-/* lookup (var_table, "", 0, NULL, INSERT);*/
++/* lookup (var_table, "", 0, NULL, INSERT_PTR);*/
+
+ aux_table = make_hashtab (0);
+
+diff -Naur pvs4.2-orig/BDD/bdd/src/Makefile pvs4.2-bddp/BDD/bdd/src/Makefile
+--- pvs4.2-orig/BDD/bdd/src/Makefile 2007-07-02 20:07:41.000000000 +0000
++++ pvs4.2-bddp/BDD/bdd/src/Makefile 2009-03-24 18:49:23.000000000 +0000
+@@ -11,9 +11,9 @@
+ # specify appropriate C compiler flags here:
+ #CFLAGS= -Aa -D_POSIX_SOURCE $(INCLUDES)
+ #CFLAGS= -D_POSIX_SOURCE $(INCLUDES)
+-CFLAGS= -g -O $(INCLUDES)
+-XCFLAGS= -O
+-XLDFLAGS=-s
++CFLAGS= -march=core2 -g -Wall -O2 -D_FORTIFY_SOURCE=2 -pipe $(INCLUDES)
++XCFLAGS=
++XLDFLAGS=
+
+ obj= bdd_factor.o bdd.o bdd_quant.o bdd_fns.o bdd_vfns.o appl.o y.tab.o \
+ lex.yy.o main.o
+@@ -26,23 +26,24 @@
+
+ .c.o : ; $(CC) ${XCFLAGS} ${CFLAGS} -c $*.c
+
+-bdd_factor.o : bdd_factor.c bdd_factor.h
+-bdd.o : bdd.c bdd.h bdd_extern.h
+-bdd_fns.o : bdd_fns.c bdd_fns.h bdd.h bdd_extern.h
+-bdd_quant.o : bdd_quant.c bdd_fns.h bdd.h bdd_extern.h
+-bdd_vfns.o : bdd_vfns.c bdd_vfns.h bdd_fns.h bdd.h bdd_extern.h
+-appl.o : appl.c appl.h bdd_fns.h bdd.h bdd_extern.h
+-main.o : main.c appl.h bdd_fns.h bdd.h bdd_extern.h
+-y.tab.c : yacc.y bdd_fns.h bdd.h bdd_extern.h
++bdd_factor.o : bdd_factor.c bdd_factor.h bdd.h bdd_extern.h bdd_list.h
++bdd.o : bdd.c bdd.h bdd_extern.h bdd_list.h
++bdd_fns.o : bdd_fns.c bdd_fns.h bdd.h bdd_extern.h bdd_list.h bdd_quant.h
++bdd_quant.o : bdd_quant.c bdd_fns.h bdd.h bdd_extern.h bdd_list.h bdd_quant.h
++bdd_vfns.o : bdd_vfns.c bdd_vfns.h bdd_fns.h bdd.h bdd_extern.h bdd_list.h \
++ bdd_quant.h
++appl.o : appl.c appl.h bdd_fns.h bdd.h bdd_extern.h bdd_list.h bdd_quant.h
++main.o : main.c appl.h bdd.h bdd_extern.h bdd_factor.h bdd_fns.h bdd_list.h \
++ bdd_quant.h bdd_vfns.h
++y.tab.h : y.tab.c
++y.tab.c : yacc.y
+ # Don't worry about the 1 shift/reduce conflicts!
+ yacc -d yacc.y
+-y.tab.h : yacc.y
+- yacc -d yacc.y
+- # Don't worry about the 1 shift/reduce conflicts!
+-y.tab.o : y.tab.c bdd_fns.h bdd.h bdd_extern.h
++y.tab.o : y.tab.c y.tab.h appl.h bdd.h bdd_extern.h bdd_fns.h bdd_list.h \
++ bdd_quant.h bdd_vfns.h
+ lex.yy.c : lex.l
+- lex lex.l
+-lex.yy.o : lex.yy.c y.tab.h bdd.h bdd_extern.h
++ lex -l lex.l
++lex.yy.o : lex.yy.c y.tab.h bdd.h bdd_extern.h bdd_list.h
+ $(CC) -c ${CFLAGS} -w lex.yy.c
+
+ clean :
+diff -Naur pvs4.2-orig/BDD/bdd/src/template.c pvs4.2-bddp/BDD/bdd/src/template.c
+--- pvs4.2-orig/BDD/bdd/src/template.c 2007-07-02 20:07:41.000000000 +0000
++++ pvs4.2-bddp/BDD/bdd/src/template.c 2009-03-24 18:49:23.000000000 +0000
+@@ -51,7 +51,7 @@
+ int main (int argc, char *argv[])
+ {
+ /* Declare some variables that will hold Boolean functions. */
+- BDDPTR f, g;
++ BDDPTR f;
+ BDDPTR a, b, c, d;
+ BDDPTR tmp1, tmp2, tmp3;
+
+@@ -227,4 +227,5 @@
+ fprintf (stdout, "Quitting the BDD Package.\n");
+ bdd_quit ();
+ bdd_print_stats (stdout);
++ return EXIT_SUCCESS;
+ }
+diff -Naur pvs4.2-orig/BDD/bdd/src/yacc.y pvs4.2-bddp/BDD/bdd/src/yacc.y
+--- pvs4.2-orig/BDD/bdd/src/yacc.y 2007-07-02 20:07:41.000000000 +0000
++++ pvs4.2-bddp/BDD/bdd/src/yacc.y 2009-03-24 18:49:23.000000000 +0000
+@@ -99,6 +99,7 @@
+ extern void action (BDDPTR *F);
+ extern void parse_complete (void);
+
++int yylex (void);
+ void yyerror (char *format, ...);
+ void yywarning (char *format, ...);
+
+diff -Naur pvs4.2-orig/BDD/bdd/utils/alloc.c pvs4.2-bddp/BDD/bdd/utils/alloc.c
+--- pvs4.2-orig/BDD/bdd/utils/alloc.c 2007-07-02 20:07:41.000000000 +0000
++++ pvs4.2-bddp/BDD/bdd/utils/alloc.c 2009-03-24 18:49:23.000000000 +0000
+@@ -101,10 +101,7 @@
+ {
+ long nr_bytes = nr_elems * bytes_per_elem;
+ void *p = MA_Malloc (nr_bytes, r, fn, ln);
+- char *q = (char *) p;
+-
+- while (nr_bytes-- > 0) *q++ = '\0';
+- return p;
++ return memset(p, 0, nr_bytes);
+ }
+
+ #if COMMENT
+diff -Naur pvs4.2-orig/BDD/bdd/utils/alloc.h pvs4.2-bddp/BDD/bdd/utils/alloc.h
+--- pvs4.2-orig/BDD/bdd/utils/alloc.h 2007-07-02 20:07:41.000000000 +0000
++++ pvs4.2-bddp/BDD/bdd/utils/alloc.h 2009-03-24 18:49:23.000000000 +0000
+@@ -29,7 +29,7 @@
+ const char* fn, long ln);
+
+ #ifdef HAVE_ALLOCA
+-extern void *alloca ();
++#include <alloca.h>
+ #endif
+
+ /* Allocates n consecutive bytes, returns pointer of type. */
+diff -Naur pvs4.2-orig/BDD/bdd/utils/general.h pvs4.2-bddp/BDD/bdd/utils/general.h
+--- pvs4.2-orig/BDD/bdd/utils/general.h 2007-07-02 20:07:41.000000000 +0000
++++ pvs4.2-bddp/BDD/bdd/utils/general.h 2009-03-24 18:49:23.000000000 +0000
+@@ -30,6 +30,13 @@
+ /* Number of bits in a Nat: */
+ #define NAT_BIT 32
+
++/* Whether we are compiling for a 64-bit machine */
++#if LONG_MAX == 9223372036854775807L
++#define BITS64 1
++#else
++#define BITS64 0
++#endif
++
+ /* What's the max unsigned integer value that fits in `n' bits: */
+ #define UBITS_MAX(n) (~(-1 << (n)))
+
+@@ -77,15 +84,9 @@
+ /* TYPE DEFINITIONS */
+ /* ------------------------------------------------------------------------ */
+
+-/* Xlib.h seems to define this! */
+-#ifdef Bool
+-#undef Bool
+-#endif
+-
+ typedef signed char TinyInt;
+ typedef short int SmallInt;
+ typedef int Int;
+-typedef unsigned char Bool;
+ typedef unsigned char Byte;
+ typedef unsigned char TinyNat;
+ typedef unsigned short int SmallNat;
+diff -Naur pvs4.2-orig/BDD/bdd/utils/hash.c pvs4.2-bddp/BDD/bdd/utils/hash.c
+--- pvs4.2-orig/BDD/bdd/utils/hash.c 2007-07-02 20:07:41.000000000 +0000
++++ pvs4.2-bddp/BDD/bdd/utils/hash.c 2009-03-24 18:49:23.000000000 +0000
+@@ -290,7 +290,7 @@
+ for (i = 0; i < /*old*/ old_size; i++, entryp++)
+ if (*entryp) {
+ /* Entry i is occupied; insert it in new table: */
+- insert_var = (int) INSERT;
++ insert_var = INSERT;
+ /* lookup_1 returns index of this entry in tab: */
+ newi = lookup_1 (tab, *entryp, &insert_var);
+ /* Call user supplied function to account for change: */
+@@ -440,9 +440,12 @@
+ entry.keylen = len;
+ entry.info = info ? *info : NULL;
+
+- if (do_insert == LOOKUP || do_insert == INSERT)
++ if (do_insert == LOOKUP_PTR)
+ /* No reporting back possible. */
+- insert_var = (int) do_insert;
++ insert_var = LOOKUP;
++ else if (do_insert == INSERT_PTR)
++ /* No reporting back possible. */
++ insert_var = INSERT;
+ else {
+ /* Assume do_insert holds address of int variable. */
+ insert_var = *do_insert;
+@@ -522,7 +525,7 @@
+ do {
+ sprintf (startp, "%d", gen_counter++);
+ len = strlen (buf);
+- inserted = (int) INSERT;
++ inserted = INSERT;
+ i = lookup (tab, buf, len, NULL, &inserted);
+ } while (inserted == ALREADY_PRESENT);
+
+@@ -591,9 +594,9 @@
+ while (gets (s)) {
+ lc++;
+ if (lc & 1)
+- lookup (hashtab , s, strlen (s), NULL, INSERT);
++ lookup (hashtab , s, strlen (s), NULL, INSERT_PTR);
+ else
+- lookup (hashtab2, s, strlen (s), NULL, INSERT);
++ lookup (hashtab2, s, strlen (s), NULL, INSERT_PTR);
+ }
+ print_hashtab (hashtab);
+ print_hashtab (hashtab2);
+diff -Naur pvs4.2-orig/BDD/bdd/utils/hash.h pvs4.2-bddp/BDD/bdd/utils/hash.h
+--- pvs4.2-orig/BDD/bdd/utils/hash.h 2007-07-02 20:07:41.000000000 +0000
++++ pvs4.2-bddp/BDD/bdd/utils/hash.h 2009-03-24 18:49:23.000000000 +0000
+@@ -40,7 +40,7 @@
+ */
+ #define ALLOW_REHASH
+
+-/* Define this to allow for automatically use of a shadow table of indices.
++/* Define this to allow for automatic use of a shadow table of indices.
+ This shadow table indirects lookups by always going through it to the
+ real hash table.
+ This is subordinate to ALLOW_REHASH, i.e. to be effective ALLOW_REHASH
+@@ -98,8 +98,10 @@
+ #define HASHTAB_SIZE(tab) ((tab) ? (tab)->size : 0)
+
+ /* Useful symbols for values of do_insert in lookup (). */
+-#define LOOKUP ((int *)0)
+-#define INSERT ((int *)1)
++#define LOOKUP 0
++#define INSERT 1
++#define LOOKUP_PTR ((int *)LOOKUP)
++#define INSERT_PTR ((int *)INSERT)
+
+ /* Symbols for values returned by do_insert in lookup (). */
+ #define ALREADY_PRESENT 0
+diff -Naur pvs4.2-orig/BDD/bdd/utils/list.c pvs4.2-bddp/BDD/bdd/utils/list.c
+--- pvs4.2-orig/BDD/bdd/utils/list.c 2007-07-02 20:07:41.000000000 +0000
++++ pvs4.2-bddp/BDD/bdd/utils/list.c 2009-03-24 18:49:23.000000000 +0000
+@@ -462,8 +462,15 @@
+ q = LIST_FIRST(list2);
+
+ while (p && q) {
+- int comp = comparison ? (*comparison)(ELEM_CONTENTS(p), ELEM_CONTENTS(q))
+- : (int) ELEM_CONTENTS(p) - (int) ELEM_CONTENTS(q);
++ int comp;
++ if (comparison)
++ comp = (*comparison)(ELEM_CONTENTS(p), ELEM_CONTENTS(q));
++ else if (ELEM_CONTENTS(p) > ELEM_CONTENTS(q))
++ comp = 1;
++ else if (ELEM_CONTENTS(p) < ELEM_CONTENTS(q))
++ comp = -1;
++ else
++ comp = 0;
+
+ if (!comp) { /* ==> p = q */
+ if (remove_duplicates) {
+diff -Naur pvs4.2-orig/BDD/bdd/utils/Makefile pvs4.2-bddp/BDD/bdd/utils/Makefile
+--- pvs4.2-orig/BDD/bdd/utils/Makefile 2007-07-02 20:07:41.000000000 +0000
++++ pvs4.2-bddp/BDD/bdd/utils/Makefile 2009-03-24 18:49:23.000000000 +0000
+@@ -26,7 +26,7 @@
+ double.o : double.c double.h
+ list.o : list.c list.h alloc.h
+ hash.o : hash.c hash.h alloc.h
+-alloc.o : alloc.c
++alloc.o : alloc.c alloc.h
+
+ dag.o : dag.c dag.h dag_customize.h general.h
+ tree.o : tree.c tree.h tree_customize.h general.h
+diff -Naur pvs4.2-orig/BDD/ix86-MacOSX/Makefile pvs4.2-bddp/BDD/ix86-MacOSX/Makefile
+--- pvs4.2-orig/BDD/ix86-MacOSX/Makefile 2007-07-02 20:07:41.000000000 +0000
++++ pvs4.2-bddp/BDD/ix86-MacOSX/Makefile 2009-03-24 18:49:24.000000000 +0000
+@@ -2,8 +2,11 @@
+ MU = ../mu/src
+ UTILS = ../bdd/utils
+ INCLUDES = -I/usr/include -I$(BDD) -I$(UTILS) -I$(MU)
++# MACOSX_DEPLOYMENT_TARGET and -weak_library are needed so that dylibs work
++# for both leopard and tiger
++MACOSX_DEPLOYMENT_TARGET=10.2
+ LD = ld
+-LDFLAGS = -bundle /usr/lib/bundle1.o -flat_namespace -undefined suppress -L./
++LDFLAGS = -bundle /usr/lib/bundle1.o -flat_namespace -undefined suppress -L./ -weak_library /usr/lib/libSystem.B.dylib
+ CC = cc
+ CFLAGS = -dynamic -DNDEBUG $(INCLUDES)
+ XCFLAGS = -O
+diff -Naur pvs4.2-orig/BDD/mu/src/lex.l pvs4.2-bddp/BDD/mu/src/lex.l
+--- pvs4.2-orig/BDD/mu/src/lex.l 2007-07-02 20:07:41.000000000 +0000
++++ pvs4.2-bddp/BDD/mu/src/lex.l 2009-03-24 18:49:24.000000000 +0000
+@@ -229,7 +229,7 @@
+ /* unimportant white space or new_line */ }
+
+ . {
+- lexerr (ill_char_mess (yytchar)); }
++ lexerr (ill_char_mess (yytext[0])); }
+
+ %%
+
+diff -Naur pvs4.2-orig/BDD/mu/src/Makefile pvs4.2-bddp/BDD/mu/src/Makefile
+--- pvs4.2-orig/BDD/mu/src/Makefile 2007-07-02 20:07:41.000000000 +0000
++++ pvs4.2-bddp/BDD/mu/src/Makefile 2009-03-24 18:49:24.000000000 +0000
+@@ -1,8 +1,8 @@
+ # Copyright (c) 1992-1995 G. Janssen
+
+ BIN=$(HOME)/bin
+-UTILS=../utils
+-BDD=../bdd/src
++UTILS=../../bdd/utils
++BDD=../../bdd/src
+
+ INCLUDES = -I$(BDD) -I$(UTILS)
+
+@@ -30,7 +30,7 @@
+ yacc -d yacc.y
+ y.tab.o : y.tab.c mu.h
+ lex.yy.c : lex.l mu.h
+- lex lex.l
++ lex -l lex.l
+ lex.yy.o : lex.yy.c y.tab.h mu.h
+ $(CC) ${CFLAGS} -w -c lex.yy.c
+
+diff -Naur pvs4.2-orig/BDD/mu/src/mu.c pvs4.2-bddp/BDD/mu/src/mu.c
+--- pvs4.2-orig/BDD/mu/src/mu.c 2007-09-06 18:49:37.000000000 +0000
++++ pvs4.2-bddp/BDD/mu/src/mu.c 2009-03-24 18:49:24.000000000 +0000
+@@ -450,7 +450,7 @@
+ /* Used in print_list. */
+ static void print_var (FILE *fp, void *bdd_idx)
+ {
+- fputs (B_VAR_NAME (BDD_IDX_2_VAR_ID ((int) bdd_idx)), fp);
++ fputs (B_VAR_NAME (BDD_IDX_2_VAR_ID ((int) (long) bdd_idx)), fp);
+ }
+
+ /* ------------------------------------------------------------------------ */
+@@ -667,8 +667,8 @@
+ int x = PHV_ID_2_BDD_IDX ( i);
+ int y = PHV_ID_2_BDD_IDX (n+i);
+
+- x_list = append_cont ((void *) x, x_list);
+- y_list = append_cont ((void *) y, y_list);
++ x_list = append_cont ((void *) (long) x, x_list);
++ y_list = append_cont ((void *) (long) y, y_list);
+ x_bdds[i] = bdd_create_var (x);
+
+ /* For a quick substitute it would be nice to have the x vars close
+@@ -961,7 +961,7 @@
+
+ i = 0;
+ FOR_EACH_LIST_ELEM (vars, elem) {
+- int x = (int) ELEM_CONTENTS (elem);
++ int x = (int) (long) ELEM_CONTENTS (elem);
+ int d = PHV_ID_2_BDD_IDX (i);
+
+ d_bdds[i] = bdd_create_var (d);
+@@ -979,7 +979,7 @@
+ if (mu_debug) {
+ i = 0;
+ FOR_EACH_LIST_ELEM (vars, elem) {
+- int x = (int) ELEM_CONTENTS (elem);
++ int x = (int) (long) ELEM_CONTENTS (elem);
+ int d = PHV_ID_2_BDD_IDX (i);
+
+ fprintf (stderr, "/* %s (rank:%d) <- $%d (rank:%d) */\n",
+@@ -1185,12 +1185,12 @@
+ bdd_print_as_sum_of_cubes (stderr, args[i], 0);
+ bdd_set_output_string (BDD_END_S, str);
+
+- bdd_idxs = append_cont ((void *) PHV_ID_2_BDD_IDX (i), bdd_idxs);
++ bdd_idxs = append_cont ((void *) (long) PHV_ID_2_BDD_IDX (i), bdd_idxs);
+ }
+ }
+ else
+ for (i = 0; i < nr_args; i++)
+- bdd_idxs = append_cont ((void *) PHV_ID_2_BDD_IDX (i), bdd_idxs);
++ bdd_idxs = append_cont ((void *) (long) PHV_ID_2_BDD_IDX (i), bdd_idxs);
+
+ R = bdd_subst_par (args, bdd_idxs, t);
+ free_list (bdd_idxs, 0);
+@@ -1205,10 +1205,10 @@
+ static LIST mu_varids_to_bdd_indices_aux (LIST vars)
+ {
+ FOR_EACH_LIST_ELEM (vars, elem) {
+- int var_id = (int) ELEM_CONTENTS (elem);
++ int var_id = (int) (long) ELEM_CONTENTS (elem);
+ int bdd_idx = VAR_ID_2_BDD_IDX (var_id);
+
+- ELEM_CONTENTS (elem) = (void *) bdd_idx;
++ ELEM_CONTENTS (elem) = (void *) (long) bdd_idx;
+ } END_FOR_EACH_LIST_ELEM;
+
+ return vars;
+@@ -1540,7 +1540,7 @@
+ {
+ union formulaptr info = { NULL };
+
+- lookup (signature->table, name, strlen (name), &info.voidptr, LOOKUP);
++ lookup (signature->table, name, strlen (name), &info.voidptr, LOOKUP_PTR);
+
+ return info.formulaptr;
+ }
+@@ -1716,7 +1716,7 @@
+ int index;
+ int flag;
+
+- flag = (int) INSERT;
++ flag = INSERT;
+ index = lookup (Ip->table, name, strlen (name), NULL, &flag);
+ if (flag == INDEED_INSERTED) {
+ Term T = CALLOC_STRUCT (_Term);
+@@ -1748,7 +1748,7 @@
+ fflush (stdout);
+ }
+
+- flag = (int) INSERT;
++ flag = INSERT;
+ index = lookup (Ip->table, name, strlen (name), NULL, &flag);
+ if (flag == INDEED_INSERTED) {
+ Term T = CALLOC_TERM ();
+@@ -1781,7 +1781,7 @@
+
+ FOR_EACH_LIST_ELEM (args, elem) {
+ Formula argi = (Formula) ELEM_CONTENTS (elem);
+- int lvari = (int) ELEM_CONTENTS (lvars);
++ int lvari = (int) (long) ELEM_CONTENTS (lvars);
+
+ if (F_TYPE (argi) != MU_B_VAR || F_VAR (argi) != lvari)
+ /* vi != argi */
+@@ -1849,7 +1849,7 @@
+ var_id = mu_check_bool_var (buf);
+
+ /* Create list of var id's for L <varid's> . */
+- vars = append_cont ((void *) var_id, vars);
++ vars = append_cont ((void *) (long) var_id, vars);
+ /* Add as Formula to args: */
+ args = append_cont ((void *) B_VAR_INFO (var_id), args);
+ }
+@@ -2026,7 +2026,7 @@
+ _TRUE_TERM.arity = MU_ANY_ARITY;
+
+ /* We do not use entry nr. 0: */
+- lookup (signature->table, "", 0, NULL, INSERT);
++ lookup (signature->table, "", 0, NULL, INSERT_PTR);
+
+ /* Change style of bdd_sum_of_cubes printing: */
+ bdd_set_output_string (BDD_BEG_S, "");
+@@ -2118,7 +2118,7 @@
+ int index;
+ int flag;
+
+- flag = (int) INSERT;
++ flag = INSERT;
+ index = lookup (signature->table, name, strlen (name), NULL, &flag);
+ if (flag == INDEED_INSERTED) {
+ Formula f = CALLOC_FORMULA ();
+@@ -2144,7 +2144,7 @@
+ int index;
+ int flag;
+
+- flag = (int) INSERT;
++ flag = INSERT;
+ index = lookup (signature->table, var, strlen (var), NULL, &flag);
+ if (flag == INDEED_INSERTED) {
+ Formula f = CALLOC_FORMULA ();
+@@ -2169,7 +2169,7 @@
+ */
+ static int when_even (void *p)
+ {
+- if (ODD ((int) p))
++ if (ODD ((int) (long) p))
+ return 0;
+ user_vars = append_cont (p, user_vars);
+ return 1;
+@@ -2260,7 +2260,7 @@
+ LIST bdd_idxs = NULL_LIST;
+
+ /* Get maximum place-holder BDD index: */
+- while ((idx = (int) pop_cont (&vars)) != 0)
++ while ((idx = (int) (long) pop_cont (&vars)) != 0)
+ if (idx > max_idx) max_idx = idx;
+ /* Here: vars == NULL_LIST */
+
+@@ -2278,11 +2278,11 @@
+ var_id = mu_check_bool_var (buf);
+
+ /* Create list of var id's for L <varid's> . */
+- vars = append_cont ((void *) var_id, vars);
++ vars = append_cont ((void *) (long) var_id, vars);
+ /* vars as BDDs: */
+ args[i] = F_BDD (B_VAR_INFO (var_id));
+ /* Create list of corresponding BDD indices: */
+- bdd_idxs = append_cont ((void *) PHV_ID_2_BDD_IDX (i), bdd_idxs);
++ bdd_idxs = append_cont ((void *) (long) PHV_ID_2_BDD_IDX (i), bdd_idxs);
+ }
+
+ /* Substitute lambda vars for place-holder vars in Term's BDD: */
diff --git a/sci-mathematics/pvs/files/pvs-4.2-patch-make b/sci-mathematics/pvs/files/pvs-4.2-patch-make
new file mode 100644
index 000000000..8bde99182
--- /dev/null
+++ b/sci-mathematics/pvs/files/pvs-4.2-patch-make
@@ -0,0 +1,52 @@
+diff -Naur pvs4.2-orig/doc/user-guide/Makefile.in pvs4.2-make/doc/user-guide/Makefile.in
+--- pvs4.2-orig/doc/user-guide/Makefile.in 2007-07-02 20:07:42.000000000 +0000
++++ pvs4.2-make/doc/user-guide/Makefile.in 2009-03-24 18:59:13.000000000 +0000
+@@ -24,7 +24,7 @@
+ pdflatex $<
+
+ sum-nosub.tex sum-sub.tex sum-tccs.tex : sum.pvs sum.el
+- @PVSPATH@/pvs -batch -q -l sum.el -f kill-process
++ @PVSPATH@/pvs -batch -q -l sum.el || echo
+
+ .PHONY: clean
+ clean :
+diff -Naur pvs4.2-orig/Makefile.in pvs4.2-make/Makefile.in
+--- pvs4.2-orig/Makefile.in 2008-07-20 08:58:09.000000000 +0000
++++ pvs4.2-make/Makefile.in 2009-03-24 18:58:50.000000000 +0000
+@@ -488,22 +488,26 @@
+ -load src/make-pvs-methods.lisp
+ endif
+
++CMU-LISP-COMPILE-EXPR=\
++ '(load "pvs.system" :verbose t) \
++ (let ((*load-pvs-prelude* nil)) \
++ (mk:operate-on-system :pvs :compile)) \
++ (quit)'
++
++CMU-BUILD-IMAGE-EXPR=\
++ '(load "pvs.system" :verbose t) \
++ (unwind-protect \
++ (mk:operate-on-system :pvs :compile) \
++ (save-lisp "$@.core" :init-function (function startup-pvs)))'
++
+ $(cmulisp-devel) $(cmulisp-rt) : $(image-deps) \
+ $(pvs-make-files) $(ess) $(ff-files) \
+ $(lisp-files) $(cmulisp) lib/prelude.pvs lib/prelude.prf
+ @echo "******* Compiling PVS files in CMU Lisp"
+ $(MKDIR) -p $(subst $(SYSTEM)-cmulisp,,$@)
+- $(CMULISPEXE) -eval '(load "pvs.system" :verbose t) \
+- (let ((*load-pvs-prelude* nil)) \
+- (mk:operate-on-system :pvs :compile)) \
+- (quit)'
++ $(CMULISPEXE) -eval $(CMU-LISP-COMPILE-EXPR)
+ @echo "******* Building PVS image $@"
+- $(CMULISPEXE) -eval '(load "pvs.system" :verbose t) \
+- (unwind-protect \
+- (mk:operate-on-system :pvs :compile) \
+- (save-lisp "$@.core" \
+- :init-function (function startup-pvs) \
+- ))'
++ $(CMULISPEXE) -eval $(CMU-BUILD-IMAGE-EXPR)
+ -rm $(PVSPATH)BDD/$(PLATFORM)/bdd-cmu.*
+ cp $(CMULISPEXE) $(subst $(SYSTEM)-cmulisp,,$@)
+ cp $(PVSPATH)BDD/$(PLATFORM)/mu.$(LOAD-FOREIGN-EXTENSION) $(subst $(SYSTEM)-cmulisp,,$@)
diff --git a/sci-mathematics/pvs/files/pvs-4.2-patch-sbcl b/sci-mathematics/pvs/files/pvs-4.2-patch-sbcl
new file mode 100644
index 000000000..4fdc4fe46
--- /dev/null
+++ b/sci-mathematics/pvs/files/pvs-4.2-patch-sbcl
@@ -0,0 +1,6847 @@
+diff -Naur pvs4.2-orig/BDD/bdd-allegro.lisp pvs4.2-sbcl/BDD/bdd-allegro.lisp
+--- pvs4.2-orig/BDD/bdd-allegro.lisp 2007-07-02 20:07:41.000000000 +0000
++++ pvs4.2-sbcl/BDD/bdd-allegro.lisp 2009-03-24 18:56:17.000000000 +0000
+@@ -39,6 +39,13 @@
+
+ ;;; #define NULL_LIST ((LIST) 0)
+
++;;; int null_list_p (LIST x)
++(ff:def-foreign-call (null_list_p "bdd___null_list_p")
++ ((x :unsigned-int integer))
++ #+(version>= 6) :strings-convert #+(version>= 6) nil
++ :arg-checking nil
++ :call-direct t
++ :returning :unsigned-int)
+ ;;; void *elem_contents (LIST_ELEM_PTR x)
+ (ff:def-foreign-call (elem_contents "bdd___elem_contents")
+ ((x :unsigned-int integer))
+diff -Naur pvs4.2-orig/BDD/bdd-cmu.lisp pvs4.2-sbcl/BDD/bdd-cmu.lisp
+--- pvs4.2-orig/BDD/bdd-cmu.lisp 2007-07-02 20:07:41.000000000 +0000
++++ pvs4.2-sbcl/BDD/bdd-cmu.lisp 2009-03-24 18:56:17.000000000 +0000
+@@ -39,6 +39,11 @@
+
+ ;;; #define NULL_LIST ((LIST) 0)
+
++;;; int null_list_p (LIST x)
++(alien:def-alien-routine ("bdd___null_list_p" null_list_p)
++ unsigned-int
++ (x unsigned-int))
++
+ ;;; void *elem_contents (LIST_ELEM_PTR x)
+ (alien:def-alien-routine ("bdd___elem_contents" elem_contents)
+ unsigned-int
+diff -Naur pvs4.2-orig/BDD/bdd-ld-table pvs4.2-sbcl/BDD/bdd-ld-table
+--- pvs4.2-orig/BDD/bdd-ld-table 2007-07-02 20:07:41.000000000 +0000
++++ pvs4.2-sbcl/BDD/bdd-ld-table 2009-03-24 18:56:17.000000000 +0000
+@@ -4,6 +4,7 @@
+ bdd___bdd_poslit_p = bdd_poslit_p ;
+ bdd___bdd_neglit_p = bdd_neglit_p ;
+ bdd___bdd_equal_p = bdd_equal_p ;
++bdd___null_list_p = null_list_p ;
+ bdd___elem_contents = elem_contents ;
+ bdd___list_first = list_first ;
+ bdd___list_last = list_last ;
+diff -Naur pvs4.2-orig/BDD/bdd.lisp pvs4.2-sbcl/BDD/bdd.lisp
+--- pvs4.2-orig/BDD/bdd.lisp 2007-07-02 20:07:41.000000000 +0000
++++ pvs4.2-sbcl/BDD/bdd.lisp 2009-03-24 18:56:17.000000000 +0000
+@@ -19,6 +19,7 @@
+
+ (in-package :pvs)
+
++(defmacro null-list? (list) `(= (null_list_p ,list) 1))
+ (defmacro bdd-void? (bdd) `(= (bdd_void_p ,bdd) 1))
+ (defmacro bdd-1? (bdd) `(= (bdd_1_p ,bdd) 1))
+ (defmacro bdd-0? (bdd) `(= (bdd_0_p ,bdd) 1))
+@@ -369,12 +370,12 @@
+ (pushnew (cons op name) (cdr entry) :test #'eql :key #'cdr))))))
+
+ (defun translate-from-bdd-list (bddlist)
+- (let ((bdds (unless (zerop bddlist)
++ (let ((bdds (unless (null-list? bddlist)
+ (translate-from-bdd-list* (list_first bddlist)))))
+ (mapcar #'translate-bdd-cube bdds)))
+
+ (defun translate-from-bdd-list* (bddlist &optional result)
+- (if (zerop bddlist)
++ (if (null-list? bddlist)
+ (nreverse result)
+ (translate-from-bdd-list*
+ (list_next bddlist)
+diff -Naur pvs4.2-orig/BDD/bdd-sbcl.lisp pvs4.2-sbcl/BDD/bdd-sbcl.lisp
+--- pvs4.2-orig/BDD/bdd-sbcl.lisp 1970-01-01 00:00:00.000000000 +0000
++++ pvs4.2-sbcl/BDD/bdd-sbcl.lisp 2009-03-24 18:56:17.000000000 +0000
+@@ -0,0 +1,550 @@
++;; --------------------------------------------------------------------
++;; 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.
++;; --------------------------------------------------------------------
++
++(in-package :pvs)
++
++;; SO - We load this from pvs-init (in src/pvs.lisp), as it requires mu.so,
++;; but if mu.so is loaded at save-lisp time, it doesn't work (at least I
++;; can't get it to).
++
++;;; List accessors
++;;; Lists in the BDD package involve two structures.
++
++;;; A LIST is a structure with slots for a first element pointer, a last
++;;; element pointer, the size, and user-defined info.
++
++;;; A LIST_ELEM is a structure with slots for the contents and the next
++;;; element.
++
++;;; #define NULL_LIST ((LIST) 0)
++
++;;; void *elem_contents (LIST_ELEM_PTR x)
++(sb-alien:define-alien-routine ("bdd___elem_contents" elem_contents)
++ (* t)
++ (x (* t)))
++
++;;; LIST_ELEM_PTR list_first (LIST x)
++(sb-alien:define-alien-routine ("bdd___list_first" list_first)
++ (* t)
++ (x (* t)))
++
++;;; LIST_ELEM_PTR list_last (LIST x)
++(sb-alien:define-alien-routine ("bdd___list_last" list_last)
++ (* t)
++ (x (* t)))
++
++;;; int list_info (LIST x)
++(sb-alien:define-alien-routine ("bdd___list_info" list_info)
++ (integer 32)
++ (x (* t)))
++
++;;; LIST_ELEM_PTR list_next (LIST_ELEM_PTR x)
++(sb-alien:define-alien-routine ("bdd___list_next" list_next)
++ (* t)
++ (x (* t)))
++
++;;; This pretty much follows the bdd.doc sections.
++
++;;; User settable program parameters
++;;; --------------------------------
++;;; int bdd_do_gc; /* default 1 */
++
++(sb-alien:define-alien-variable "bdd_do_gc" (integer 32))
++
++;;; set_bdd_do_gc (int flag)
++(declaim (inline set_bdd_do_gc))
++(defun set_bdd_do_gc (flag)
++ (setf bdd-do-gc flag))
++
++;;; int bdd_do_dynamic_ordering;/* default 1 */
++(sb-alien:define-alien-variable "bdd_do_dynamic_ordering" (integer 32))
++
++;;; set_bdd_do_dynamic_ordering (int flag)
++(declaim (inline set_bdd_do_dynamic_ordering))
++(defun set_bdd_do_dynamic_ordering (flag)
++ (setf bdd-do-dynamic-ordering flag))
++
++;;; int bdd_verbose; /* default 0 */
++(sb-alien:define-alien-variable "bdd_verbose" (integer 32))
++
++;;; set_bdd_verbose (int flag)
++(declaim (inline set_bdd_verbose))
++(defun set_bdd_verbose (flag)
++ (setf bdd-verbose flag))
++
++;;; int bdd_use_neg_edges; /* default 1*/
++(sb-alien:define-alien-variable "bdd_use_neg_edges" (integer 32))
++
++;;; set_bdd_use_neg_edges (int flag)
++(declaim (inline set_bdd_use_neg_edges))
++(defun set_bdd_use_neg_edges (flag)
++ (setf bdd-use-neg-edges flag))
++
++;;; int bdd_use_inv_edges; /* default 1; 0 when bdd_do_dynamic_ordering = 1 */
++(sb-alien:define-alien-variable "bdd_use_inv_edges" (integer 32))
++
++;;; set_bdd_use_inv_edges (int flag)
++(declaim (inline set_bdd_use_inv_edges))
++(defun set_bdd_use_inv_edges (flag)
++ (setf bdd-use-inv-edges flag))
++
++;;; int bdd_sizeof_user_data; /* default 0 */
++;;; int BDD_COMPUTED_TABLE_SIZE;/* default DEFAULT_BDD_COMPUTED_TABLE_SIZE */
++;;; int BDD_HASHTAB_SIZE; /* default DEFAULT_BDD_HASHTAB_SIZE */
++;;; int BDD_NR_RANKS; /* default DEFAULT_BDD_NR_RANKS */
++;;; int BDD_LOAD_FACTOR; /* default DEFAULT_BDD_LOAD_FACTOR */
++
++
++;;; C preprocessor macros:
++;;; ----------------------
++
++;;; Access to fields of BDD struct:
++
++;;; BDD_VARID (F)
++;;; bdd_varid (BDDPTR f)
++(sb-alien:define-alien-routine ("bdd___bdd_varid" bdd_varid)
++ (sb-alien:unsigned 32)
++ (f (* t)))
++
++;;; BDD_THEN (F)
++;;; BDD_ELSE (F)
++;;; BDD_REFCOUNT (F)
++;;; BDD_FLAG (F)
++;;; BDD_MARK (F)
++
++
++;;; Test on terminal nodes:
++;;; -----------------------
++
++;;; BDD_VOID_P (f)
++;;; int bdd_void_p (BDDPTR f)
++(sb-alien:define-alien-routine ("bdd___bdd_void_p" bdd_void_p)
++ (integer 32)
++ (f (* t)))
++
++;;; BDD_1_P (f)
++;;; bdd_1_p (BDDPTR f)
++(sb-alien:define-alien-routine ("bdd___bdd_1_p" bdd_1_p)
++ (integer 32)
++ (f (* t)))
++
++;;; BDD_0_P (f)
++;;; bdd_0_p (BDDPTR f)
++(sb-alien:define-alien-routine ("bdd___bdd_0_p" bdd_0_p)
++ (integer 32)
++ (f (* t)))
++
++;;; BDD_X_P (f)
++;;; bdd_x_p (BDDPTR f)
++(sb-alien:define-alien-routine ("bdd___bdd_x_p" bdd_x_p)
++ (integer 32)
++ (f (* t)))
++
++;;; BDD_CONST_P (f)
++;;; int bdd_const_p (BDDPTR f)
++(sb-alien:define-alien-routine ("bdd___bdd_const_p" bdd_const_p)
++ (integer 32)
++ (f (* t)))
++
++;;; BDD_TERM_P (f)
++;;; bdd_term_p (BDDPTR f)
++(sb-alien:define-alien-routine ("bdd___bdd_term_p" bdd_term_p)
++ (integer 32)
++ (f (* t)))
++
++;;; BDD_LIT_P (f)
++;;; bdd_lit_p (BDDPTR f)
++(sb-alien:define-alien-routine ("bdd___bdd_lit_p" bdd_lit_p)
++ (integer 32)
++ (f (* t)))
++
++;;; BDD_POSLIT_P (f)
++;;; int bdd_poslit_p (BDDPTR f)
++(sb-alien:define-alien-routine ("bdd___bdd_poslit_p" bdd_poslit_p)
++ (integer 32)
++ (f (* t)))
++
++;;; BDD_NEGLIT_P (f)
++;;; int bdd_neglit_p (BDDPTR f)
++(sb-alien:define-alien-routine ("bdd___bdd_neglit_p" bdd_neglit_p)
++ (integer 32)
++ (f (* t)))
++
++;;; BDD_COFACTOR_POS (f)
++;;; BDDPTR bdd_cofactor_pos_ (BDDPTR f)
++(sb-alien:define-alien-routine ("bdd___bdd_cofactor_pos_" bdd_cofactor_pos_)
++ (* t)
++ (f (* t)))
++
++;;; BDD_COFACTOR_NEG (f)
++;;; BDDPTR bdd_cofactor_neg_ (BDDPTR f)
++(sb-alien:define-alien-routine ("bdd___bdd_cofactor_neg_" bdd_cofactor_neg_)
++ (* t)
++ (f (* t)))
++
++;;; void bdd_reset_marks (BDDPTR f)
++;;; void bdd_traverse_pre (register BDDPTR v, void (*pre_action)(BDDPTR))
++;;; void bdd_traverse_post (register BDDPTR v, void (*post_action)(BDDPTR))
++
++;;; int bdd_size (BDDPTR f)
++(sb-alien:define-alien-routine ("bdd___bdd_size" bdd_size)
++ (integer 32)
++ (f (* t)))
++
++;;; int bdd_size_vec (BDDPTR *f_vec, int size)
++;;; int bdd_size_ceil (BDDPTR f, int ceiling)
++
++;;; void bdd_init (void)
++(sb-alien:define-alien-routine ("bdd___bdd_init" bdd_init)
++ sb-alien:void)
++
++;;; void bdd_free (BDDPTR f)
++(sb-alien:define-alien-routine ("bdd___bdd_free" bdd_free)
++ sb-alien:void
++ (f (* t)))
++
++;;; int bdd_gc (void)
++(sb-alien:define-alien-routine ("bdd___bdd_gc" bdd_gc)
++ (integer 32))
++
++;;; BDDPTR bdd_ite (BDDPTR F, BDDPTR G, BDDPTR H)
++(sb-alien:define-alien-routine ("bdd___bdd_ite" bdd_ite)
++ (* t)
++ (f (* t))
++ (g (* t))
++ (h (* t)))
++
++;;; BDDPTR bdd_ite_const (BDDPTR F, BDDPTR G, BDDPTR H)
++(sb-alien:define-alien-routine ("bdd___bdd_ite_const" bdd_ite_const)
++ (* t)
++ (f (* t))
++ (g (* t))
++ (h (* t)))
++
++;;; void bdd_cofactors (BDDPTR f, BDDPTR *vp, BDDPTR *Tp, BDDPTR *Ep)
++;;; BDDPTR bdd_invert_input_top (BDDPTR f)
++(sb-alien:define-alien-routine
++ ("bdd___bdd_invert_input_top" bdd_invert_input_top)
++ (* t)
++ (f (* t)))
++
++;;; BDDPTR bdd_create_var (int v)
++(sb-alien:define-alien-routine ("bdd___bdd_create_var" bdd_create_var)
++ (* t)
++ (v (integer 32)))
++
++;;; BDDPTR bdd_create_var_first (void)
++(sb-alien:define-alien-routine
++ ("bdd___bdd_create_var_first" bdd_create_var_first)
++ (* t))
++
++;;; BDDPTR bdd_create_var_before (BDDPTR v)
++(sb-alien:define-alien-routine
++ ("bdd___bdd_create_var_before" bdd_create_var_before)
++ (* t)
++ (v (* t)))
++
++;;; BDDPTR bdd_create_var_after (BDDPTR v)
++(sb-alien:define-alien-routine
++ ("bdd___bdd_create_var_after" bdd_create_var_after)
++ (* t)
++ (v (* t)))
++
++;;; BDDPTR bdd_create_var_last (void)
++(sb-alien:define-alien-routine
++ ("bdd___bdd_create_var_last" bdd_create_var_last)
++ (* t))
++
++;;; void bdd_print (FILE *fp, BDDPTR f, char *s)
++(sb-alien:define-alien-routine ("bdd___bdd_print" bdd_print)
++ sb-alien:void
++ (fp (* t))
++ (f (* t))
++ (s sb-alien:c-string))
++
++;;; void bdd_print_stats (FILE *fp)
++;;; void bdd_quit (void)
++(sb-alien:define-alien-routine ("bdd___bdd_quit" bdd_quit)
++ sb-alien:void)
++
++;;; int bdd_memsize (void)
++;;; int bdd_memsize_limit (void)
++;;; void bdd_set_memsize_limit_and_handler (int limit, void (*handler) (void))
++;;; int bdd_nodes_alive (void)
++(sb-alien:define-alien-routine ("bdd___bdd_nodes_alive" bdd_nodes_alive)
++ (integer 32))
++
++;;; int bdd_nodes_allocated (void)
++(sb-alien:define-alien-routine
++ ("bdd___bdd_nodes_allocated" bdd_nodes_allocated)
++ (integer 32))
++
++;;; int bdd_nr_occurs_var (int id)
++;;; int bdd_compl_p (BDDPTR f, BDDPTR g)
++;;; int bdd_equal_p (BDDPTR F, BDDPTR G)
++(sb-alien:define-alien-routine ("bdd___bdd_equal_p" bdd_equal_p)
++ (integer 32)
++ (f (* t))
++ (g (* t)))
++
++;;; int bdd_implies_taut (BDDPTR F, BDDPTR G)
++;;; BDDPTR bdd_not (BDDPTR F)
++(sb-alien:define-alien-routine ("bdd___bdd_not" bdd_not)
++ (* t)
++ (f (* t)))
++
++;;; BDDPTR bdd_and (BDDPTR F, BDDPTR G)
++(sb-alien:define-alien-routine ("bdd___bdd_and" bdd_and)
++ (* t)
++ (f (* t))
++ (g (* t)))
++
++;;; BDDPTR bdd_greater (BDDPTR F, BDDPTR G)
++(sb-alien:define-alien-routine ("bdd___bdd_greater" bdd_greater)
++ (* t)
++ (f (* t))
++ (g (* t)))
++
++;;; BDDPTR bdd_less (BDDPTR F, BDDPTR G)
++(sb-alien:define-alien-routine ("bdd___bdd_less" bdd_less)
++ (* t)
++ (f (* t))
++ (g (* t)))
++
++;;; BDDPTR bdd_xor (BDDPTR F, BDDPTR G)
++(sb-alien:define-alien-routine ("bdd___bdd_xor" bdd_xor)
++ (* t)
++ (f (* t))
++ (g (* t)))
++
++;;; BDDPTR bdd_or (BDDPTR F, BDDPTR G)
++(sb-alien:define-alien-routine ("bdd___bdd_or" bdd_or)
++ (* t)
++ (f (* t))
++ (g (* t)))
++
++;;; BDDPTR bdd_nor (BDDPTR F, BDDPTR G)
++(sb-alien:define-alien-routine ("bdd___bdd_nor" bdd_nor)
++ (* t)
++ (f (* t))
++ (g (* t)))
++
++;;; BDDPTR bdd_equiv (BDDPTR F, BDDPTR G)
++(sb-alien:define-alien-routine ("bdd___bdd_equiv" bdd_equiv)
++ (* t)
++ (f (* t))
++ (g (* t)))
++
++;;; BDDPTR bdd_xnor (BDDPTR F, BDDPTR G) /* equivalent to bdd_equiv */
++(sb-alien:define-alien-routine ("bdd___bdd_xnor" bdd_xnor)
++ (* t)
++ (f (* t))
++ (g (* t)))
++
++;;; BDDPTR bdd_implied (BDDPTR F, BDDPTR G)
++(sb-alien:define-alien-routine ("bdd___bdd_implied" bdd_implied)
++ (* t)
++ (f (* t))
++ (g (* t)))
++
++;;; BDDPTR bdd_implies (BDDPTR F, BDDPTR G)
++(sb-alien:define-alien-routine ("bdd___bdd_implies" bdd_implies)
++ (* t)
++ (f (* t))
++ (g (* t)))
++
++;;; BDDPTR bdd_nand (BDDPTR F, BDDPTR G)
++(sb-alien:define-alien-routine ("bdd___bdd_nand" bdd_nand)
++ (* t)
++ (f (* t))
++ (g (* t)))
++
++;;; BDDPTR bdd_0 (void)
++(sb-alien:define-alien-routine ("bdd___bdd_0" bdd_0)
++ (* t))
++
++;;; BDDPTR bdd_1 (void)
++(sb-alien:define-alien-routine ("bdd___bdd_1" bdd_1)
++ (* t))
++
++;;; BDDPTR bdd_X (void)
++(sb-alien:define-alien-routine ("bdd___bdd_X" bdd_X)
++ (* t))
++
++;;; BDDPTR bdd_assign (BDDPTR f)
++(sb-alien:define-alien-routine ("bdd___bdd_assign" bdd_assign)
++ (* t)
++ (f (* t)))
++
++;;; BDDPTR bdd_top_var (BDDPTR f)
++;;; int bdd_top_var_rank (BDDPTR f)
++;;; BDDPTR bdd_then (BDDPTR f)
++(sb-alien:define-alien-routine ("bdd___bdd_then" bdd_then)
++ (* t)
++ (f (* t)))
++
++;;; BDDPTR bdd_else (BDDPTR f)
++(sb-alien:define-alien-routine ("bdd___bdd_else" bdd_else)
++ (* t)
++ (f (* t)))
++
++;;; BDDPTR bdd_apply (BDDPTR (*f)(BDDPTR,BDDPTR),BDDPTR a,BDDPTR b)
++(sb-alien:define-alien-routine ("bdd___bdd_apply" bdd_apply)
++ (* t)
++ (f (* t))
++ (a (* t))
++ (b (* t)))
++
++;;; BDDPTR bdd_constrain (BDDPTR f, BDDPTR c)
++(sb-alien:define-alien-routine ("bdd___bdd_constrain" bdd_constrain)
++ (* t)
++ (f (* t))
++ (c (* t)))
++
++;;; BDDPTR bdd_top_var (BDDPTR f)
++(sb-alien:define-alien-routine ("bdd___bdd_top_var" bdd_top_var)
++ (* t)
++ (f (* t)))
++
++;;; BDD_LIST bdd_sum_of_cubes (BDDPTR f, int irredundant)
++(sb-alien:define-alien-routine ("bdd___bdd_sum_of_cubes" bdd_sum_of_cubes)
++ (* t)
++ (f (* t))
++ (irredundant (integer 32)))
++
++(sb-alien:define-alien-variable ("bdd_interrupted" bdd_interrupted) (integer 32))
++
++;;; The following were obtained by looking through mu.c and collecting
++;;; functions not mentioned above.
++
++;;; int bdd_reorder_var (int var_id, int target_var_id)
++(sb-alien:define-alien-routine ("bdd___bdd_reorder_var" bdd_reorder_var)
++ (integer 32)
++ (var_id (integer 32))
++ (target_var (integer 32)))
++
++;;; BDDPTR bdd_and_smooth (BDDPTR f, BDDPTR g, BDD_LIST vars)
++(sb-alien:define-alien-routine ("bdd___bdd_and_smooth" bdd_and_smooth)
++ (* t)
++ (f (* t))
++ (g (* t))
++ (vars (* t)))
++
++;;; BDD_LIST bdd_rank_order_vars (BDD_LIST vars)
++(sb-alien:define-alien-routine
++ ("bdd___bdd_rank_order_vars" bdd_rank_order_vars)
++ (* t)
++ (vars (* t)))
++
++;;; BDDPTR bdd_quantify (int existential, BDDPTR f, BDD_LIST vars)
++(sb-alien:define-alien-routine ("bdd___bdd_quantify" bdd_quantify)
++ (* t)
++ (existential (integer 32))
++ (f (* t))
++ (vars (* t)))
++
++;;; BDDPTR bdd_subst_par (BDDPTR *f_vec, BDD_LIST vars, BDDPTR g)
++(sb-alien:define-alien-routine ("bdd___bdd_subst_par" bdd_subst_par)
++ (* t)
++ (f_vec (array (* t)))
++ (vars (* t))
++ (g (* t)))
++
++;;; BDDPTR bdd_subst_par_list (BDD_LIST f_list, BDD_LIST vars, BDDPTR g)
++(sb-alien:define-alien-routine ("bdd___bdd_subst_par_list" bdd_subst_par_list)
++ (* t)
++ (f_list (* t))
++ (vars (* t))
++ (g (* t)))
++
++;;; void bdd_free_vec (BDDPTR *f_vec, int size)
++(sb-alien:define-alien-routine ("bdd___bdd_free_vec" bdd_free_vec)
++ sb-alien:void
++ (f_vec (array (* t)))
++ (size (integer 32)))
++
++;;; const char *bdd_get_output_string (int idx)
++(sb-alien:define-alien-routine
++ ("bdd___bdd_get_output_string" bdd_get_output_string)
++ sb-alien:c-string
++ (idx (integer 32)))
++
++;;; void bdd_set_output_string (int idx, const char *str)
++(sb-alien:define-alien-routine
++ ("bdd___bdd_set_output_string" bdd_set_output_string)
++ sb-alien:void
++ (idx (integer 32))
++ (str sb-alien:c-string))
++
++;;; void bdd_print_as_sum_of_cubes (FILE *fp, BDDPTR f, int irredundant)
++(sb-alien:define-alien-routine
++ ("bdd___bdd_print_as_sum_of_cubes" bdd_print_as_sum_of_cubes)
++ sb-alien:void
++ (fp (* t))
++ (f (* t))
++ (irredundant (integer 32)))
++
++;;; BDDPTR bdd_diff (BDDPTR f, BDD_LIST vars)
++(sb-alien:define-alien-routine ("bdd___bdd_diff" bdd_diff)
++ (* t)
++ (f (* t))
++ (vars (* t)))
++
++;;; BDDPTR bdd_one_of_vec (BDDPTR *vec, int size)
++(sb-alien:define-alien-routine ("bdd___bdd_one_of_vec" bdd_one_of_vec)
++ (* t)
++ (vec (array (* t)))
++ (size (integer 32)))
++
++;;; BDDPTR bdd_none_of_vec (BDDPTR *args, int size)
++(sb-alien:define-alien-routine ("bdd___bdd_none_of_vec" bdd_none_of_vec)
++ (* t)
++ (args (array (* t)))
++ (size (integer 32)))
++
++;;; BDDPTR bdd_subst (BDDPTR f, int var, BDDPTR g)
++(sb-alien:define-alien-routine ("bdd___bdd_subst" bdd_subst)
++ (* t)
++ (f (* t))
++ (var (integer 32))
++ (g (* t)))
++
++;;; BDD_LIST bdd_sum_of_cubes_as_list (BDDPTR f)
++(sb-alien:define-alien-routine
++ ("bdd___bdd_sum_of_cubes_as_list" bdd_sum_of_cubes_as_list)
++ (* t)
++ (f (* t)))
++
++;;; int bdd_traverse_cube (BDDPTR cube,
++;;; void (*action) (int index, int neg, int first))
++(sb-alien:define-alien-routine ("bdd___bdd_traverse_cube" bdd_traverse_cube)
++ (integer 32)
++ (cube (* t))
++ (action (* t)))
++
++;;; BDD_LIST bdd_support_as_list_of_vars (BDDPTR f)
++(sb-alien:define-alien-routine
++ ("bdd___bdd_support_as_list_of_vars" bdd_support_as_list_of_vars)
++ (* t)
++ (f (* t)))
++
++(defun bdd-interrupted? ()
++ (not (zerop 'bdd_interrupted)))
++
++(bdd_init)
+diff -Naur pvs4.2-orig/BDD/bdd_table.c pvs4.2-sbcl/BDD/bdd_table.c
+--- pvs4.2-orig/BDD/bdd_table.c 2007-07-02 20:07:41.000000000 +0000
++++ pvs4.2-sbcl/BDD/bdd_table.c 2009-03-24 18:56:17.000000000 +0000
+@@ -8,6 +8,8 @@
+
+ int bdd___bdd_equal_p (BDDPTR F, BDDPTR G) {return bdd_equal_p (F, G);}
+
++int bdd___null_list_p (LIST x) {return null_list_p (x);}
++
+ void bdd___elem_contents (LIST_ELEM_PTR x) {elem_contents (x);}
+
+ LIST_ELEM_PTR bdd___list_first (LIST x) {
+diff -Naur pvs4.2-orig/BDD/ix86_64-Linux/Makefile pvs4.2-sbcl/BDD/ix86_64-Linux/Makefile
+--- pvs4.2-orig/BDD/ix86_64-Linux/Makefile 1970-01-01 00:00:00.000000000 +0000
++++ pvs4.2-sbcl/BDD/ix86_64-Linux/Makefile 2009-03-24 18:56:17.000000000 +0000
+@@ -0,0 +1,48 @@
++BDD = ../bdd/src
++MU = ../mu/src
++UTILS = ../bdd/utils
++INCLUDES = -I/usr/include -I$(BDD) -I$(UTILS) -I$(MU)
++LD = ld
++LDFLAGS = -Bsymbolic -shared -warn-once -L./
++CC = gcc
++CFLAGS = -D_POSIX_SOURCE -DSYSV $(INCLUDES) -DLINUX -DLINUX_REDHAT5 -DSIGNALS_LINUX -fPIC
++XCFLAGS = -O
++SHELL = /bin/sh
++VPATH = ..:../bdd/utils:../bdd/src:../mu/src
++
++muobj = bdd_interface.o bdd.o bdd_factor.o bdd_quant.o bdd_fns.o bdd_vfns.o \
++ appl.o mu_interface.o mu.o
++
++utilobj = double.o list.o hash.o alloc.o
++
++.SUFFIXES:
++.SUFFIXES: .c .o
++.c.o : ; $(CC) $(XCFLAGS) ${CFLAGS} -c $< -o $@
++
++all : mu.so
++
++mu.so : ${muobj} libutils.a ../bdd-ld-table ../mu-ld-table
++ $(LD) ../bdd-ld-table ../mu-ld-table $(LDFLAGS) -o mu.so ${muobj} -lutils -lm -lbsd
++
++libutils.a : ${utilobj}
++ ar r libutils.a ${utilobj}
++ ranlib libutils.a
++
++bdd_interface.o : bdd_interface.c bdd_fns.h
++bdd_factor.o : bdd_factor.c bdd_factor.h
++bdd.o : bdd.c bdd.h bdd_extern.h
++bdd_fns.o : bdd_fns.c bdd_fns.h bdd.h bdd_extern.h
++bdd_quant.o : bdd_quant.c bdd_fns.h bdd.h bdd_extern.h
++bdd_vfns.o : bdd_vfns.c bdd_vfns.h bdd_fns.h bdd.h bdd_extern.h
++
++mu_interface.o : mu_interface.c mu.h
++mu.o : mu.c mu.h
++
++double.o : double.c double.h
++list.o : list.c list.h alloc.h
++hash.o : hash.c hash.h alloc.h
++alloc.o : alloc.c
++
++clean :
++ rm -f *.o *.a *.so
++
+diff -Naur pvs4.2-orig/BDD/mu-sbcl.lisp pvs4.2-sbcl/BDD/mu-sbcl.lisp
+--- pvs4.2-orig/BDD/mu-sbcl.lisp 1970-01-01 00:00:00.000000000 +0000
++++ pvs4.2-sbcl/BDD/mu-sbcl.lisp 2009-03-24 18:56:17.000000000 +0000
+@@ -0,0 +1,248 @@
++;; --------------------------------------------------------------------
++;; 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.
++;; --------------------------------------------------------------------
++(in-package :pvs)
++
++
++;;;;;;;;;;;;;;;;;
++;;; Formula ;;;
++;;;;;;;;;;;;;;;;;
++
++;;; Formula mu_mk_false_formula (void)
++(sb-alien:define-alien-routine ("mu___mu_mk_false_formula" mu_mk_false_formula)
++ (* t))
++
++;;; Formula mu_mk_true_formula (void)
++(sb-alien:define-alien-routine ("mu___mu_mk_true_formula" mu_mk_true_formula)
++ (* t))
++
++;;; Formula mu_mk_bool_var (char *name)
++(sb-alien:define-alien-routine ("mu___mu_mk_bool_var" mu_mk_bool_var)
++ (* t)
++ (name sb-alien:c-string))
++
++;;; int mu_check_bool_var (char *name)
++(sb-alien:define-alien-routine ("mu___mu_check_bool_var" mu_check_bool_var)
++ (integer 32)
++ (var sb-alien:c-string))
++
++;;; Formula mu_check_mk_bool_var (char *name)
++(sb-alien:define-alien-routine
++ ("mu___mu_check_mk_bool_var" mu_check_mk_bool_var)
++ (* t)
++ (name sb-alien:c-string))
++
++;;; Formula mu_mk_ite_formula (Formula cond, Formula then_part, Formula else_part)
++(sb-alien:define-alien-routine ("mu___mu_mk_ite_formula" mu_mk_ite_formula)
++ (* t)
++ (cnd (* t))
++ (then_part (* t))
++ (else_part (* t)))
++
++;;; Formula mu_mk_curry_application (Term R, LIST subs)
++(sb-alien:define-alien-routine
++ ("mu___mu_mk_curry_application" mu_mk_curry_application)
++ (* t)
++ (R (* t))
++ (subs (* t)))
++
++;;; Formula mu_mk_application (Term R, LIST subs, int curried)
++(sb-alien:define-alien-routine ("mu___mu_mk_application" mu_mk_application)
++ (* t)
++ (R (* t))
++ (subs (* t))
++ (curried (integer 32)))
++
++;;; Formula mu_mk_forall (LIST listvars, Formula fml)
++(sb-alien:define-alien-routine ("mu___mu_mk_forall" mu_mk_forall)
++ (* t)
++ (listvars (* t))
++ (fml (* t)))
++
++;;; Formula mu_mk_exists (LIST listvars, Formula fml)
++(sb-alien:define-alien-routine ("mu___mu_mk_exists" mu_mk_exists)
++ (* t)
++ (listvars (* t))
++ (fml (* t)))
++
++;;; Formula mu_mk_implies_formula (Formula fml1, Formula fml2)
++(sb-alien:define-alien-routine
++ ("mu___mu_mk_implies_formula" mu_mk_implies_formula)
++ (* t)
++ (fml1 (* t))
++ (fml2 (* t)))
++
++;;; Formula mu_mk_equiv_formula (Formula fml1, Formula fml2)
++(sb-alien:define-alien-routine ("mu___mu_mk_equiv_formula" mu_mk_equiv_formula)
++ (* t)
++ (fml1 (* t))
++ (fml2 (* t)))
++
++;;; Formula mu_mk_or_formula (Formula fml1, Formula fml2)
++(sb-alien:define-alien-routine ("mu___mu_mk_or_formula" mu_mk_or_formula)
++ (* t)
++ (fml1 (* t))
++ (fml2 (* t)))
++
++;;; Formula mu_mk_and_formula (Formula fml1, Formula fml2)
++(sb-alien:define-alien-routine ("mu___mu_mk_and_formula" mu_mk_and_formula)
++ (* t)
++ (fml1 (* t))
++ (fml2 (* t)))
++
++;;; Formula mu_mk_not_formula (Formula fml)
++(sb-alien:define-alien-routine ("mu___mu_mk_not_formula" mu_mk_not_formula)
++ (* t)
++ (fml (* t)))
++
++;;; Formula mu_mk_cofactor (Formula fml1, Formula fml2)
++(sb-alien:define-alien-routine ("mu___mu_mk_cofactor" mu_mk_cofactor)
++ (* t)
++ (fml1 (* t))
++ (fml2 (* t)))
++
++;;;;;;;;;;;;;;;
++;;; Term ;;;
++;;;;;;;;;;;;;;;
++;;; Term mu_mk_abstraction (LIST vars, Formula f1)
++(sb-alien:define-alien-routine ("mu___mu_mk_abstraction" mu_mk_abstraction)
++ (* t)
++ (vars (* t))
++ (f1 (* t)))
++;;; Term mu_mk_l_fixed_point (int relvar, Term fml1)
++(sb-alien:define-alien-routine ("mu___mu_mk_l_fixed_point" mu_mk_l_fixed_point)
++ (* t)
++ (relvar (integer 32))
++ (fml1 (* t)))
++;;; Term mu_mk_g_fixed_point (int relvar, Term fml1)
++(sb-alien:define-alien-routine ("mu___mu_mk_g_fixed_point" mu_mk_g_fixed_point)
++ (* t)
++ (relvar (integer 32))
++ (fml1 (* t)))
++;;; Term mu_mk_reach (Term Next, Term S0, Term Inv)
++(sb-alien:define-alien-routine ("mu___mu_mk_reach" mu_mk_reach)
++ (* t)
++ (Next (* t))
++ (S0 (* t))
++ (Inv (* t)))
++;;; Term mu_mk_rel_var_dcl (char *name)
++(sb-alien:define-alien-routine ("mu___mu_mk_rel_var_dcl" mu_mk_rel_var_dcl)
++ (* t)
++ (name sb-alien:c-string))
++;;; Term mu_mk_rel_var_ (char *name)
++(sb-alien:define-alien-routine ("mu___mu_mk_rel_var_" mu_mk_rel_var_)
++ (* t)
++ (name sb-alien:c-string))
++;;; Term mu_mk_true_term (void)
++(sb-alien:define-alien-routine ("mu___mu_mk_true_term" mu_mk_true_term)
++ (* t))
++;;; Term mu_mk_false_term (void)
++(sb-alien:define-alien-routine ("mu___mu_mk_false_term" mu_mk_false_term)
++ (* t))
++;;; Term mu_mk_not_term (Term fml1)
++(sb-alien:define-alien-routine ("mu___mu_mk_not_term" mu_mk_not_term)
++ (* t)
++ (fml1 (* t)))
++;;; Term mu_mk_and_term (Term fml1, Term fml2)
++(sb-alien:define-alien-routine ("mu___mu_mk_and_term" mu_mk_and_term)
++ (* t)
++ (fml1 (* t))
++ (fml2 (* t)))
++;;; Term mu_mk_or_term (Term fml1, Term fml2)
++(sb-alien:define-alien-routine ("mu___mu_mk_or_term" mu_mk_or_term)
++ (* t)
++ (fml1 (* t))
++ (fml2 (* t)))
++;;; Term mu_mk_equiv_term (Term fml1, Term fml2)
++(sb-alien:define-alien-routine ("mu___mu_mk_equiv_term" mu_mk_equiv_term)
++ (* t)
++ (fml1 (* t))
++ (fml2 (* t)))
++;;; Term mu_mk_implies_term (Term fml1, Term fml2)
++(sb-alien:define-alien-routine ("mu___mu_mk_implies_term" mu_mk_implies_term)
++ (* t)
++ (fml1 (* t))
++ (fml2 (* t)))
++;;; const char *get_mu_bool_var_name (int bdd_idx)
++(sb-alien:define-alien-routine
++ ("mu___get_mu_bool_var_name" get_mu_bool_var_name)
++ sb-alien:c-string
++ (bdd_idx (integer 32)))
++
++;;;;;;;;;;;;;;;;;;;
++;;; Lists ;;;
++;;;;;;;;;;;;;;;;;;;
++
++;;; LIST append_cont (void *p, LIST list)
++(sb-alien:define-alien-routine ("mu___append_cont" append_cont)
++ (* t)
++ (p (* t))
++ (list (* t)))
++;;; LIST empty_list (void)
++(sb-alien:define-alien-routine ("mu___empty_list" empty_list)
++ (* t))
++
++;;;
++;;; Flags
++
++;;; int set_mu_warnings (int flag)
++(sb-alien:define-alien-routine ("mu___set_mu_warnings" set_mu_warnings)
++ (integer 32)
++ (flag (integer 32)))
++;;; int set_mu_simplify_frontier (int flag)
++(sb-alien:define-alien-routine
++ ("mu___set_mu_simplify_frontier" set_mu_simplify_frontier)
++ (integer 32)
++ (flag (integer 32)))
++;;; int set_mu_verbose (int flag)
++(sb-alien:define-alien-routine ("mu___set_mu_verbose" set_mu_verbose)
++ (integer 32)
++ (flag (integer 32)))
++
++;;
++;;
++;; GC management: not needed, "modelcheck_formula" takes care of it.
++;;
++
++;;;;;;;;;;;;;;;;;;;
++;;; print ;;;
++;;;;;;;;;;;;;;;;;;;
++
++;;; void pvs_mu_print_formula (Formula fml)
++(sb-alien:define-alien-routine
++ ("mu___pvs_mu_print_formula" pvs_mu_print_formula)
++ sb-alien:void
++ (fml (* t)))
++;;; void pvs_mu_print_term (Term t)
++(sb-alien:define-alien-routine ("mu___pvs_mu_print_term" pvs_mu_print_term)
++ sb-alien:void
++ (term (* t)))
++
++;;;;;;;;;;;;;;;;;;;;;;;;;
++;;; Main function ;;;;;
++;;;;;;;;;;;;;;;;;;;;;;;;;
++
++;;; void mu_init (void)
++(sb-alien:define-alien-routine ("mu___mu_init" mu_init)
++ sb-alien:void)
++(sb-alien:define-alien-routine ("mu___mu_quit" mu_quit)
++ sb-alien:void)
++;;; BDDPTR mu___modelcheck_formula (Formula fml)
++(sb-alien:define-alien-routine ("mu___modelcheck_formula" modelcheck_formula)
++ (* t)
++ (fml (* t)))
+diff -Naur pvs4.2-orig/bin/make-dist pvs4.2-sbcl/bin/make-dist
+--- pvs4.2-orig/bin/make-dist 2008-07-19 21:49:18.000000000 +0000
++++ pvs4.2-sbcl/bin/make-dist 2009-03-24 18:56:17.000000000 +0000
+@@ -91,16 +91,18 @@
+ src/groundeval/*.lisp \
+ src/utils/*.lisp \
+ src/utils/ix86-Linux/Makefile src/utils/ix86-MacOSX/Makefile \
++ src/utils/ix86_64-Linux/Makefile \
+ src/utils/powerpc-MacOSX/Makefile \
+ src/utils/sun4-SunOS5/Makefile \
+ BDD/bdd-ld-table BDD/mu-ld-table \
+ BDD/*.c \
+ BDD/*.lisp \
+- BDD/ix86-Linux/Makefile BDD/sun4-SunOS5/Makefile \
++ BDD/ix86-Linux/Makefile BDD/ix86_64-Linux/Makefile BDD/sun4-SunOS5/Makefile \
+ BDD/ix86-MacOSX/Makefile BDD/powerpc-MacOSX/Makefile \
+ BDD/bdd BDD/mu \
+ src/WS1S/README src/WS1S/ws1s-ld-table \
+ src/WS1S/*.c src/WS1S/mona-1.4 \
++ src/WS1S/ix86_64-Linux/Makefile
+ src/WS1S/ix86-Linux/Makefile src/WS1S/sun4-SunOS5/Makefile \
+ src/WS1S/ix86-MacOSX/Makefile src/WS1S/powerpc-MacOSX/Makefile \
+ doc/pvs.bib doc/makebnf.sty doc/pvstex.tex doc/release-notes \
+@@ -155,7 +157,7 @@
+ # echo "pvs-libraries.tgz not created - need to typecheck finite_sets and bitvectors"
+ # fi
+
+-for platform in ix86-Linux ix86-MacOSX powerpc-MacOSX \
++for platform in ix86-Linux ix86_64-Linux ix86-MacOSX powerpc-MacOSX \
+ sun4-SunOS5
+ do
+ for subdir in runtime devel
+@@ -199,5 +201,22 @@
+ else
+ echo "CMU Lisp ${subdir} not available for ${platform}"
+ fi
++ if [ -e bin/${platform}/${subdir}/pvs-sbclisp -a "$subdir" = "runtime" ]
++ then
++ echo Creating pvs-${version}-${platform}-sbclisp${kind}.tgz
++ tar ${TARFLAGS} -f pvs-${version}-${platform}-sbclisp${kind}.tgz \
++ ${pvssystemfiles} \
++ bin/${platform}/b64 bin/relocate \
++ bin/pvs-platform bin/tar-b64-mail \
++ bin/${platform}/${subdir}/mu.* \
++ bin/${platform}/${subdir}/file_utils.* \
++ bin/${platform}/${subdir}/ws1s.* \
++ bin/${platform}/${subdir}/*-sbcl.* \
++ bin/${platform}/${subdir}/lisp \
++ bin/${platform}/${subdir}/pvs-sbclisp*
++ ls -l pvs-${version}-${platform}-sbclisp${kind}.tgz
++ else
++ echo "SBCL ${subdir} not available for ${platform}"
++ fi
+ done
+ done
+diff -Naur pvs4.2-orig/bin/pvs-platform pvs4.2-sbcl/bin/pvs-platform
+--- pvs4.2-orig/bin/pvs-platform 2007-07-16 06:28:06.000000000 +0000
++++ pvs4.2-sbcl/bin/pvs-platform 2009-03-24 18:56:17.000000000 +0000
+@@ -33,7 +33,11 @@
+ esac
+ os=SunOS
+ os_version=`uname -r | cut -d"." -f1`;;
+- Linux) arch=ix86
++ Linux) case `uname -m` in
++ x86_64) arch=ix86_64;;
++ i*86) arch=ix86;;
++ x86*) arch=ix86;;
++ esac
+ os=Linux;;
+ AIX) arch=powerpc-ibm
+ os=AIX
+diff -Naur pvs4.2-orig/config.guess pvs4.2-sbcl/config.guess
+--- pvs4.2-orig/config.guess 2007-07-02 20:07:43.000000000 +0000
++++ pvs4.2-sbcl/config.guess 2009-03-24 18:56:17.000000000 +0000
+@@ -1,9 +1,10 @@
+ #! /bin/sh
+ # Attempt to guess a canonical system name.
+ # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
+-# 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
++# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
++# Free Software Foundation, Inc.
+
+-timestamp='2003-06-17'
++timestamp='2008-12-19'
+
+ # This file is free software; you can redistribute it and/or modify it
+ # under the terms of the GNU General Public License as published by
+@@ -17,13 +18,15 @@
+ #
+ # 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.
++# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
++# 02110-1301, USA.
+ #
+ # As a special exception to the GNU General Public License, if you
+ # distribute this file as part of a program that contains a
+ # configuration script generated by Autoconf, you may include it under
+ # the same distribution terms that you use for the rest of that program.
+
++
+ # Originally written by Per Bothner <per@bothner.com>.
+ # Please send patches to <config-patches@gnu.org>. Submit a context
+ # diff and a properly formatted ChangeLog entry.
+@@ -53,8 +56,8 @@
+ GNU config.guess ($timestamp)
+
+ Originally written by Per Bothner.
+-Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
+-Free Software Foundation, Inc.
++Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
++2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+
+ This is free software; see the source for copying conditions. There is NO
+ warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
+@@ -66,11 +69,11 @@
+ while test $# -gt 0 ; do
+ case $1 in
+ --time-stamp | --time* | -t )
+- echo "$timestamp" ; exit 0 ;;
++ echo "$timestamp" ; exit ;;
+ --version | -v )
+- echo "$version" ; exit 0 ;;
++ echo "$version" ; exit ;;
+ --help | --h* | -h )
+- echo "$usage"; exit 0 ;;
++ echo "$usage"; exit ;;
+ -- ) # Stop option processing
+ shift; break ;;
+ - ) # Use stdin as input.
+@@ -104,7 +107,7 @@
+ trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ;
+ trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ;
+ : ${TMPDIR=/tmp} ;
+- { tmp=`(umask 077 && mktemp -d -q "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
++ { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
+ { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } ||
+ { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } ||
+ { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ;
+@@ -123,7 +126,7 @@
+ ;;
+ ,,*) CC_FOR_BUILD=$CC ;;
+ ,*,*) CC_FOR_BUILD=$HOST_CC ;;
+-esac ;'
++esac ; set_cc_for_build= ;'
+
+ # This is needed to find uname on a Pyramid OSx when run in the BSD universe.
+ # (ghazi@noc.rutgers.edu 1994-08-24)
+@@ -136,13 +139,6 @@
+ UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown
+ UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
+
+-## for Red Hat Linux
+-if test -f /etc/redhat-release ; then
+- VENDOR=redhat ;
+-else
+- VENDOR= ;
+-fi
+-
+ # Note: order is significant - the case branches are not exclusive.
+
+ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
+@@ -165,6 +161,7 @@
+ arm*) machine=arm-unknown ;;
+ sh3el) machine=shl-unknown ;;
+ sh3eb) machine=sh-unknown ;;
++ sh5el) machine=sh5le-unknown ;;
+ *) machine=${UNAME_MACHINE_ARCH}-unknown ;;
+ esac
+ # The Operating System including object format, if it has switched
+@@ -203,50 +200,32 @@
+ # contains redundant information, the shorter form:
+ # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
+ echo "${machine}-${os}${release}"
+- exit 0 ;;
+- amiga:OpenBSD:*:*)
+- echo m68k-unknown-openbsd${UNAME_RELEASE}
+- exit 0 ;;
+- arc:OpenBSD:*:*)
+- echo mipsel-unknown-openbsd${UNAME_RELEASE}
+- exit 0 ;;
+- hp300:OpenBSD:*:*)
+- echo m68k-unknown-openbsd${UNAME_RELEASE}
+- exit 0 ;;
+- mac68k:OpenBSD:*:*)
+- echo m68k-unknown-openbsd${UNAME_RELEASE}
+- exit 0 ;;
+- macppc:OpenBSD:*:*)
+- echo powerpc-unknown-openbsd${UNAME_RELEASE}
+- exit 0 ;;
+- mvme68k:OpenBSD:*:*)
+- echo m68k-unknown-openbsd${UNAME_RELEASE}
+- exit 0 ;;
+- mvme88k:OpenBSD:*:*)
+- echo m88k-unknown-openbsd${UNAME_RELEASE}
+- exit 0 ;;
+- mvmeppc:OpenBSD:*:*)
+- echo powerpc-unknown-openbsd${UNAME_RELEASE}
+- exit 0 ;;
+- pmax:OpenBSD:*:*)
+- echo mipsel-unknown-openbsd${UNAME_RELEASE}
+- exit 0 ;;
+- sgi:OpenBSD:*:*)
+- echo mipseb-unknown-openbsd${UNAME_RELEASE}
+- exit 0 ;;
+- sun3:OpenBSD:*:*)
+- echo m68k-unknown-openbsd${UNAME_RELEASE}
+- exit 0 ;;
+- wgrisc:OpenBSD:*:*)
+- echo mipsel-unknown-openbsd${UNAME_RELEASE}
+- exit 0 ;;
++ exit ;;
+ *:OpenBSD:*:*)
+- echo ${UNAME_MACHINE}-unknown-openbsd${UNAME_RELEASE}
+- exit 0 ;;
++ UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`
++ echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE}
++ exit ;;
++ *:ekkoBSD:*:*)
++ echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE}
++ exit ;;
++ *:SolidBSD:*:*)
++ echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE}
++ exit ;;
++ macppc:MirBSD:*:*)
++ echo powerpc-unknown-mirbsd${UNAME_RELEASE}
++ exit ;;
++ *:MirBSD:*:*)
++ echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE}
++ exit ;;
+ alpha:OSF1:*:*)
+- if test $UNAME_RELEASE = "V4.0"; then
++ case $UNAME_RELEASE in
++ *4.0)
+ UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
+- fi
++ ;;
++ *5.*)
++ UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`
++ ;;
++ esac
+ # According to Compaq, /usr/sbin/psrinfo has been available on
+ # OSF/1 and Tru64 systems produced since 1995. I hope that
+ # covers most systems running today. This code pipes the CPU
+@@ -284,42 +263,49 @@
+ "EV7.9 (21364A)")
+ UNAME_MACHINE="alphaev79" ;;
+ esac
++ # A Pn.n version is a patched version.
+ # A Vn.n version is a released version.
+ # A Tn.n version is a released field test version.
+ # A Xn.n version is an unreleased experimental baselevel.
+ # 1.2 uses "1.2" for uname -r.
+- echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[VTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
+- exit 0 ;;
+- Alpha*:OpenVMS:*:*)
+- echo alpha-hp-vms
+- exit 0 ;;
++ echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
++ exit ;;
+ Alpha\ *:Windows_NT*:*)
+ # How do we know it's Interix rather than the generic POSIX subsystem?
+ # Should we change UNAME_MACHINE based on the output of uname instead
+ # of the specific Alpha model?
+ echo alpha-pc-interix
+- exit 0 ;;
++ exit ;;
+ 21064:Windows_NT:50:3)
+ echo alpha-dec-winnt3.5
+- exit 0 ;;
++ exit ;;
+ Amiga*:UNIX_System_V:4.0:*)
+ echo m68k-unknown-sysv4
+- exit 0;;
++ exit ;;
+ *:[Aa]miga[Oo][Ss]:*:*)
+ echo ${UNAME_MACHINE}-unknown-amigaos
+- exit 0 ;;
++ exit ;;
+ *:[Mm]orph[Oo][Ss]:*:*)
+ echo ${UNAME_MACHINE}-unknown-morphos
+- exit 0 ;;
++ exit ;;
+ *:OS/390:*:*)
+ echo i370-ibm-openedition
+- exit 0 ;;
++ exit ;;
++ *:z/VM:*:*)
++ echo s390-ibm-zvmoe
++ exit ;;
++ *:OS400:*:*)
++ echo powerpc-ibm-os400
++ exit ;;
+ arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
+ echo arm-acorn-riscix${UNAME_RELEASE}
+- exit 0;;
++ exit ;;
++ arm:riscos:*:*|arm:RISCOS:*:*)
++ echo arm-unknown-riscos
++ exit ;;
+ SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
+ echo hppa1.1-hitachi-hiuxmpp
+- exit 0;;
++ exit ;;
+ Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*)
+ # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE.
+ if test "`(/bin/universe) 2>/dev/null`" = att ; then
+@@ -327,32 +313,45 @@
+ else
+ echo pyramid-pyramid-bsd
+ fi
+- exit 0 ;;
++ exit ;;
+ NILE*:*:*:dcosx)
+ echo pyramid-pyramid-svr4
+- exit 0 ;;
++ exit ;;
+ DRS?6000:unix:4.0:6*)
+ echo sparc-icl-nx6
+- exit 0 ;;
+- DRS?6000:UNIX_SV:4.2*:7*)
++ exit ;;
++ DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*)
+ case `/usr/bin/uname -p` in
+- sparc) echo sparc-icl-nx7 && exit 0 ;;
++ sparc) echo sparc-icl-nx7; exit ;;
+ esac ;;
+ sun4H:SunOS:5.*:*)
+ echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+- exit 0 ;;
++ exit ;;
+ sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
+ echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+- exit 0 ;;
+- i86pc:SunOS:5.*:*)
+- echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+- exit 0 ;;
++ exit ;;
++ i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*)
++ eval $set_cc_for_build
++ SUN_ARCH="i386"
++ # If there is a compiler, see if it is configured for 64-bit objects.
++ # Note that the Sun cc does not turn __LP64__ into 1 like gcc does.
++ # This test works for both compilers.
++ if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
++ if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \
++ (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
++ grep IS_64BIT_ARCH >/dev/null
++ then
++ SUN_ARCH="x86_64"
++ fi
++ fi
++ echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
++ exit ;;
+ sun4*:SunOS:6*:*)
+ # According to config.sub, this is the proper way to canonicalize
+ # SunOS6. Hard to guess exactly what SunOS6 will be like, but
+ # it's likely to be more like Solaris than SunOS4.
+ echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+- exit 0 ;;
++ exit ;;
+ sun4*:SunOS:*:*)
+ case "`/usr/bin/arch -k`" in
+ Series*|S4*)
+@@ -361,10 +360,10 @@
+ esac
+ # Japanese Language versions have a version number like `4.1.3-JL'.
+ echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'`
+- exit 0 ;;
++ exit ;;
+ sun3*:SunOS:*:*)
+ echo m68k-sun-sunos${UNAME_RELEASE}
+- exit 0 ;;
++ exit ;;
+ sun*:*:4.2BSD:*)
+ UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
+ test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3
+@@ -376,10 +375,10 @@
+ echo sparc-sun-sunos${UNAME_RELEASE}
+ ;;
+ esac
+- exit 0 ;;
++ exit ;;
+ aushp:SunOS:*:*)
+ echo sparc-auspex-sunos${UNAME_RELEASE}
+- exit 0 ;;
++ exit ;;
+ # The situation for MiNT is a little confusing. The machine name
+ # can be virtually everything (everything which is not
+ # "atarist" or "atariste" at least should have a processor
+@@ -390,37 +389,40 @@
+ # be no problem.
+ atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
+ echo m68k-atari-mint${UNAME_RELEASE}
+- exit 0 ;;
++ exit ;;
+ atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
+ echo m68k-atari-mint${UNAME_RELEASE}
+- exit 0 ;;
++ exit ;;
+ *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
+ echo m68k-atari-mint${UNAME_RELEASE}
+- exit 0 ;;
++ exit ;;
+ milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
+ echo m68k-milan-mint${UNAME_RELEASE}
+- exit 0 ;;
++ exit ;;
+ hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
+ echo m68k-hades-mint${UNAME_RELEASE}
+- exit 0 ;;
++ exit ;;
+ *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
+ echo m68k-unknown-mint${UNAME_RELEASE}
+- exit 0 ;;
++ exit ;;
++ m68k:machten:*:*)
++ echo m68k-apple-machten${UNAME_RELEASE}
++ exit ;;
+ powerpc:machten:*:*)
+ echo powerpc-apple-machten${UNAME_RELEASE}
+- exit 0 ;;
++ exit ;;
+ RISC*:Mach:*:*)
+ echo mips-dec-mach_bsd4.3
+- exit 0 ;;
++ exit ;;
+ RISC*:ULTRIX:*:*)
+ echo mips-dec-ultrix${UNAME_RELEASE}
+- exit 0 ;;
++ exit ;;
+ VAX*:ULTRIX*:*:*)
+ echo vax-dec-ultrix${UNAME_RELEASE}
+- exit 0 ;;
++ exit ;;
+ 2020:CLIX:*:* | 2430:CLIX:*:*)
+ echo clipper-intergraph-clix${UNAME_RELEASE}
+- exit 0 ;;
++ exit ;;
+ mips:*:*:UMIPS | mips:*:*:RISCos)
+ eval $set_cc_for_build
+ sed 's/^ //' << EOF >$dummy.c
+@@ -444,32 +446,33 @@
+ exit (-1);
+ }
+ EOF
+- $CC_FOR_BUILD -o $dummy $dummy.c \
+- && $dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \
+- && exit 0
++ $CC_FOR_BUILD -o $dummy $dummy.c &&
++ dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` &&
++ SYSTEM_NAME=`$dummy $dummyarg` &&
++ { echo "$SYSTEM_NAME"; exit; }
+ echo mips-mips-riscos${UNAME_RELEASE}
+- exit 0 ;;
++ exit ;;
+ Motorola:PowerMAX_OS:*:*)
+ echo powerpc-motorola-powermax
+- exit 0 ;;
++ exit ;;
+ Motorola:*:4.3:PL8-*)
+ echo powerpc-harris-powermax
+- exit 0 ;;
++ exit ;;
+ Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*)
+ echo powerpc-harris-powermax
+- exit 0 ;;
++ exit ;;
+ Night_Hawk:Power_UNIX:*:*)
+ echo powerpc-harris-powerunix
+- exit 0 ;;
++ exit ;;
+ m88k:CX/UX:7*:*)
+ echo m88k-harris-cxux7
+- exit 0 ;;
++ exit ;;
+ m88k:*:4*:R4*)
+ echo m88k-motorola-sysv4
+- exit 0 ;;
++ exit ;;
+ m88k:*:3*:R3*)
+ echo m88k-motorola-sysv3
+- exit 0 ;;
++ exit ;;
+ AViiON:dgux:*:*)
+ # DG/UX returns AViiON for all architectures
+ UNAME_PROCESSOR=`/usr/bin/uname -p`
+@@ -485,29 +488,29 @@
+ else
+ echo i586-dg-dgux${UNAME_RELEASE}
+ fi
+- exit 0 ;;
++ exit ;;
+ M88*:DolphinOS:*:*) # DolphinOS (SVR3)
+ echo m88k-dolphin-sysv3
+- exit 0 ;;
++ exit ;;
+ M88*:*:R3*:*)
+ # Delta 88k system running SVR3
+ echo m88k-motorola-sysv3
+- exit 0 ;;
++ exit ;;
+ XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3)
+ echo m88k-tektronix-sysv3
+- exit 0 ;;
++ exit ;;
+ Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD)
+ echo m68k-tektronix-bsd
+- exit 0 ;;
++ exit ;;
+ *:IRIX*:*:*)
+ echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'`
+- exit 0 ;;
++ exit ;;
+ ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
+- echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id
+- exit 0 ;; # Note that: echo "'`uname -s`'" gives 'AIX '
++ echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id
++ exit ;; # Note that: echo "'`uname -s`'" gives 'AIX '
+ i*86:AIX:*:*)
+ echo i386-ibm-aix
+- exit 0 ;;
++ exit ;;
+ ia64:AIX:*:*)
+ if [ -x /usr/bin/oslevel ] ; then
+ IBM_REV=`/usr/bin/oslevel`
+@@ -515,7 +518,7 @@
+ IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
+ fi
+ echo ${UNAME_MACHINE}-ibm-aix${IBM_REV}
+- exit 0 ;;
++ exit ;;
+ *:AIX:2:3)
+ if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
+ eval $set_cc_for_build
+@@ -530,15 +533,19 @@
+ exit(0);
+ }
+ EOF
+- $CC_FOR_BUILD -o $dummy $dummy.c && $dummy && exit 0
+- echo rs6000-ibm-aix3.2.5
++ if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy`
++ then
++ echo "$SYSTEM_NAME"
++ else
++ echo rs6000-ibm-aix3.2.5
++ fi
+ elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
+ echo rs6000-ibm-aix3.2.4
+ else
+ echo rs6000-ibm-aix3.2
+ fi
+- exit 0 ;;
+- *:AIX:*:[45])
++ exit ;;
++ *:AIX:*:[456])
+ IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
+ if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
+ IBM_ARCH=rs6000
+@@ -551,28 +558,28 @@
+ IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
+ fi
+ echo ${IBM_ARCH}-ibm-aix${IBM_REV}
+- exit 0 ;;
++ exit ;;
+ *:AIX:*:*)
+ echo rs6000-ibm-aix
+- exit 0 ;;
++ exit ;;
+ ibmrt:4.4BSD:*|romp-ibm:BSD:*)
+ echo romp-ibm-bsd4.4
+- exit 0 ;;
++ exit ;;
+ ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and
+ echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to
+- exit 0 ;; # report: romp-ibm BSD 4.3
++ exit ;; # report: romp-ibm BSD 4.3
+ *:BOSX:*:*)
+ echo rs6000-bull-bosx
+- exit 0 ;;
++ exit ;;
+ DPX/2?00:B.O.S.:*:*)
+ echo m68k-bull-sysv3
+- exit 0 ;;
++ exit ;;
+ 9000/[34]??:4.3bsd:1.*:*)
+ echo m68k-hp-bsd
+- exit 0 ;;
++ exit ;;
+ hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*)
+ echo m68k-hp-bsd4.4
+- exit 0 ;;
++ exit ;;
+ 9000/[34678]??:HP-UX:*:*)
+ HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
+ case "${UNAME_MACHINE}" in
+@@ -634,9 +641,19 @@
+ esac
+ if [ ${HP_ARCH} = "hppa2.0w" ]
+ then
+- # avoid double evaluation of $set_cc_for_build
+- test -n "$CC_FOR_BUILD" || eval $set_cc_for_build
+- if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E -) | grep __LP64__ >/dev/null
++ eval $set_cc_for_build
++
++ # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating
++ # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler
++ # generating 64-bit code. GNU and HP use different nomenclature:
++ #
++ # $ CC_FOR_BUILD=cc ./config.guess
++ # => hppa2.0w-hp-hpux11.23
++ # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess
++ # => hppa64-hp-hpux11.23
++
++ if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) |
++ grep __LP64__ >/dev/null
+ then
+ HP_ARCH="hppa2.0w"
+ else
+@@ -644,11 +661,11 @@
+ fi
+ fi
+ echo ${HP_ARCH}-hp-hpux${HPUX_REV}
+- exit 0 ;;
++ exit ;;
+ ia64:HP-UX:*:*)
+ HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
+ echo ia64-hp-hpux${HPUX_REV}
+- exit 0 ;;
++ exit ;;
+ 3050*:HI-UX:*:*)
+ eval $set_cc_for_build
+ sed 's/^ //' << EOF >$dummy.c
+@@ -676,150 +693,192 @@
+ exit (0);
+ }
+ EOF
+- $CC_FOR_BUILD -o $dummy $dummy.c && $dummy && exit 0
++ $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` &&
++ { echo "$SYSTEM_NAME"; exit; }
+ echo unknown-hitachi-hiuxwe2
+- exit 0 ;;
++ exit ;;
+ 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )
+ echo hppa1.1-hp-bsd
+- exit 0 ;;
++ exit ;;
+ 9000/8??:4.3bsd:*:*)
+ echo hppa1.0-hp-bsd
+- exit 0 ;;
++ exit ;;
+ *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*)
+ echo hppa1.0-hp-mpeix
+- exit 0 ;;
++ exit ;;
+ hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* )
+ echo hppa1.1-hp-osf
+- exit 0 ;;
++ exit ;;
+ hp8??:OSF1:*:*)
+ echo hppa1.0-hp-osf
+- exit 0 ;;
++ exit ;;
+ i*86:OSF1:*:*)
+ if [ -x /usr/sbin/sysversion ] ; then
+ echo ${UNAME_MACHINE}-unknown-osf1mk
+ else
+ echo ${UNAME_MACHINE}-unknown-osf1
+ fi
+- exit 0 ;;
++ exit ;;
+ parisc*:Lites*:*:*)
+ echo hppa1.1-hp-lites
+- exit 0 ;;
++ exit ;;
+ C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
+ echo c1-convex-bsd
+- exit 0 ;;
++ exit ;;
+ C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
+ if getsysinfo -f scalar_acc
+ then echo c32-convex-bsd
+ else echo c2-convex-bsd
+ fi
+- exit 0 ;;
++ exit ;;
+ C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
+ echo c34-convex-bsd
+- exit 0 ;;
++ exit ;;
+ C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
+ echo c38-convex-bsd
+- exit 0 ;;
++ exit ;;
+ C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
+ echo c4-convex-bsd
+- exit 0 ;;
++ exit ;;
+ CRAY*Y-MP:*:*:*)
+ echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+- exit 0 ;;
++ exit ;;
+ CRAY*[A-Z]90:*:*:*)
+ echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \
+ | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
+ -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \
+ -e 's/\.[^.]*$/.X/'
+- exit 0 ;;
++ exit ;;
+ CRAY*TS:*:*:*)
+ echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+- exit 0 ;;
++ exit ;;
+ CRAY*T3E:*:*:*)
+ echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+- exit 0 ;;
++ exit ;;
+ CRAY*SV1:*:*:*)
+ echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+- exit 0 ;;
++ exit ;;
+ *:UNICOS/mp:*:*)
+- echo nv1-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+- exit 0 ;;
++ echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
++ exit ;;
+ F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
+ FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
+ FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
+ FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
+ echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
+- exit 0 ;;
++ exit ;;
++ 5000:UNIX_System_V:4.*:*)
++ FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
++ FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'`
++ echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
++ exit ;;
+ i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
+ echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
+- exit 0 ;;
++ exit ;;
+ sparc*:BSD/OS:*:*)
+ echo sparc-unknown-bsdi${UNAME_RELEASE}
+- exit 0 ;;
++ exit ;;
+ *:BSD/OS:*:*)
+ echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
+- exit 0 ;;
+- *:FreeBSD:*:*|*:GNU/FreeBSD:*:*)
+- # Determine whether the default compiler uses glibc.
+- eval $set_cc_for_build
+- sed 's/^ //' << EOF >$dummy.c
+- #include <features.h>
+- #if __GLIBC__ >= 2
+- LIBC=gnu
+- #else
+- LIBC=
+- #endif
+-EOF
+- eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=`
+- echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`${LIBC:+-$LIBC}
+- exit 0 ;;
++ exit ;;
++ *:FreeBSD:*:*)
++ case ${UNAME_MACHINE} in
++ pc98)
++ echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
++ amd64)
++ echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
++ *)
++ echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
++ esac
++ exit ;;
+ i*:CYGWIN*:*)
+ echo ${UNAME_MACHINE}-pc-cygwin
+- exit 0 ;;
+- i*:MINGW*:*)
++ exit ;;
++ *:MINGW*:*)
+ echo ${UNAME_MACHINE}-pc-mingw32
+- exit 0 ;;
++ exit ;;
++ i*:windows32*:*)
++ # uname -m includes "-pc" on this system.
++ echo ${UNAME_MACHINE}-mingw32
++ exit ;;
+ i*:PW*:*)
+ echo ${UNAME_MACHINE}-pc-pw32
+- exit 0 ;;
+- x86:Interix*:[34]*)
+- echo i586-pc-interix${UNAME_RELEASE}|sed -e 's/\..*//'
+- exit 0 ;;
++ exit ;;
++ *:Interix*:[3456]*)
++ case ${UNAME_MACHINE} in
++ x86)
++ echo i586-pc-interix${UNAME_RELEASE}
++ exit ;;
++ EM64T | authenticamd | genuineintel)
++ echo x86_64-unknown-interix${UNAME_RELEASE}
++ exit ;;
++ IA64)
++ echo ia64-unknown-interix${UNAME_RELEASE}
++ exit ;;
++ esac ;;
+ [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
+ echo i${UNAME_MACHINE}-pc-mks
+- exit 0 ;;
++ exit ;;
+ i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
+ # How do we know it's Interix rather than the generic POSIX subsystem?
+ # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
+ # UNAME_MACHINE based on the output of uname instead of i386?
+ echo i586-pc-interix
+- exit 0 ;;
++ exit ;;
+ i*:UWIN*:*)
+ echo ${UNAME_MACHINE}-pc-uwin
+- exit 0 ;;
++ exit ;;
++ amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*)
++ echo x86_64-unknown-cygwin
++ exit ;;
+ p*:CYGWIN*:*)
+ echo powerpcle-unknown-cygwin
+- exit 0 ;;
++ exit ;;
+ prep*:SunOS:5.*:*)
+ echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+- exit 0 ;;
++ exit ;;
+ *:GNU:*:*)
++ # the GNU system
+ echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
+- exit 0 ;;
++ exit ;;
++ *:GNU/*:*:*)
++ # other systems with GNU libc and userland
++ echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu
++ exit ;;
+ i*86:Minix:*:*)
+ echo ${UNAME_MACHINE}-pc-minix
+- exit 0 ;;
++ exit ;;
+ arm*:Linux:*:*)
++ eval $set_cc_for_build
++ if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
++ | grep -q __ARM_EABI__
++ then
++ echo ${UNAME_MACHINE}-unknown-linux-gnu
++ else
++ echo ${UNAME_MACHINE}-unknown-linux-gnueabi
++ fi
++ exit ;;
++ avr32*:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
+- exit 0 ;;
++ exit ;;
+ cris:Linux:*:*)
+ echo cris-axis-linux-gnu
+- exit 0 ;;
++ exit ;;
++ crisv32:Linux:*:*)
++ echo crisv32-axis-linux-gnu
++ exit ;;
++ frv:Linux:*:*)
++ echo frv-unknown-linux-gnu
++ exit ;;
+ ia64:Linux:*:*)
+- echo ${UNAME_MACHINE}-${VENDOR:-unknown}-linux-gnu
+- exit 0 ;;
++ echo ${UNAME_MACHINE}-unknown-linux-gnu
++ exit ;;
++ m32r*:Linux:*:*)
++ echo ${UNAME_MACHINE}-unknown-linux-gnu
++ exit ;;
+ m68*:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
+- exit 0 ;;
++ exit ;;
+ mips:Linux:*:*)
+ eval $set_cc_for_build
+ sed 's/^ //' << EOF >$dummy.c
+@@ -836,8 +895,12 @@
+ #endif
+ #endif
+ EOF
+- eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=`
+- test x"${CPU}" != x && echo "${CPU}-unknown-linux-gnu" && exit 0
++ eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
++ /^CPU/{
++ s: ::g
++ p
++ }'`"
++ test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
+ ;;
+ mips64:Linux:*:*)
+ eval $set_cc_for_build
+@@ -855,15 +918,22 @@
+ #endif
+ #endif
+ EOF
+- eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=`
+- test x"${CPU}" != x && echo "${CPU}-unknown-linux-gnu" && exit 0
++ eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
++ /^CPU/{
++ s: ::g
++ p
++ }'`"
++ test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
+ ;;
++ or32:Linux:*:*)
++ echo or32-unknown-linux-gnu
++ exit ;;
+ ppc:Linux:*:*)
+- echo powerpc-${VENDOR:-unknown}-linux-gnu
+- exit 0 ;;
++ echo powerpc-unknown-linux-gnu
++ exit ;;
+ ppc64:Linux:*:*)
+- echo powerpc64-${VENDOR:-unknown}-linux-gnu
+- exit 0 ;;
++ echo powerpc64-unknown-linux-gnu
++ exit ;;
+ alpha:Linux:*:*)
+ case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
+ EV5) UNAME_MACHINE=alphaev5 ;;
+@@ -877,7 +947,10 @@
+ objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null
+ if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
+ echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
+- exit 0 ;;
++ exit ;;
++ padre:Linux:*:*)
++ echo sparc-unknown-linux-gnu
++ exit ;;
+ parisc:Linux:*:* | hppa:Linux:*:*)
+ # Look for CPU level
+ case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
+@@ -885,25 +958,31 @@
+ PA8*) echo hppa2.0-unknown-linux-gnu ;;
+ *) echo hppa-unknown-linux-gnu ;;
+ esac
+- exit 0 ;;
++ exit ;;
+ parisc64:Linux:*:* | hppa64:Linux:*:*)
+ echo hppa64-unknown-linux-gnu
+- exit 0 ;;
++ exit ;;
+ s390:Linux:*:* | s390x:Linux:*:*)
+- echo ${UNAME_MACHINE}-${VENDOR:-ibm}-linux-gnu
+- exit 0 ;;
++ echo ${UNAME_MACHINE}-ibm-linux
++ exit ;;
+ sh64*:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
+- exit 0 ;;
++ exit ;;
+ sh*:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
+- exit 0 ;;
++ exit ;;
+ sparc:Linux:*:* | sparc64:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
+- exit 0 ;;
++ exit ;;
++ vax:Linux:*:*)
++ echo ${UNAME_MACHINE}-dec-linux-gnu
++ exit ;;
+ x86_64:Linux:*:*)
+- echo x86_64-${VENDOR:-unknown}-linux-gnu
+- exit 0 ;;
++ echo x86_64-unknown-linux-gnu
++ exit ;;
++ xtensa*:Linux:*:*)
++ echo ${UNAME_MACHINE}-unknown-linux-gnu
++ exit ;;
+ i*86:Linux:*:*)
+ # The BFD linker knows what the default object file format is, so
+ # first see if it will tell us. cd to the root directory to prevent
+@@ -921,15 +1000,12 @@
+ ;;
+ a.out-i386-linux)
+ echo "${UNAME_MACHINE}-pc-linux-gnuaout"
+- exit 0 ;;
+- coff-i386)
+- echo "${UNAME_MACHINE}-pc-linux-gnucoff"
+- exit 0 ;;
++ exit ;;
+ "")
+ # Either a pre-BFD a.out linker (linux-gnuoldld) or
+ # one that does not give us useful --help.
+ echo "${UNAME_MACHINE}-pc-linux-gnuoldld"
+- exit 0 ;;
++ exit ;;
+ esac
+ # Determine whether the default compiler is a.out or elf
+ eval $set_cc_for_build
+@@ -946,23 +1022,33 @@
+ LIBC=gnulibc1
+ # endif
+ #else
+- #ifdef __INTEL_COMPILER
++ #if defined(__INTEL_COMPILER) || defined(__PGI) || defined(__SUNPRO_C) || defined(__SUNPRO_CC)
+ LIBC=gnu
+ #else
+ LIBC=gnuaout
+ #endif
+ #endif
++ #ifdef __dietlibc__
++ LIBC=dietlibc
++ #endif
+ EOF
+- eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=`
+- test x"${LIBC}" != x && echo "${UNAME_MACHINE}-${VENDOR:-pc}-linux-${LIBC}" && exit 0
+- test x"${TENTATIVE}" != x && echo "${TENTATIVE}" && exit 0
++ eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
++ /^LIBC/{
++ s: ::g
++ p
++ }'`"
++ test x"${LIBC}" != x && {
++ echo "${UNAME_MACHINE}-pc-linux-${LIBC}"
++ exit
++ }
++ test x"${TENTATIVE}" != x && { echo "${TENTATIVE}"; exit; }
+ ;;
+ i*86:DYNIX/ptx:4*:*)
+ # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
+ # earlier versions are messed up and put the nodename in both
+ # sysname and nodename.
+ echo i386-sequent-sysv4
+- exit 0 ;;
++ exit ;;
+ i*86:UNIX_SV:4.2MP:2.*)
+ # Unixware is an offshoot of SVR4, but it has its own version
+ # number series starting with 2...
+@@ -970,24 +1056,27 @@
+ # I just have to hope. -- rms.
+ # Use sysv4.2uw... so that sysv4* matches it.
+ echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
+- exit 0 ;;
++ exit ;;
+ i*86:OS/2:*:*)
+ # If we were able to find `uname', then EMX Unix compatibility
+ # is probably installed.
+ echo ${UNAME_MACHINE}-pc-os2-emx
+- exit 0 ;;
++ exit ;;
+ i*86:XTS-300:*:STOP)
+ echo ${UNAME_MACHINE}-unknown-stop
+- exit 0 ;;
++ exit ;;
+ i*86:atheos:*:*)
+ echo ${UNAME_MACHINE}-unknown-atheos
+- exit 0 ;;
++ exit ;;
++ i*86:syllable:*:*)
++ echo ${UNAME_MACHINE}-pc-syllable
++ exit ;;
+ i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*)
+ echo i386-unknown-lynxos${UNAME_RELEASE}
+- exit 0 ;;
++ exit ;;
+ i*86:*DOS:*:*)
+ echo ${UNAME_MACHINE}-pc-msdosdjgpp
+- exit 0 ;;
++ exit ;;
+ i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*)
+ UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'`
+ if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
+@@ -995,15 +1084,16 @@
+ else
+ echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL}
+ fi
+- exit 0 ;;
+- i*86:*:5:[78]*)
++ exit ;;
++ i*86:*:5:[678]*)
++ # UnixWare 7.x, OpenUNIX and OpenServer 6.
+ case `/bin/uname -X | grep "^Machine"` in
+ *486*) UNAME_MACHINE=i486 ;;
+ *Pentium) UNAME_MACHINE=i586 ;;
+ *Pent*|*Celeron) UNAME_MACHINE=i686 ;;
+ esac
+ echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}
+- exit 0 ;;
++ exit ;;
+ i*86:*:3.2:*)
+ if test -f /usr/options/cb.name; then
+ UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
+@@ -1021,73 +1111,83 @@
+ else
+ echo ${UNAME_MACHINE}-pc-sysv32
+ fi
+- exit 0 ;;
++ exit ;;
+ pc:*:*:*)
+ # Left here for compatibility:
+ # uname -m prints for DJGPP always 'pc', but it prints nothing about
+ # the processor, so we play safe by assuming i386.
+ echo i386-pc-msdosdjgpp
+- exit 0 ;;
++ exit ;;
+ Intel:Mach:3*:*)
+ echo i386-pc-mach3
+- exit 0 ;;
++ exit ;;
+ paragon:*:*:*)
+ echo i860-intel-osf1
+- exit 0 ;;
++ exit ;;
+ i860:*:4.*:*) # i860-SVR4
+ if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then
+ echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4
+ else # Add other i860-SVR4 vendors below as they are discovered.
+ echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4
+ fi
+- exit 0 ;;
++ exit ;;
+ mini*:CTIX:SYS*5:*)
+ # "miniframe"
+ echo m68010-convergent-sysv
+- exit 0 ;;
++ exit ;;
+ mc68k:UNIX:SYSTEM5:3.51m)
+ echo m68k-convergent-sysv
+- exit 0 ;;
++ exit ;;
+ M680?0:D-NIX:5.3:*)
+ echo m68k-diab-dnix
+- exit 0 ;;
+- M68*:*:R3V[567]*:*)
+- test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;;
+- 3[34]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0)
++ exit ;;
++ M68*:*:R3V[5678]*:*)
++ test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;;
++ 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0)
+ OS_REL=''
+ test -r /etc/.relid \
+ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
+ /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
+- && echo i486-ncr-sysv4.3${OS_REL} && exit 0
++ && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
+ /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
+- && echo i586-ncr-sysv4.3${OS_REL} && exit 0 ;;
++ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
+ 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
+ /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
+- && echo i486-ncr-sysv4 && exit 0 ;;
++ && { echo i486-ncr-sysv4; exit; } ;;
++ NCR*:*:4.2:* | MPRAS*:*:4.2:*)
++ OS_REL='.3'
++ test -r /etc/.relid \
++ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
++ /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
++ && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
++ /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
++ && { echo i586-ncr-sysv4.3${OS_REL}; exit; }
++ /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \
++ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
+ m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
+ echo m68k-unknown-lynxos${UNAME_RELEASE}
+- exit 0 ;;
++ exit ;;
+ mc68030:UNIX_System_V:4.*:*)
+ echo m68k-atari-sysv4
+- exit 0 ;;
++ exit ;;
+ TSUNAMI:LynxOS:2.*:*)
+ echo sparc-unknown-lynxos${UNAME_RELEASE}
+- exit 0 ;;
++ exit ;;
+ rs6000:LynxOS:2.*:*)
+ echo rs6000-unknown-lynxos${UNAME_RELEASE}
+- exit 0 ;;
++ exit ;;
+ PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*)
+ echo powerpc-unknown-lynxos${UNAME_RELEASE}
+- exit 0 ;;
++ exit ;;
+ SM[BE]S:UNIX_SV:*:*)
+ echo mips-dde-sysv${UNAME_RELEASE}
+- exit 0 ;;
++ exit ;;
+ RM*:ReliantUNIX-*:*:*)
+ echo mips-sni-sysv4
+- exit 0 ;;
++ exit ;;
+ RM*:SINIX-*:*:*)
+ echo mips-sni-sysv4
+- exit 0 ;;
++ exit ;;
+ *:SINIX-*:*:*)
+ if uname -p 2>/dev/null >/dev/null ; then
+ UNAME_MACHINE=`(uname -p) 2>/dev/null`
+@@ -1095,68 +1195,84 @@
+ else
+ echo ns32k-sni-sysv
+ fi
+- exit 0 ;;
++ exit ;;
+ PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
+ # says <Richard.M.Bartel@ccMail.Census.GOV>
+ echo i586-unisys-sysv4
+- exit 0 ;;
++ exit ;;
+ *:UNIX_System_V:4*:FTX*)
+ # From Gerald Hewes <hewes@openmarket.com>.
+ # How about differentiating between stratus architectures? -djm
+ echo hppa1.1-stratus-sysv4
+- exit 0 ;;
++ exit ;;
+ *:*:*:FTX*)
+ # From seanf@swdc.stratus.com.
+ echo i860-stratus-sysv4
+- exit 0 ;;
++ exit ;;
++ i*86:VOS:*:*)
++ # From Paul.Green@stratus.com.
++ echo ${UNAME_MACHINE}-stratus-vos
++ exit ;;
+ *:VOS:*:*)
+ # From Paul.Green@stratus.com.
+ echo hppa1.1-stratus-vos
+- exit 0 ;;
++ exit ;;
+ mc68*:A/UX:*:*)
+ echo m68k-apple-aux${UNAME_RELEASE}
+- exit 0 ;;
++ exit ;;
+ news*:NEWS-OS:6*:*)
+ echo mips-sony-newsos6
+- exit 0 ;;
++ exit ;;
+ R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
+ if [ -d /usr/nec ]; then
+ echo mips-nec-sysv${UNAME_RELEASE}
+ else
+ echo mips-unknown-sysv${UNAME_RELEASE}
+ fi
+- exit 0 ;;
++ exit ;;
+ BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only.
+ echo powerpc-be-beos
+- exit 0 ;;
++ exit ;;
+ BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only.
+ echo powerpc-apple-beos
+- exit 0 ;;
++ exit ;;
+ BePC:BeOS:*:*) # BeOS running on Intel PC compatible.
+ echo i586-pc-beos
+- exit 0 ;;
++ exit ;;
++ BePC:Haiku:*:*) # Haiku running on Intel PC compatible.
++ echo i586-pc-haiku
++ exit ;;
+ SX-4:SUPER-UX:*:*)
+ echo sx4-nec-superux${UNAME_RELEASE}
+- exit 0 ;;
++ exit ;;
+ SX-5:SUPER-UX:*:*)
+ echo sx5-nec-superux${UNAME_RELEASE}
+- exit 0 ;;
++ exit ;;
+ SX-6:SUPER-UX:*:*)
+ echo sx6-nec-superux${UNAME_RELEASE}
+- exit 0 ;;
++ exit ;;
++ SX-7:SUPER-UX:*:*)
++ echo sx7-nec-superux${UNAME_RELEASE}
++ exit ;;
++ SX-8:SUPER-UX:*:*)
++ echo sx8-nec-superux${UNAME_RELEASE}
++ exit ;;
++ SX-8R:SUPER-UX:*:*)
++ echo sx8r-nec-superux${UNAME_RELEASE}
++ exit ;;
+ Power*:Rhapsody:*:*)
+ echo powerpc-apple-rhapsody${UNAME_RELEASE}
+- exit 0 ;;
++ exit ;;
+ *:Rhapsody:*:*)
+ echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
+- exit 0 ;;
++ exit ;;
+ *:Darwin:*:*)
+- case `uname -p` in
+- *86) UNAME_PROCESSOR=i686 ;;
+- powerpc) UNAME_PROCESSOR=powerpc ;;
++ UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
++ case $UNAME_PROCESSOR in
++ unknown) UNAME_PROCESSOR=powerpc ;;
+ esac
+ echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
+- exit 0 ;;
++ exit ;;
+ *:procnto*:*:* | *:QNX:[0123456789]*:*)
+ UNAME_PROCESSOR=`uname -p`
+ if test "$UNAME_PROCESSOR" = "x86"; then
+@@ -1164,22 +1280,25 @@
+ UNAME_MACHINE=pc
+ fi
+ echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE}
+- exit 0 ;;
++ exit ;;
+ *:QNX:*:4*)
+ echo i386-pc-qnx
+- exit 0 ;;
+- NSR-[DGKLNPTVW]:NONSTOP_KERNEL:*:*)
++ exit ;;
++ NSE-?:NONSTOP_KERNEL:*:*)
++ echo nse-tandem-nsk${UNAME_RELEASE}
++ exit ;;
++ NSR-?:NONSTOP_KERNEL:*:*)
+ echo nsr-tandem-nsk${UNAME_RELEASE}
+- exit 0 ;;
++ exit ;;
+ *:NonStop-UX:*:*)
+ echo mips-compaq-nonstopux
+- exit 0 ;;
++ exit ;;
+ BS2000:POSIX*:*:*)
+ echo bs2000-siemens-sysv
+- exit 0 ;;
++ exit ;;
+ DS/*:UNIX_System_V:*:*)
+ echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE}
+- exit 0 ;;
++ exit ;;
+ *:Plan9:*:*)
+ # "uname -m" is not consistent, so use $cputype instead. 386
+ # is converted to i386 for consistency with other x86
+@@ -1190,28 +1309,47 @@
+ UNAME_MACHINE="$cputype"
+ fi
+ echo ${UNAME_MACHINE}-unknown-plan9
+- exit 0 ;;
++ exit ;;
+ *:TOPS-10:*:*)
+ echo pdp10-unknown-tops10
+- exit 0 ;;
++ exit ;;
+ *:TENEX:*:*)
+ echo pdp10-unknown-tenex
+- exit 0 ;;
++ exit ;;
+ KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*)
+ echo pdp10-dec-tops20
+- exit 0 ;;
++ exit ;;
+ XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*)
+ echo pdp10-xkl-tops20
+- exit 0 ;;
++ exit ;;
+ *:TOPS-20:*:*)
+ echo pdp10-unknown-tops20
+- exit 0 ;;
++ exit ;;
+ *:ITS:*:*)
+ echo pdp10-unknown-its
+- exit 0 ;;
++ exit ;;
+ SEI:*:*:SEIUX)
+ echo mips-sei-seiux${UNAME_RELEASE}
+- exit 0 ;;
++ exit ;;
++ *:DragonFly:*:*)
++ echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
++ exit ;;
++ *:*VMS:*:*)
++ UNAME_MACHINE=`(uname -p) 2>/dev/null`
++ case "${UNAME_MACHINE}" in
++ A*) echo alpha-dec-vms ; exit ;;
++ I*) echo ia64-dec-vms ; exit ;;
++ V*) echo vax-dec-vms ; exit ;;
++ esac ;;
++ *:XENIX:*:SysV)
++ echo i386-pc-xenix
++ exit ;;
++ i*86:skyos:*:*)
++ echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//'
++ exit ;;
++ i*86:rdos:*:*)
++ echo ${UNAME_MACHINE}-pc-rdos
++ exit ;;
+ esac
+
+ #echo '(No uname command or uname output not recognized.)' 1>&2
+@@ -1243,7 +1381,7 @@
+ #endif
+
+ #if defined (__arm) && defined (__acorn) && defined (__unix)
+- printf ("arm-acorn-riscix"); exit (0);
++ printf ("arm-acorn-riscix\n"); exit (0);
+ #endif
+
+ #if defined (hp300) && !defined (hpux)
+@@ -1332,11 +1470,12 @@
+ }
+ EOF
+
+-$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && $dummy && exit 0
++$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` &&
++ { echo "$SYSTEM_NAME"; exit; }
+
+ # Apollos put the system type in the environment.
+
+-test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit 0; }
++test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; }
+
+ # Convex versions that predate uname can use getsysinfo(1)
+
+@@ -1345,22 +1484,22 @@
+ case `getsysinfo -f cpu_type` in
+ c1*)
+ echo c1-convex-bsd
+- exit 0 ;;
++ exit ;;
+ c2*)
+ if getsysinfo -f scalar_acc
+ then echo c32-convex-bsd
+ else echo c2-convex-bsd
+ fi
+- exit 0 ;;
++ exit ;;
+ c34*)
+ echo c34-convex-bsd
+- exit 0 ;;
++ exit ;;
+ c38*)
+ echo c38-convex-bsd
+- exit 0 ;;
++ exit ;;
+ c4*)
+ echo c4-convex-bsd
+- exit 0 ;;
++ exit ;;
+ esac
+ fi
+
+@@ -1371,7 +1510,9 @@
+ the operating system you are using. It is advised that you
+ download the most up to date version of the config scripts from
+
+- ftp://ftp.gnu.org/pub/gnu/config/
++ http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
++and
++ http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD
+
+ If the version you run ($0) is already up to date, please
+ send the following data and any information you think might be
+diff -Naur pvs4.2-orig/config.sub pvs4.2-sbcl/config.sub
+--- pvs4.2-orig/config.sub 2007-07-02 20:07:43.000000000 +0000
++++ pvs4.2-sbcl/config.sub 2009-03-24 18:56:17.000000000 +0000
+@@ -1,9 +1,10 @@
+ #! /bin/sh
+ # Configuration validation subroutine script.
+ # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
+-# 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
++# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
++# Free Software Foundation, Inc.
+
+-timestamp='2003-06-18'
++timestamp='2009-01-19'
+
+ # This file is (in principle) common to ALL GNU software.
+ # The presence of a machine in this file suggests that SOME GNU software
+@@ -21,14 +22,15 @@
+ #
+ # 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.
+-
++# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
++# 02110-1301, USA.
++#
+ # As a special exception to the GNU General Public License, if you
+ # distribute this file as part of a program that contains a
+ # configuration script generated by Autoconf, you may include it under
+ # the same distribution terms that you use for the rest of that program.
+
++
+ # Please send patches to <config-patches@gnu.org>. Submit a context
+ # diff and a properly formatted ChangeLog entry.
+ #
+@@ -70,8 +72,8 @@
+ version="\
+ GNU config.sub ($timestamp)
+
+-Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
+-Free Software Foundation, Inc.
++Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
++2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+
+ This is free software; see the source for copying conditions. There is NO
+ warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
+@@ -83,11 +85,11 @@
+ while test $# -gt 0 ; do
+ case $1 in
+ --time-stamp | --time* | -t )
+- echo "$timestamp" ; exit 0 ;;
++ echo "$timestamp" ; exit ;;
+ --version | -v )
+- echo "$version" ; exit 0 ;;
++ echo "$version" ; exit ;;
+ --help | --h* | -h )
+- echo "$usage"; exit 0 ;;
++ echo "$usage"; exit ;;
+ -- ) # Stop option processing
+ shift; break ;;
+ - ) # Use stdin as input.
+@@ -99,7 +101,7 @@
+ *local*)
+ # First pass through any local machine types.
+ echo $1
+- exit 0;;
++ exit ;;
+
+ * )
+ break ;;
+@@ -118,7 +120,10 @@
+ # Here we must recognize all the valid KERNEL-OS combinations.
+ maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
+ case $maybe_os in
+- nto-qnx* | linux-gnu* | freebsd*-gnu* | netbsd*-gnu* | storm-chaos* | os2-emx* | rtmk-nova*)
++ nto-qnx* | linux-gnu* | linux-dietlibc | linux-newlib* | linux-uclibc* | \
++ uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \
++ kopensolaris*-gnu* | \
++ storm-chaos* | os2-emx* | rtmk-nova*)
+ os=-$maybe_os
+ basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
+ ;;
+@@ -144,7 +149,7 @@
+ -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
+ -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
+ -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
+- -apple | -axis)
++ -apple | -axis | -knuth | -cray)
+ os=
+ basic_machine=$1
+ ;;
+@@ -169,6 +174,10 @@
+ -hiux*)
+ os=-hiuxwe2
+ ;;
++ -sco6)
++ os=-sco5v6
++ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
++ ;;
+ -sco5)
+ os=-sco3.2v5
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+@@ -185,6 +194,10 @@
+ # Don't forget version if it is 3.2v4 or newer.
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
++ -sco5v6*)
++ # Don't forget version if it is 3.2v4 or newer.
++ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
++ ;;
+ -sco*)
+ os=-sco3.2v2
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+@@ -228,45 +241,56 @@
+ | a29k \
+ | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
+ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
+- | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr \
++ | am33_2.0 \
++ | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \
++ | bfin \
+ | c4x | clipper \
+ | d10v | d30v | dlx | dsp16xx \
+- | fr30 | frv \
++ | fido | fr30 | frv \
+ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
+ | i370 | i860 | i960 | ia64 \
+- | ip2k \
+- | m32r | m68000 | m68k | m88k | mcore \
++ | ip2k | iq2000 \
++ | lm32 \
++ | m32c | m32r | m32rle | m68000 | m68k | m88k \
++ | maxq | mb | microblaze | mcore | mep | metag \
+ | mips | mipsbe | mipseb | mipsel | mipsle \
+ | mips16 \
+ | mips64 | mips64el \
+- | mips64vr | mips64vrel \
++ | mips64octeon | mips64octeonel \
+ | mips64orion | mips64orionel \
++ | mips64r5900 | mips64r5900el \
++ | mips64vr | mips64vrel \
+ | mips64vr4100 | mips64vr4100el \
+ | mips64vr4300 | mips64vr4300el \
+ | mips64vr5000 | mips64vr5000el \
++ | mips64vr5900 | mips64vr5900el \
+ | mipsisa32 | mipsisa32el \
+ | mipsisa32r2 | mipsisa32r2el \
+ | mipsisa64 | mipsisa64el \
++ | mipsisa64r2 | mipsisa64r2el \
+ | mipsisa64sb1 | mipsisa64sb1el \
+ | mipsisa64sr71k | mipsisa64sr71kel \
+ | mipstx39 | mipstx39el \
+ | mn10200 | mn10300 \
++ | mt \
+ | msp430 \
++ | nios | nios2 \
+ | ns16k | ns32k \
+- | openrisc | or32 \
++ | or32 \
+ | pdp10 | pdp11 | pj | pjl \
+ | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \
+ | pyramid \
+- | s390 | s390x \
+- | sh | sh[1234] | sh[23]e | sh[34]eb | shbe | shle | sh[1234]le | sh3ele \
++ | score \
++ | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
+ | sh64 | sh64le \
+- | sparc | sparc64 | sparc86x | sparclet | sparclite | sparcv8 | sparcv9 | sparcv9b \
+- | strongarm \
++ | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \
++ | sparcv8 | sparcv9 | sparcv9b | sparcv9v \
++ | spu | strongarm \
+ | tahoe | thumb | tic4x | tic80 | tron \
+ | v850 | v850e \
+ | we32k \
+- | x86 | xscale | xstormy16 | xtensa \
+- | z8k)
++ | x86 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \
++ | z8k | z80)
+ basic_machine=$basic_machine-unknown
+ ;;
+ m6811 | m68hc11 | m6812 | m68hc12)
+@@ -276,6 +300,9 @@
+ ;;
+ m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k)
+ ;;
++ ms1)
++ basic_machine=mt-unknown
++ ;;
+
+ # We use `pc' rather than `unknown'
+ # because (1) that's what they normally are, and
+@@ -295,55 +322,67 @@
+ | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
+ | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \
+ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \
+- | avr-* \
+- | bs2000-* \
++ | avr-* | avr32-* \
++ | bfin-* | bs2000-* \
+ | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \
+- | clipper-* | cydra-* \
++ | clipper-* | craynv-* | cydra-* \
+ | d10v-* | d30v-* | dlx-* \
+ | elxsi-* \
+- | f30[01]-* | f700-* | fr30-* | frv-* | fx80-* \
++ | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \
+ | h8300-* | h8500-* \
+ | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
+ | i*86-* | i860-* | i960-* | ia64-* \
+- | ip2k-* \
+- | m32r-* \
++ | ip2k-* | iq2000-* \
++ | lm32-* \
++ | m32c-* | m32r-* | m32rle-* \
+ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
+- | m88110-* | m88k-* | mcore-* \
++ | m88110-* | m88k-* | maxq-* | mcore-* | metag-* \
+ | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
+ | mips16-* \
+ | mips64-* | mips64el-* \
+- | mips64vr-* | mips64vrel-* \
++ | mips64octeon-* | mips64octeonel-* \
+ | mips64orion-* | mips64orionel-* \
++ | mips64r5900-* | mips64r5900el-* \
++ | mips64vr-* | mips64vrel-* \
+ | mips64vr4100-* | mips64vr4100el-* \
+ | mips64vr4300-* | mips64vr4300el-* \
+ | mips64vr5000-* | mips64vr5000el-* \
++ | mips64vr5900-* | mips64vr5900el-* \
+ | mipsisa32-* | mipsisa32el-* \
+ | mipsisa32r2-* | mipsisa32r2el-* \
+ | mipsisa64-* | mipsisa64el-* \
++ | mipsisa64r2-* | mipsisa64r2el-* \
+ | mipsisa64sb1-* | mipsisa64sb1el-* \
+ | mipsisa64sr71k-* | mipsisa64sr71kel-* \
+ | mipstx39-* | mipstx39el-* \
++ | mmix-* \
++ | mt-* \
+ | msp430-* \
+- | none-* | np1-* | nv1-* | ns16k-* | ns32k-* \
++ | nios-* | nios2-* \
++ | none-* | np1-* | ns16k-* | ns32k-* \
+ | orion-* \
+ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
+ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \
+ | pyramid-* \
+ | romp-* | rs6000-* \
+- | s390-* | s390x-* \
+- | sh-* | sh[1234]-* | sh[23]e-* | sh[34]eb-* | shbe-* \
++ | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
+ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
+- | sparc-* | sparc64-* | sparc86x-* | sparclet-* | sparclite-* \
+- | sparcv8-* | sparcv9-* | sparcv9b-* | strongarm-* | sv1-* | sx?-* \
++ | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \
++ | sparclite-* \
++ | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \
+ | tahoe-* | thumb-* \
+- | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
++ | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* | tile-* \
+ | tron-* \
+ | v850-* | v850e-* | vax-* \
+ | we32k-* \
+- | x86-* | x86_64-* | xps100-* | xscale-* | xstormy16-* \
+- | xtensa-* \
++ | x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \
++ | xstormy16-* | xtensa*-* \
+ | ymp-* \
+- | z8k-*)
++ | z8k-* | z80-*)
++ ;;
++ # Recognize the basic CPU types without company name, with glob match.
++ xtensa*)
++ basic_machine=$basic_machine-unknown
+ ;;
+ # Recognize the various machine names and aliases which stand
+ # for a CPU type and a company and sometimes even an OS.
+@@ -361,6 +400,9 @@
+ basic_machine=a29k-amd
+ os=-udi
+ ;;
++ abacus)
++ basic_machine=abacus-unknown
++ ;;
+ adobe68k)
+ basic_machine=m68010-adobe
+ os=-scout
+@@ -378,6 +420,9 @@
+ amd64)
+ basic_machine=x86_64-pc
+ ;;
++ amd64-*)
++ basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'`
++ ;;
+ amdahl)
+ basic_machine=580-amdahl
+ os=-sysv
+@@ -409,10 +454,22 @@
+ basic_machine=ns32k-sequent
+ os=-dynix
+ ;;
++ blackfin)
++ basic_machine=bfin-unknown
++ os=-linux
++ ;;
++ blackfin-*)
++ basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'`
++ os=-linux
++ ;;
+ c90)
+ basic_machine=c90-cray
+ os=-unicos
+ ;;
++ cegcc)
++ basic_machine=arm-unknown
++ os=-cegcc
++ ;;
+ convex-c1)
+ basic_machine=c1-convex
+ os=-bsd
+@@ -437,12 +494,27 @@
+ basic_machine=j90-cray
+ os=-unicos
+ ;;
++ craynv)
++ basic_machine=craynv-cray
++ os=-unicosmp
++ ;;
++ cr16)
++ basic_machine=cr16-unknown
++ os=-elf
++ ;;
+ crds | unos)
+ basic_machine=m68k-crds
+ ;;
++ crisv32 | crisv32-* | etraxfs*)
++ basic_machine=crisv32-axis
++ ;;
+ cris | cris-* | etrax*)
+ basic_machine=cris-axis
+ ;;
++ crx)
++ basic_machine=crx-unknown
++ os=-elf
++ ;;
+ da30 | da30-*)
+ basic_machine=m68k-da30
+ ;;
+@@ -465,6 +537,14 @@
+ basic_machine=m88k-motorola
+ os=-sysv3
+ ;;
++ dicos)
++ basic_machine=i686-pc
++ os=-dicos
++ ;;
++ djgpp)
++ basic_machine=i586-pc
++ os=-msdosdjgpp
++ ;;
+ dpx20 | dpx20-*)
+ basic_machine=rs6000-bull
+ os=-bosx
+@@ -615,6 +695,14 @@
+ basic_machine=m68k-isi
+ os=-sysv
+ ;;
++ m68knommu)
++ basic_machine=m68k-unknown
++ os=-linux
++ ;;
++ m68knommu-*)
++ basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'`
++ os=-linux
++ ;;
+ m88k-omron*)
+ basic_machine=m88k-omron
+ ;;
+@@ -630,6 +718,10 @@
+ basic_machine=i386-pc
+ os=-mingw32
+ ;;
++ mingw32ce)
++ basic_machine=arm-unknown
++ os=-mingw32ce
++ ;;
+ miniframe)
+ basic_machine=m68000-convergent
+ ;;
+@@ -643,10 +735,6 @@
+ mips3*)
+ basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown
+ ;;
+- mmix*)
+- basic_machine=mmix-knuth
+- os=-mmixware
+- ;;
+ monitor)
+ basic_machine=m68k-rom68k
+ os=-coff
+@@ -659,6 +747,9 @@
+ basic_machine=i386-pc
+ os=-msdos
+ ;;
++ ms1-*)
++ basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'`
++ ;;
+ mvs)
+ basic_machine=i370-ibm
+ os=-mvs
+@@ -727,10 +818,6 @@
+ np1)
+ basic_machine=np1-gould
+ ;;
+- nv1)
+- basic_machine=nv1-cray
+- os=-unicosmp
+- ;;
+ nsr-tandem)
+ basic_machine=nsr-tandem
+ ;;
+@@ -738,9 +825,12 @@
+ basic_machine=hppa1.1-oki
+ os=-proelf
+ ;;
+- or32 | or32-*)
++ openrisc | openrisc-*)
+ basic_machine=or32-unknown
+- os=-coff
++ ;;
++ os400)
++ basic_machine=powerpc-ibm
++ os=-os400
+ ;;
+ OSE68000 | ose68000)
+ basic_machine=m68000-ericsson
+@@ -758,6 +848,14 @@
+ basic_machine=i860-intel
+ os=-osf
+ ;;
++ parisc)
++ basic_machine=hppa-unknown
++ os=-linux
++ ;;
++ parisc-*)
++ basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'`
++ os=-linux
++ ;;
+ pbd)
+ basic_machine=sparc-tti
+ ;;
+@@ -767,6 +865,12 @@
+ pc532 | pc532-*)
+ basic_machine=ns32k-pc532
+ ;;
++ pc98)
++ basic_machine=i386-pc
++ ;;
++ pc98-*)
++ basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'`
++ ;;
+ pentium | p5 | k5 | k6 | nexgen | viac3)
+ basic_machine=i586-pc
+ ;;
+@@ -823,6 +927,10 @@
+ basic_machine=i586-unknown
+ os=-pw32
+ ;;
++ rdos)
++ basic_machine=i386-pc
++ os=-rdos
++ ;;
+ rom68k)
+ basic_machine=m68k-rom68k
+ os=-coff
+@@ -833,6 +941,12 @@
+ rtpc | rtpc-*)
+ basic_machine=romp-ibm
+ ;;
++ s390 | s390-*)
++ basic_machine=s390-ibm
++ ;;
++ s390x | s390x-*)
++ basic_machine=s390x-ibm
++ ;;
+ sa29200)
+ basic_machine=a29k-amd
+ os=-udi
+@@ -843,6 +957,10 @@
+ sb1el)
+ basic_machine=mipsisa64sb1el-unknown
+ ;;
++ sde)
++ basic_machine=mipsisa32-sde
++ os=-elf
++ ;;
+ sei)
+ basic_machine=mips-sei
+ os=-seiux
+@@ -854,6 +972,9 @@
+ basic_machine=sh-hitachi
+ os=-hms
+ ;;
++ sh5el)
++ basic_machine=sh5le-unknown
++ ;;
+ sh64)
+ basic_machine=sh64-unknown
+ ;;
+@@ -943,6 +1064,10 @@
+ basic_machine=tic6x-unknown
+ os=-coff
+ ;;
++ tile*)
++ basic_machine=tile-unknown
++ os=-linux-gnu
++ ;;
+ tx39)
+ basic_machine=mipstx39-unknown
+ ;;
+@@ -956,6 +1081,10 @@
+ tower | tower-32)
+ basic_machine=m68k-ncr
+ ;;
++ tpf)
++ basic_machine=s390x-ibm
++ os=-tpf
++ ;;
+ udi29k)
+ basic_machine=a29k-amd
+ os=-udi
+@@ -999,6 +1128,10 @@
+ basic_machine=hppa1.1-winbond
+ os=-proelf
+ ;;
++ xbox)
++ basic_machine=i686-pc
++ os=-mingw32
++ ;;
+ xps | xps100)
+ basic_machine=xps100-honeywell
+ ;;
+@@ -1010,6 +1143,10 @@
+ basic_machine=z8k-unknown
+ os=-sim
+ ;;
++ z80-*-coff)
++ basic_machine=z80-unknown
++ os=-sim
++ ;;
+ none)
+ basic_machine=none-none
+ os=-none
+@@ -1029,6 +1166,9 @@
+ romp)
+ basic_machine=romp-ibm
+ ;;
++ mmix)
++ basic_machine=mmix-knuth
++ ;;
+ rs6000)
+ basic_machine=rs6000-ibm
+ ;;
+@@ -1045,13 +1185,10 @@
+ we32k)
+ basic_machine=we32k-att
+ ;;
+- sh3 | sh4 | sh[34]eb | sh[1234]le | sh[23]ele)
++ sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele)
+ basic_machine=sh-unknown
+ ;;
+- sh64)
+- basic_machine=sh64-unknown
+- ;;
+- sparc | sparcv8 | sparcv9 | sparcv9b)
++ sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v)
+ basic_machine=sparc-sun
+ ;;
+ cydra)
+@@ -1120,23 +1257,28 @@
+ -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
+ | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\
+ | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \
++ | -kopensolaris* \
+ | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
+ | -aos* \
+ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
+ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
+- | -hiux* | -386bsd* | -netbsd* | -openbsd* | -freebsd* | -riscix* \
+- | -lynxos* | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
++ | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
++ | -openbsd* | -solidbsd* \
++ | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \
++ | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
+ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
+ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
+- | -chorusos* | -chorusrdb* \
++ | -chorusos* | -chorusrdb* | -cegcc* \
+ | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
+- | -mingw32* | -linux-gnu* | -uxpv* | -beos* | -mpeix* | -udk* \
++ | -mingw32* | -linux-gnu* | -linux-newlib* | -linux-uclibc* \
++ | -uxpv* | -beos* | -mpeix* | -udk* \
+ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
+ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
+ | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
+ | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
+ | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
+- | -powermax* | -dnix* | -nx6 | -nx7 | -sei*)
++ | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
++ | -skyos* | -haiku* | -rdos* | -toppers* | -drops*)
+ # Remember, each alternative MUST END IN *, to match a version number.
+ ;;
+ -qnx*)
+@@ -1154,12 +1296,15 @@
+ os=`echo $os | sed -e 's|nto|nto-qnx|'`
+ ;;
+ -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \
+- | -windows* | -osx | -abug | -netware* | -os9* | -beos* \
++ | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \
+ | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*)
+ ;;
+ -mac*)
+ os=`echo $os | sed -e 's|mac|macos|'`
+ ;;
++ -linux-dietlibc)
++ os=-linux-dietlibc
++ ;;
+ -linux*)
+ os=`echo $os | sed -e 's|linux|linux-gnu|'`
+ ;;
+@@ -1172,6 +1317,9 @@
+ -opened*)
+ os=-openedition
+ ;;
++ -os400*)
++ os=-os400
++ ;;
+ -wince*)
+ os=-wince
+ ;;
+@@ -1193,6 +1341,9 @@
+ -atheos*)
+ os=-atheos
+ ;;
++ -syllable*)
++ os=-syllable
++ ;;
+ -386bsd)
+ os=-bsd
+ ;;
+@@ -1215,6 +1366,9 @@
+ -sinix*)
+ os=-sysv4
+ ;;
++ -tpf*)
++ os=-tpf
++ ;;
+ -triton*)
+ os=-sysv3
+ ;;
+@@ -1251,6 +1405,12 @@
+ -kaos*)
+ os=-kaos
+ ;;
++ -zvmoe)
++ os=-zvmoe
++ ;;
++ -dicos*)
++ os=-dicos
++ ;;
+ -none)
+ ;;
+ *)
+@@ -1273,6 +1433,12 @@
+ # system, and we'll never get to this point.
+
+ case $basic_machine in
++ score-*)
++ os=-elf
++ ;;
++ spu-*)
++ os=-elf
++ ;;
+ *-acorn)
+ os=-riscix1.2
+ ;;
+@@ -1282,8 +1448,8 @@
+ arm*-semi)
+ os=-aout
+ ;;
+- c4x-* | tic4x-*)
+- os=-coff
++ c4x-* | tic4x-*)
++ os=-coff
+ ;;
+ # This must come before the *-dec entry.
+ pdp10-*)
+@@ -1310,6 +1476,9 @@
+ m68*-cisco)
+ os=-aout
+ ;;
++ mep-*)
++ os=-elf
++ ;;
+ mips*-cisco)
+ os=-elf
+ ;;
+@@ -1328,9 +1497,15 @@
+ *-be)
+ os=-beos
+ ;;
++ *-haiku)
++ os=-haiku
++ ;;
+ *-ibm)
+ os=-aix
+ ;;
++ *-knuth)
++ os=-mmixware
++ ;;
+ *-wec)
+ os=-proelf
+ ;;
+@@ -1463,9 +1638,15 @@
+ -mvs* | -opened*)
+ vendor=ibm
+ ;;
++ -os400*)
++ vendor=ibm
++ ;;
+ -ptx*)
+ vendor=sequent
+ ;;
++ -tpf*)
++ vendor=ibm
++ ;;
+ -vxsim* | -vxworks* | -windiss*)
+ vendor=wrs
+ ;;
+@@ -1490,7 +1671,7 @@
+ esac
+
+ echo $basic_machine$os
+-exit 0
++exit
+
+ # Local variables:
+ # eval: (add-hook 'write-file-hooks 'time-stamp)
+diff -Naur pvs4.2-orig/doc/language/language.tex pvs4.2-sbcl/doc/language/language.tex
+--- pvs4.2-orig/doc/language/language.tex 2007-07-02 20:07:42.000000000 +0000
++++ pvs4.2-sbcl/doc/language/language.tex 2009-03-24 18:56:17.000000000 +0000
+@@ -6,7 +6,7 @@
+ \usepackage{makeidx}
+ \usepackage{relsize}
+ \usepackage{boxedminipage}
+-\usepackage{fancyheadings}
++\usepackage{fancyhdr}
+ %\usepackage{../../pvs}
+ \usepackage{url}
+ \usepackage{../makebnf}
+diff -Naur pvs4.2-orig/doc/prover/prover.tex pvs4.2-sbcl/doc/prover/prover.tex
+--- pvs4.2-orig/doc/prover/prover.tex 2007-07-02 20:07:42.000000000 +0000
++++ pvs4.2-sbcl/doc/prover/prover.tex 2009-03-24 18:56:17.000000000 +0000
+@@ -1,7 +1,7 @@
+ % Document Type: LaTeX
+ % Master File: prover.tex
+ \documentclass[12pt,twoside]{book}
+-\usepackage{relsize,alltt,makeidx,url,boxedminipage,fancyheadings,tabularx}
++\usepackage{relsize,alltt,makeidx,url,boxedminipage,fancyhdr,tabularx}
+ %\usepackage{../../pvs}
+ \usepackage{../makebnf}
+ \usepackage[chapter]{tocbibind}
+diff -Naur pvs4.2-orig/doc/user-guide/user-guide.tex pvs4.2-sbcl/doc/user-guide/user-guide.tex
+--- pvs4.2-orig/doc/user-guide/user-guide.tex 2007-07-02 20:07:42.000000000 +0000
++++ pvs4.2-sbcl/doc/user-guide/user-guide.tex 2009-03-24 18:56:17.000000000 +0000
+@@ -7,7 +7,7 @@
+ %\usepackage{showidx} % use for index debugging
+ \usepackage{relsize}
+ \usepackage{boxedminipage}
+-\usepackage{fancyheadings}
++\usepackage{fancyhdr}
+ \usepackage{graphicx}
+ \usepackage{../../pvs}
+ \usepackage{url}
+diff -Naur pvs4.2-orig/emacs/emacs-src/ilisp/completer.el pvs4.2-sbcl/emacs/emacs-src/ilisp/completer.el
+--- pvs4.2-orig/emacs/emacs-src/ilisp/completer.el 2007-07-02 20:07:40.000000000 +0000
++++ pvs4.2-sbcl/emacs/emacs-src/ilisp/completer.el 2009-03-24 18:56:17.000000000 +0000
+@@ -181,8 +181,8 @@
+ (not (memq +ilisp-emacs-version-id+
+ '(xemacs lucid-19 lucid-19-new)))
+ )
+- (setq quit-flag nil
+- unread-command-char 7))))
++ (setq quit-flag nil)
++ (push 7 unread-command-events))))
+
+ ;;;
+ (defun completer-deleter (regexp choices &optional keep)
+diff -Naur pvs4.2-orig/emacs/emacs-src/ilisp/ilisp-acl.el pvs4.2-sbcl/emacs/emacs-src/ilisp/ilisp-acl.el
+--- pvs4.2-orig/emacs/emacs-src/ilisp/ilisp-acl.el 2007-07-02 20:07:40.000000000 +0000
++++ pvs4.2-sbcl/emacs/emacs-src/ilisp/ilisp-acl.el 2009-03-24 18:56:17.000000000 +0000
+@@ -22,10 +22,10 @@
+ (defun allegro-check-prompt (old new)
+ "Compare the break level printed at the beginning of the prompt."
+ (let* ((old-level (if (and old (eq 1 (string-match "[0-9]+" old)))
+- (string-to-int (substring old 1))
++ (string-to-number (substring old 1))
+ 0))
+ (new-level (if (eq 1 (string-match "[0-9]+" new))
+- (string-to-int (substring new 1))
++ (string-to-number (substring new 1))
+ 0)))
+ (<= new-level old-level)))
+
+diff -Naur pvs4.2-orig/emacs/emacs-src/ilisp/ilisp-chs.el pvs4.2-sbcl/emacs/emacs-src/ilisp/ilisp-chs.el
+--- pvs4.2-orig/emacs/emacs-src/ilisp/ilisp-chs.el 2007-07-02 20:07:40.000000000 +0000
++++ pvs4.2-sbcl/emacs/emacs-src/ilisp/ilisp-chs.el 2009-03-24 18:56:17.000000000 +0000
+@@ -40,7 +40,7 @@
+ (string-match "Break" old)
+ (string-match "[0-9]+" old)))
+ (old-level (if was-in
+- (string-to-int
++ (string-to-number
+ (substring old (match-beginning 0)
+ (match-end 0)))
+ 0))
+@@ -48,7 +48,7 @@
+ (string-match "Break" new)
+ (string-match "[0-9]+" new)))
+ (new-level (if is-in
+- (string-to-int
++ (string-to-number
+ (substring new (match-beginning 0)
+ (match-end 0)))
+ 0)))
+diff -Naur pvs4.2-orig/emacs/emacs-src/ilisp/ilisp-def.el pvs4.2-sbcl/emacs/emacs-src/ilisp/ilisp-def.el
+--- pvs4.2-orig/emacs/emacs-src/ilisp/ilisp-def.el 2007-07-02 20:07:40.000000000 +0000
++++ pvs4.2-sbcl/emacs/emacs-src/ilisp/ilisp-def.el 2009-03-24 18:56:17.000000000 +0000
+@@ -43,8 +43,8 @@
+ ;;;
+ (defmacro deflocal (variable default &optional documentation)
+ "Define an ilisp local variable."
+- (` (progn (lisp-deflocal '(, variable))
+- (defvar (, variable) (, default) (, documentation)))))
++ `(progn (lisp-deflocal ',variable)
++ (defvar ,variable ,default ,documentation)))
+
+ ;;;%%Simple customization
+
+diff -Naur pvs4.2-orig/emacs/emacs-src/ilisp/ilisp-dia.el pvs4.2-sbcl/emacs/emacs-src/ilisp/ilisp-dia.el
+--- pvs4.2-orig/emacs/emacs-src/ilisp/ilisp-dia.el 2007-07-02 20:07:40.000000000 +0000
++++ pvs4.2-sbcl/emacs/emacs-src/ilisp/ilisp-dia.el 2009-03-24 18:56:17.000000000 +0000
+@@ -120,27 +120,26 @@
+ (hook (read (format "%s-hook" dialect)))
+ (program (read (format "%s-program" dialect)))
+ (dialects (format "%s" dialect)))
+- (`
+- (progn
+- (defvar (, hook) nil (, (format "*Inferior %s hook." full-name)))
+- (defvar (, program) nil
+- (, (format "*Inferior %s default program." full-name)))
+- (defun (, setup) (buffer)
+- (, (format "Set up for interacting with %s." full-name))
+- (, (read (format "(setup-%s buffer)" parent)))
+- (,@ body)
+- (setq ilisp-program (or (, program) ilisp-program)
+- ilisp-dialect (cons '(, dialect) ilisp-dialect))
+- (run-hooks '(, (read (format "%s-hook" dialect)))))
+- (defun (, dialect) (&optional buffer program)
+- (, (format "Create an inferior %s. With prefix, prompt for buffer and program."
+- full-name))
++ `(progn
++ (defvar ,hook nil ,(format "*Inferior %s hook." full-name))
++ (defvar ,program nil
++ ,(format "*Inferior %s default program." full-name))
++ (defun ,setup (buffer)
++ ,(format "Set up for interacting with %s." full-name)
++ ,(read (format "(setup-%s buffer)" parent))
++ ,@body
++ (setq ilisp-program (or ,program ilisp-program)
++ ilisp-dialect (cons ',dialect ilisp-dialect))
++ (run-hooks ',(read (format "%s-hook" dialect))))
++ (defun ,dialect (&optional buffer program)
++ ,(format "Create an inferior %s. With prefix, prompt for buffer and program."
++ full-name)
+ (interactive (list nil nil))
+- (ilisp-start-dialect (or buffer (, dialects))
+- program
+- '(, setup))
+- (setq (, program) ilisp-program))
+- (lisp-add-dialect (, dialects))))))
++ (ilisp-start-dialect (or buffer ,dialects)
++ program
++ ',setup)
++ (setq ,program ilisp-program))
++ (lisp-add-dialect ,dialects))))
+
+ ;;;%%ilisp
+ (defun setup-ilisp (buffer)
+diff -Naur pvs4.2-orig/emacs/emacs-src/ilisp/ilisp-snd.el pvs4.2-sbcl/emacs/emacs-src/ilisp/ilisp-snd.el
+--- pvs4.2-orig/emacs/emacs-src/ilisp/ilisp-snd.el 2007-07-02 20:07:40.000000000 +0000
++++ pvs4.2-sbcl/emacs/emacs-src/ilisp/ilisp-snd.el 2009-03-24 18:56:17.000000000 +0000
+@@ -409,16 +409,16 @@
+ (comint-send
+ (ilisp-process) binary
+ t nil 'binary nil
+- (` (lambda (error wait message output last)
++ `(lambda (error wait message output last)
+ (if (or error
+ (not (string-match "\"[^\"]*\"" output)))
+ (progn
+ (lisp-display-output output)
+ (abort-commands-lisp "No binary"))
+- (setq (, var)
++ (setq ,var
+ (substring output
+ (1+ (match-beginning 0))
+- (1- (match-end 0))))))))))))
++ (1- (match-end 0)))))))))))
+
+ ;;;
+ (defun ilisp-done-init ()
+diff -Naur pvs4.2-orig/emacs/emacs-src/pvs-cmds.el pvs4.2-sbcl/emacs/emacs-src/pvs-cmds.el
+--- pvs4.2-orig/emacs/emacs-src/pvs-cmds.el 2008-02-20 10:35:41.000000000 +0000
++++ pvs4.2-sbcl/emacs/emacs-src/pvs-cmds.el 2009-03-24 18:56:17.000000000 +0000
+@@ -478,7 +478,7 @@
+ (goto-char (point-min))
+ (pop-to-buffer pbuf)
+ (pvs-mode))
+- (error "%s is not in the prelude."))))))
++ (error "%s is not in the prelude." fname))))))
+
+ (defun get-prelude-file-and-region (theoryname)
+ (let ((freg nil)
+@@ -768,7 +768,7 @@
+ "Name of root file (CR for this one): ")
+ (list (y-or-n-p "Include libraries? "))
+ (list (read-from-minibuffer
+- (format "Mail to: " pvs-last-email-address)
++ (format "Mail to: ")
+ pvs-last-email-address))
+ (list (read-string "CC: "))
+ (list (read-string "Subject: "))))
+@@ -787,9 +787,9 @@
+ (let* ((lkeymap (copy-keymap (current-local-map)))
+ (file-string (pvs-dump-files-string pvs-file libraries-p)))
+ (define-key lkeymap "\C-c\C-c"
+- (` (lambda ()
+- (interactive)
+- (pvs-mail-send-and-exit (, to) (, subject) (, file-string)))))
++ `(lambda ()
++ (interactive)
++ (pvs-mail-send-and-exit ,to ,subject ,file-string)))
+ (use-local-map lkeymap)))
+
+ (defun pvs-mail-send-and-exit (to subject file-string)
+@@ -1435,8 +1435,8 @@
+
+ (defun pvs-major-version-number ()
+ (if *pvs-version-information*
+- (string-to-int (car *pvs-version-information*))
+- (string-to-int (pvs-send-and-wait "*pvs-version*" nil nil))))
++ (string-to-number (car *pvs-version-information*))
++ (string-to-number (pvs-send-and-wait "*pvs-version*" nil nil))))
+
+ ;;; Replay
+
+diff -Naur pvs4.2-orig/emacs/emacs-src/pvs-ilisp.el pvs4.2-sbcl/emacs/emacs-src/pvs-ilisp.el
+--- pvs4.2-orig/emacs/emacs-src/pvs-ilisp.el 2007-07-02 20:07:41.000000000 +0000
++++ pvs4.2-sbcl/emacs/emacs-src/pvs-ilisp.el 2009-03-24 18:56:17.000000000 +0000
+@@ -111,6 +111,7 @@
+ (case (intern (getenv "PVSLISP"))
+ (allegro (pvsallegro "pvs" nil))
+ (cmulisp (pvscmulisp "pvs" nil))
++ (sbclisp (pvssbclisp "pvs" nil))
+ (t (error "Unknown lisp - %s" (getenv "PVSLISP"))))
+ (save-excursion
+ (set-buffer (ilisp-buffer))
+@@ -164,7 +165,7 @@
+ (setq ilisp-binary-extension (pvs-cmulisp-binary-extension))
+ (setq ilisp-init-binary-extension ilisp-binary-extension)
+ (setq ilisp-load-inits nil)
+- (setq ilisp-program (format "%s -qq" (pvs-program)))
++ (setq ilisp-program (format "%s -quiet -noinit" (pvs-program)))
+ (setq comint-prompt-regexp
+ "^\\([0-9]+\\]+\\|\\*\\|[-a-zA-Z0-9]*\\[[0-9]+\\]:\\) \\|Rule\\? \\|<GndEval> \\|<PVSio> \\|(Y or N)\\|(Yes or No)\\|Please enter")
+ (setq comint-interrupt-regexp "^Interrupted at")
+@@ -173,6 +174,24 @@
+ "^\\([0-9]+\\]+\\|\\*\\|[-a-zA-Z0-9]*\\[[0-9]+\\]:\\) ")
+ (setq pvs-gc-end-regexp ";;; Finished GC"))
+
++(defdialect pvssbclisp "pvs-sbclisp"
++ cmulisp
++ (pvs-comint-init)
++ ;;(setq comint-send-newline nil)
++ (setq ilisp-binary-extension (pvs-sbclisp-binary-extension))
++ (setq ilisp-init-binary-extension ilisp-binary-extension)
++ (setq ilisp-load-inits nil)
++ (setq ilisp-program (format "%s --noinform --no-userinit" (pvs-program)))
++ (setq ilisp-reset ":abort")
++ (setq comint-prompt-regexp
++ "^\\([0-9]+\\]+\\|\\*\\|[-a-zA-Z0-9]*\\[[0-9]+\\]:\\) \\|Rule\\? \\|<GndEval> \\|<PVSio> \\|(Y or N)\\|(Yes or No)\\|Please enter")
++ (setq comint-interrupt-regexp "^ Interactive interrupt at")
++ (setq comint-continue ":continue")
++ (setq ilisp-error-regexp "^restarts (invokable by number or by possibly-abbreviated name):$")
++ (setq pvs-top-regexp
++ "^\\([0-9]+\\]+\\|\\*\\|[-a-zA-Z0-9]*\\[[0-9]+\\]:\\) ")
++ (setq pvs-gc-end-regexp ";;; Finished GC"))
++
+ (defun pvs-allegro-binary-extension ()
+ (let ((machine (getenv "PVSARCH")))
+ (cond ((string-equal machine "sun4") ; Sun/Solaris
+@@ -193,6 +212,18 @@
+ "ppcf")
+ (t (error "Machine architecture %s not recognized" machine)))))
+
++(defun pvs-sbclisp-binary-extension ()
++ (let ((machine (getenv "PVSARCH")))
++ (cond ((string-equal machine "sun4") ; Sun/Solaris
++ "sparcs")
++ ((string-equal machine "ix86") ; Intel/Linux
++ "x86s")
++ ((string-equal machine "ix86_64") ; Intel/Linux
++ "x8664s")
++ ((string-equal machine "powerpc") ; Mac
++ "ppcs")
++ (t (error "Machine architecture %s not recognized" machine)))))
++
+ (defun pvs-comint-init ()
+ (setq ilisp-motd nil)
+ (setq pvs-fix-error comint-fix-error)
+@@ -736,7 +767,7 @@
+
+ (defun resize-info-buffer ()
+ (unless (one-window-p t)
+- (let* ((maxsize (/ (screen-height) 2))
++ (let* ((maxsize (/ (frame-height) 2))
+ (cursize (1- (window-height)))
+ (lines (real-number-of-lines))
+ (size (min maxsize lines)))
+@@ -1108,11 +1139,6 @@
+ (show-entry))
+ (t (error "Unknown display type %s" type))))))
+
+-(defun pvs-locate (out)
+- (apply 'display-file-at-location
+- (parse-pvs-message out)))
+-
+-
+ (defun pvs-locate (output)
+ (let* ((message (parse-pvs-message output))
+ (dir (car message))
+diff -Naur pvs4.2-orig/emacs/emacs-src/pvs-load.el pvs4.2-sbcl/emacs/emacs-src/pvs-load.el
+--- pvs4.2-orig/emacs/emacs-src/pvs-load.el 2008-07-07 08:03:45.000000000 +0000
++++ pvs4.2-sbcl/emacs/emacs-src/pvs-load.el 2009-03-24 18:56:17.000000000 +0000
+@@ -238,7 +238,7 @@
+ (insert "\n\nPlease check our website periodically for news of later versions")
+ (insert "\nat http://pvs.csl.sri.com/")
+ (insert "\n\n" (cadr (cdddr vers)) "\n" (cadr (cddddr vers)))
+- (insert-string "
++ (insert "
+ ----------
+ Bug reports and suggestions for improvement should be sent to
+ pvs-bugs@csl.sri.com
+diff -Naur pvs4.2-orig/emacs/emacs-src/pvs-prover.el pvs4.2-sbcl/emacs/emacs-src/pvs-prover.el
+--- pvs4.2-orig/emacs/emacs-src/pvs-prover.el 2007-07-02 20:07:41.000000000 +0000
++++ pvs4.2-sbcl/emacs/emacs-src/pvs-prover.el 2009-03-24 18:56:17.000000000 +0000
+@@ -1043,7 +1043,7 @@
+ (if (> indent 0)
+ (while (and (>= (point) start)
+ (progn (beginning-of-line)
+- (insert-string indstr)
++ (insert indstr)
+ (= (forward-line -1) 0))))))
+ (when crs (insert "\n\n"))))
+
+@@ -1084,7 +1084,7 @@
+ (pvs-bury-output)
+ (let ((file (current-pvs-file)))
+ (when (buffer-modified-p (get-file-buffer file))
+- (error "~a is not parsed" file))
++ (error "%s is not parsed" file))
+ (when (pvs-send-and-wait (format "(lisp (modify-declaration-at \"%s\" %d))"
+ file (current-line-number))
+ nil nil 'bool)
+@@ -1192,7 +1192,7 @@
+ nil)
+ ((and (stringp depth)
+ (string-match "^[ \t]*[0-9]+[ \t]*$" depth))
+- (string-to-int depth))
++ (string-to-number depth))
+ (t (error "set-rewrite-depth: %s is not a number or nil"
+ depth)))))
+ (pvs-send (format "(setq *rewrite-print-depth* %s)" dep))))
+@@ -1221,7 +1221,7 @@
+ nil)
+ ((and (stringp length)
+ (string-match "^[ \t]*[0-9]+[ \t]*$" length))
+- (string-to-int length))
++ (string-to-number length))
+ (t (error "set-rewrite-length: %s is not an integer or nil"
+ length)))))
+ (pvs-send (format "(setq *rewrite-print-length* %s)" len))))
+@@ -1242,7 +1242,7 @@
+ nil)
+ ((and (stringp depth)
+ (string-match "^[ \t]*[0-9]+[ \t]*$" depth))
+- (string-to-int depth))
++ (string-to-number depth))
+ (t (error "set-print-depth: %s is not an integer" depth)))))
+ (pvs-send (format "(setq *prover-print-depth* %s)"
+ (when (plusp dep) dep)))))
+@@ -1264,7 +1264,7 @@
+ nil)
+ ((and (stringp length)
+ (string-match "^[ \t]*[0-9]+[ \t]*$" length))
+- (string-to-int length))
++ (string-to-number length))
+ (t (error "set-print-length: %s is not an integer"
+ length)))))
+ (pvs-send (format "(setq *prover-print-length* %s)"
+@@ -1285,7 +1285,7 @@
+ nil)
+ ((and (stringp lines)
+ (string-match "^[ \t]*[0-9]+[ \t]*$" lines))
+- (string-to-int lines))
++ (string-to-number lines))
+ (t (error "set-print-lines: %s is not an integer" lines)))))
+ (pvs-send (format "(setq *prover-print-lines* %s)"
+ (when (plusp dep) dep)))))
+@@ -2153,7 +2153,7 @@
+ 1)
+ ((and (stringp num)
+ (string-match "^[ \t]*[0-9]+[ \t]*$" num))
+- (string-to-int num))
++ (string-to-number num))
+ (t (error "set-proof-backup-number: %s is not an integer"
+ num)))))
+ (pvs-send (format "(setq *number-of-proof-backups* %s)" n))))
+diff -Naur pvs4.2-orig/emacs/emacs-src/pvs-prover-helps.el pvs4.2-sbcl/emacs/emacs-src/pvs-prover-helps.el
+--- pvs4.2-orig/emacs/emacs-src/pvs-prover-helps.el 2007-07-02 20:07:41.000000000 +0000
++++ pvs4.2-sbcl/emacs/emacs-src/pvs-prover-helps.el 2009-03-24 18:56:17.000000000 +0000
+@@ -244,7 +244,7 @@
+ (setq ept (point))
+ (setq def2arw (buffer-substring bpt ept)))
+ (setq def2arw (read-from-minibuffer "Auto-rewrite: ")))
+- (end-of-buffer)
++ (goto-char (point-max))
+ (insert "(auto-rewrite " ?\" def2arw ?\" ")")
+ (return-ilisp)))
+
+@@ -372,7 +372,7 @@
+ (setq fnum (buffer-substring bpt ept)))
+ (setq fnum (read-from-minibuffer
+ "in formula [CR for default]# " ""))))
+- (end-of-buffer)
++ (goto-char (point-max))
+ (insert "(expand " ?\" def2expand ?\" " " fnum ")")
+ (return-ilisp)))))
+
+@@ -701,7 +701,7 @@
+ (setq expr (buffer-substring start end))
+ (if (not (y-or-n-p (concat "Typepred for " expr)))
+ (error "typepred aborted.")))
+- (end-of-buffer)
++ (goto-char (point-max))
+ (insert "(typepred " ?\" expr ?\" ")")
+ (return-ilisp)))
+
+@@ -767,7 +767,7 @@
+ (if editprfwin
+ (set-window-point editprfwin (point))))
+ (setq cmd (buffer-substring beg end))))
+- (end-of-buffer)
++ (goto-char (point-max))
+ (insert cmd)
+ (return-ilisp)
+ (hilit-next-prover-command)
+@@ -820,10 +820,10 @@
+ (pvs-prover-goto-prev-step t))
+ (hilit-next-prover-command)
+ (switch-to-buffer pvsbuf)
+- (end-of-buffer)
++ (goto-char (point-max))
+ (switch-to-buffer editprfbuf)
+ (pop-to-buffer pvsbuf)
+- (end-of-buffer))))
++ (goto-char (point-max)))))
+
+
+ ;;; pvs-prover-goto-next-step puts the cursor at the beginning of the next
+diff -Naur pvs4.2-orig/emacs/emacs-src/pvs-tcl.el pvs4.2-sbcl/emacs/emacs-src/pvs-tcl.el
+--- pvs4.2-orig/emacs/emacs-src/pvs-tcl.el 2007-07-02 20:07:41.000000000 +0000
++++ pvs4.2-sbcl/emacs/emacs-src/pvs-tcl.el 2009-03-24 18:56:17.000000000 +0000
+@@ -94,7 +94,7 @@
+ "PVS Error"))
+ (t (comint-display-output
+ (format "PVS was developed and tested for %s versions %s,\nbut you are using version %s.\nThis is unlikely to cause problems, as it is a later release."
+- program-name expected version program-name)
++ program-name expected version)
+ "PVS Warning"))))))
+
+ (defun pvs-parse-version-numbers (vnum)
+diff -Naur pvs4.2-orig/emacs/emacs-src/pvs-utils.el pvs4.2-sbcl/emacs/emacs-src/pvs-utils.el
+--- pvs4.2-orig/emacs/emacs-src/pvs-utils.el 2008-07-18 04:39:20.000000000 +0000
++++ pvs4.2-sbcl/emacs/emacs-src/pvs-utils.el 2009-03-24 18:56:17.000000000 +0000
+@@ -238,7 +238,7 @@
+ nil nil 'list)))
+ (when fandp
+ (cond ((not (file-exists-p (car fandp)))
+- (error "Theory ~a was in ~a which no longer exists"
++ (error "Theory %s was in %s which no longer exists"
+ theoryname (car fandp)))
+ ((or (null (cdr fandp))
+ (buffer-modified-p (find-file-noselect (car fandp))))
+@@ -990,13 +990,6 @@
+ (error "Must specify a theory name")
+ (list theory))))))
+
+-(defun remove-duplicates (list)
+- (let ((nlist nil))
+- (dolist (e list)
+- (unless (member-equal e nlist)
+- (push e nlist)))
+- (nreverse nlist)))
+-
+ (defun current-theory ()
+ (let ((file (current-pvs-file t)))
+ (if file
+@@ -1235,13 +1228,6 @@
+ (or (car (get cmd 'abbreviations))
+ cmd))
+
+-(defun remove-if (pred list)
+- (let ((nlist nil))
+- (dolist (e list)
+- (unless (funcall pred e)
+- (push e nlist)))
+- (nreverse nlist)))
+-
+ (defun add-final-newline ()
+ (save-excursion
+ (unless (equal (char-after (1- (point-max))) ?\n)
+@@ -1355,9 +1341,14 @@
+ (setq pvs-reserved-words-regexp
+ "\\bassuming\\b\\|\\baxiom\\b\\|\\baccept\\b\\|\\bchanges\\b\\|\\ball\\b\\|\\band\\b\\|\\barray\\b\\|\\bbegin\\b\\|\\bby\\b\\|\\bcase\\b\\|\\bdeclare\\b\\|\\bdefinition\\b\\|\\belse\\b\\|\\belsif\\b\\|\\bendif\\b\\|\\bendassuming\\b\\|\\bendcase\\b\\|\\bend\\b\\|\\bexists\\b\\|\\bexporting\\b\\|\\bexit\\b\\|\\bforall\\b\\|\\bfunction\\b\\|\\bformula\\b\\|\\bfrom\\b\\|\\bif\\b\\|\\biff\\b\\|\\bimplies\\b\\|\\bimporting\\b\\|\\bin\\b\\|\\bis\\b\\|\\blambda\\b\\|\\blemma\\b\\|\\bloop\\b\\|\\bmapping\\b\\|\\bmeasure\\b\\|\\bmodule\\b\\|\\bnot\\b\\|\\bnothing\\b\\|\\bof\\b\\|\\bonto\\b\\|\\bobligation\\b\\|\\bopspec\\b\\|\\bor\\b\\|\\bproof\\b\\|\\bprove\\b\\|\\brecursive\\b\\|\\bresult\\b\\|\\btheorem\\b\\|\\btheory\\b\\|\\busing\\b\\|\\bvar\\b\\|\\bvariable\\b\\|\\brecord\\b\\|\\bverify\\b\\|\\bwhere\\b\\|\\bthen\\b\\|\\btype\\b\\|\\bwhen\\b\\|\\bwhile\\b\\|\\bwith\\b\\|\\blet\\b\\|\\bsetvariable\\b\\|\\[#\\|#\\]\\|[(]#\\|#[)]")
+
++(defmacro pvs-find-face (name)
++ (if (featurep 'xemacs)
++ `(find-face ,name)
++ `(facep ,name)))
++
+ (defun highlight-pvs ()
+ (interactive)
+- (unless (internal-find-face 'pvs-keyword)
++ (unless (pvs-find-face 'pvs-keyword)
+ (make-face 'pvs-keyword)
+ (set-face-foreground 'pvs-keyword "Blue")
+ (set-face-font 'pvs-keyword "*courier-bold-r-normal--12*"))
+@@ -1575,7 +1566,7 @@
+ (defvar pvs-unexpected-output nil)
+
+ (defmacro pvs-validate (file directory &rest body)
+- (` (let* ((logfile (concat default-directory (, file))))
++ `(let* ((logfile (concat default-directory ,file)))
+ (pvs-backup-logfile logfile)
+ (let ((logbuf (find-file-noselect logfile t)))
+ (unwind-protect
+@@ -1592,9 +1583,9 @@
+ (default-directory default-directory))
+ (pvs-message (pvs-version-string))
+ (let ((pvs-disable-messages nil))
+- (change-context (, directory)))
++ (change-context ,directory))
+ (condition-case err
+- (progn (,@ body))
++ (progn ,@body)
+ (error (pvs-message "ERROR: Emacs: %s %s"
+ (car err) (cdr err)))))
+ (pvs-wait-for-it)
+@@ -1659,7 +1650,7 @@
+ (pvs-message "NO BASELINE - using this run to create baseline.log")
+ (copy-file (buffer-file-name) "baseline.log"))))
+ (fset 'pvs-handler 'pvs-handler-orig)
+- (fset 'ask-user-about-lock 'ask-user-about-lock-orig))))))
++ (fset 'ask-user-about-lock 'ask-user-about-lock-orig)))))
+
+
+ ;;; This function provides the most basic form of test, removing bin
+diff -Naur pvs4.2-orig/emacs/go-pvs.el pvs4.2-sbcl/emacs/go-pvs.el
+--- pvs4.2-orig/emacs/go-pvs.el 2007-07-02 20:07:41.000000000 +0000
++++ pvs4.2-sbcl/emacs/go-pvs.el 2009-03-24 18:56:17.000000000 +0000
+@@ -24,6 +24,7 @@
+ ;; --------------------------------------------------------------------
+
+ (setq debug-on-error t)
++(setq inhibit-startup-screen t)
+
+ (defconst pvs-emacs-system
+ (cond ((or (string-match "XEmacs 21" (emacs-version))
+diff -Naur pvs4.2-orig/ess/box-defs.lisp pvs4.2-sbcl/ess/box-defs.lisp
+--- pvs4.2-orig/ess/box-defs.lisp 2007-07-02 20:07:41.000000000 +0000
++++ pvs4.2-sbcl/ess/box-defs.lisp 2009-03-24 18:56:17.000000000 +0000
+@@ -15,8 +15,8 @@
+ ;;; Frank Pfenning (fp@cs.cmu.edu) ;;;
+ ;;; ******************************************************************* ;;;
+
+-(in-package :tools #+sbcl (:use :common-lisp :ergolisp))
+-#-sbcl (use-package :ergolisp)
++(in-package :tools)
++(use-package :ergolisp)
+
+ (export '(*plain-readtable*))
+
+diff -Naur pvs4.2-orig/ess/lang/ab-term/rel/af-dependency.lisp pvs4.2-sbcl/ess/lang/ab-term/rel/af-dependency.lisp
+--- pvs4.2-orig/ess/lang/ab-term/rel/af-dependency.lisp 2007-07-02 20:07:41.000000000 +0000
++++ pvs4.2-sbcl/ess/lang/ab-term/rel/af-dependency.lisp 2009-03-24 18:56:17.000000000 +0000
+@@ -24,7 +24,7 @@
+ ;;; 07-17-86 rln Initial development and release
+ ;;; 07-22-87 rln Reimplementation
+
+-(in-package 'analysis-facility)
++(in-package :analysis-facility)
+ (use-package '("AF-RUNTIME-LIB"))
+
+ ;;; The variable *CODE* accumulates the code descriptors generated by SCHEDULE.
+diff -Naur pvs4.2-orig/ess/lang/ab-term/rel/af-runtime.lisp pvs4.2-sbcl/ess/lang/ab-term/rel/af-runtime.lisp
+--- pvs4.2-orig/ess/lang/ab-term/rel/af-runtime.lisp 2007-07-02 20:07:41.000000000 +0000
++++ pvs4.2-sbcl/ess/lang/ab-term/rel/af-runtime.lisp 2009-03-24 18:56:17.000000000 +0000
+@@ -25,7 +25,12 @@
+ ;;; 07-22-87 rln Initial development release.
+ ;;;
+
+-(in-package "AF-RUNTIME-LIB" :nicknames '(abrt afrt))
++(eval-when (compile load eval)
++ (unless (find-package "AF-RUNTIME-LIB")
++ (make-package "AF-RUNTIME-LIB"
++ :nicknames '("ABRT" "AFRT")
++ :use '("COMMON-LISP"))))
++(in-package "AF-RUNTIME-LIB")
+
+ (export '(opcase argcase rt-delta-error rt-term-argn rt-term-args
+ rt-symbol rt-ite rt-opt rt-function rt-ast
+diff -Naur pvs4.2-orig/ess/lang/ab-term/rel/af-structs.lisp pvs4.2-sbcl/ess/lang/ab-term/rel/af-structs.lisp
+--- pvs4.2-orig/ess/lang/ab-term/rel/af-structs.lisp 2007-07-02 20:07:41.000000000 +0000
++++ pvs4.2-sbcl/ess/lang/ab-term/rel/af-structs.lisp 2009-03-24 18:56:17.000000000 +0000
+@@ -23,7 +23,7 @@
+ ;;;
+ ;;; 07-22-87 rln Initial development and release.
+
+-(in-package 'analysis-facility)
++(in-package :analysis-facility)
+
+ ;;; A DP-EVAL structure describes an attribute which is defined by an expression.
+ ;;; An expression always defines exactly one attribute.
+diff -Naur pvs4.2-orig/ess/lang/ab-term/rel/af-top.lisp pvs4.2-sbcl/ess/lang/ab-term/rel/af-top.lisp
+--- pvs4.2-orig/ess/lang/ab-term/rel/af-top.lisp 2007-07-02 20:07:41.000000000 +0000
++++ pvs4.2-sbcl/ess/lang/ab-term/rel/af-top.lisp 2009-03-24 18:56:17.000000000 +0000
+@@ -29,7 +29,7 @@
+ ;;; 07-22-87 rln Initial development release.
+
+
+-(in-package 'analysis-facility :nicknames '(ab af))
++(in-package :analysis-facility)
+
+ (export '(ab ab-make help))
+
+diff -Naur pvs4.2-orig/ess/lang/sb-term/rel/access-par.lisp pvs4.2-sbcl/ess/lang/sb-term/rel/access-par.lisp
+--- pvs4.2-orig/ess/lang/sb-term/rel/access-par.lisp 2007-07-02 20:07:41.000000000 +0000
++++ pvs4.2-sbcl/ess/lang/sb-term/rel/access-par.lisp 2009-03-24 18:56:17.000000000 +0000
+@@ -21,7 +21,7 @@
+ ;;; Revised Scott Dietzen, Mon Oct 13 15:32:09 1986
+
+
+-(in-package 'syntax-box) (use-package :ergolisp)
++(in-package :syntax-box) (use-package :ergolisp)
+
+
+
+diff -Naur pvs4.2-orig/ess/lang/sb-term/rel/aux-funs.lisp pvs4.2-sbcl/ess/lang/sb-term/rel/aux-funs.lisp
+--- pvs4.2-orig/ess/lang/sb-term/rel/aux-funs.lisp 2007-07-02 20:07:41.000000000 +0000
++++ pvs4.2-sbcl/ess/lang/sb-term/rel/aux-funs.lisp 2009-03-24 18:56:17.000000000 +0000
+@@ -17,7 +17,7 @@
+ ;;; Scott Dietzen, Mon Oct 13 16:05:43 1986
+
+
+-(in-package 'syntax-box) (use-package :ergolisp)
++(in-package :syntax-box) (use-package :ergolisp)
+
+
+ (defparameter *sb-package* (find-package :sb))
+diff -Naur pvs4.2-orig/ess/lang/sb-term/rel/collapse.lisp pvs4.2-sbcl/ess/lang/sb-term/rel/collapse.lisp
+--- pvs4.2-orig/ess/lang/sb-term/rel/collapse.lisp 2007-07-02 20:07:41.000000000 +0000
++++ pvs4.2-sbcl/ess/lang/sb-term/rel/collapse.lisp 2009-03-24 18:56:17.000000000 +0000
+@@ -16,7 +16,7 @@
+
+ ;;;; Basic Function: Collapse fragments into lisp functions
+
+-(in-package 'syntax-box) (use-package :ergolisp)
++(in-package :syntax-box) (use-package :ergolisp)
+
+
+ ; The purpose of collapse is to take the fragments produced by process-grammar
+diff -Naur pvs4.2-orig/ess/lang/sb-term/rel/flatten.lisp pvs4.2-sbcl/ess/lang/sb-term/rel/flatten.lisp
+--- pvs4.2-orig/ess/lang/sb-term/rel/flatten.lisp 2007-07-02 20:07:41.000000000 +0000
++++ pvs4.2-sbcl/ess/lang/sb-term/rel/flatten.lisp 2009-03-24 18:56:17.000000000 +0000
+@@ -17,7 +17,7 @@
+
+ ;;;; Basic Function: Flatten Patterns
+
+-(in-package 'syntax-box) (use-package :ergolisp)
++(in-package :syntax-box) (use-package :ergolisp)
+
+
+
+diff -Naur pvs4.2-orig/ess/lang/sb-term/rel/inter-phase.lisp pvs4.2-sbcl/ess/lang/sb-term/rel/inter-phase.lisp
+--- pvs4.2-orig/ess/lang/sb-term/rel/inter-phase.lisp 2007-07-02 20:07:41.000000000 +0000
++++ pvs4.2-sbcl/ess/lang/sb-term/rel/inter-phase.lisp 2009-03-24 18:56:17.000000000 +0000
+@@ -16,8 +16,8 @@
+
+ ;;; Intermediate Phase.
+
+-(in-package 'syntax-box) (use-package :ergolisp)
+-(use-package '(sb-runtime))
++(in-package :syntax-box) (use-package :ergolisp)
++(use-package :sb-runtime)
+
+ ;;; Understanding of the internal grammar term structure is essential to
+ ;;; understanding this code (see documentation in access.lisp). @@@
+diff -Naur pvs4.2-orig/ess/lang/sb-term/rel/lexer-gen.lisp pvs4.2-sbcl/ess/lang/sb-term/rel/lexer-gen.lisp
+--- pvs4.2-orig/ess/lang/sb-term/rel/lexer-gen.lisp 2007-07-02 20:07:41.000000000 +0000
++++ pvs4.2-sbcl/ess/lang/sb-term/rel/lexer-gen.lisp 2009-03-24 18:56:17.000000000 +0000
+@@ -31,7 +31,7 @@
+ ;;; (Routines check-comment-char(s)-with-op(S))
+
+
+-(in-package 'syntax-box) (use-package :ergolisp)
++(in-package :syntax-box) (use-package :ergolisp)
+
+
+
+diff -Naur pvs4.2-orig/ess/lang/sb-term/rel/look-ahead.lisp pvs4.2-sbcl/ess/lang/sb-term/rel/look-ahead.lisp
+--- pvs4.2-orig/ess/lang/sb-term/rel/look-ahead.lisp 2007-07-02 20:07:41.000000000 +0000
++++ pvs4.2-sbcl/ess/lang/sb-term/rel/look-ahead.lisp 2009-03-24 18:56:17.000000000 +0000
+@@ -9,9 +9,9 @@
+ ;;; ******************************************************************* ;;;
+
+
+-(in-package 'syntax-box) (use-package :ergolisp)
++(in-package :syntax-box) (use-package :ergolisp)
+
+-(use-package '(sb-runtime))
++(use-package :sb-runtime)
+
+
+
+diff -Naur pvs4.2-orig/ess/lang/sb-term/rel/new-rt-format.lisp pvs4.2-sbcl/ess/lang/sb-term/rel/new-rt-format.lisp
+--- pvs4.2-orig/ess/lang/sb-term/rel/new-rt-format.lisp 2007-07-02 20:07:41.000000000 +0000
++++ pvs4.2-sbcl/ess/lang/sb-term/rel/new-rt-format.lisp 2009-03-24 18:56:17.000000000 +0000
+@@ -13,7 +13,7 @@
+
+ ;;; Scott Dietzen, Wed Aug 26 17:16:29 1987
+
+-(in-package 'sb-runtime) (use-package :ergolisp)
++(in-package :sb-runtime) (use-package :ergolisp)
+
+ (export '(
+ format-uterm
+diff -Naur pvs4.2-orig/ess/lang/sb-term/rel/old-rt-format.lisp pvs4.2-sbcl/ess/lang/sb-term/rel/old-rt-format.lisp
+--- pvs4.2-orig/ess/lang/sb-term/rel/old-rt-format.lisp 2007-07-02 20:07:41.000000000 +0000
++++ pvs4.2-sbcl/ess/lang/sb-term/rel/old-rt-format.lisp 2009-03-24 18:56:17.000000000 +0000
+@@ -13,7 +13,7 @@
+
+ ;;; Scott Dietzen, Wed Aug 26 17:16:29 1987
+
+-(in-package 'sb-runtime) (use-package :ergolisp)
++(in-package :sb-runtime) (use-package :ergolisp)
+
+ (export '(
+ format-uterm
+diff -Naur pvs4.2-orig/ess/lang/sb-term/rel/old-rt-unp-structs.lisp pvs4.2-sbcl/ess/lang/sb-term/rel/old-rt-unp-structs.lisp
+--- pvs4.2-orig/ess/lang/sb-term/rel/old-rt-unp-structs.lisp 2007-07-02 20:07:41.000000000 +0000
++++ pvs4.2-sbcl/ess/lang/sb-term/rel/old-rt-unp-structs.lisp 2009-03-24 18:56:17.000000000 +0000
+@@ -13,7 +13,7 @@
+
+ ;;; Scott Dietzen, Wed Aug 26 17:16:29 1987
+
+-(in-package 'sb-runtime) (use-package :ergolisp)
++(in-package :sb-runtime) (use-package :ergolisp)
+
+ (export '(token-p make-token token-kind token-subkind
+ token-value token-str-value
+diff -Naur pvs4.2-orig/ess/lang/sb-term/rel/rt-lex.lisp pvs4.2-sbcl/ess/lang/sb-term/rel/rt-lex.lisp
+--- pvs4.2-orig/ess/lang/sb-term/rel/rt-lex.lisp 2007-07-02 20:07:41.000000000 +0000
++++ pvs4.2-sbcl/ess/lang/sb-term/rel/rt-lex.lisp 2009-03-24 18:56:17.000000000 +0000
+@@ -40,7 +40,7 @@
+ ))
+
+
+-(defconstant possible-single-char-operators
++(defconstant-if-unbound possible-single-char-operators
+ '(#\( #\) #\[ #\] #\{ #\} #\< #\> #\, #\; #\| #\^ #\# #\~ #\/
+ #\! #\@ #\$ #\& #\_ #\- #\? #\% #\' #\: #\* #\+ #\` #\= #\\))
+
+diff -Naur pvs4.2-orig/ess/lang/sb-term/rel/rt-term.lisp pvs4.2-sbcl/ess/lang/sb-term/rel/rt-term.lisp
+--- pvs4.2-orig/ess/lang/sb-term/rel/rt-term.lisp 2007-07-02 20:07:41.000000000 +0000
++++ pvs4.2-sbcl/ess/lang/sb-term/rel/rt-term.lisp 2009-03-24 18:56:17.000000000 +0000
+@@ -19,7 +19,7 @@
+
+
+
+-(in-package "SB-RUNTIME" :nicknames '("RT-SB" "RTSB" "SB-RT" "SBRT"))
++(in-package "SB-RUNTIME")
+ (use-package :ergolisp)
+
+ (use-package '("TERM" "OCC" "OPER"))
+diff -Naur pvs4.2-orig/ess/lang/sb-term/rel/rt-unparse.lisp pvs4.2-sbcl/ess/lang/sb-term/rel/rt-unparse.lisp
+--- pvs4.2-orig/ess/lang/sb-term/rel/rt-unparse.lisp 2007-07-02 20:07:41.000000000 +0000
++++ pvs4.2-sbcl/ess/lang/sb-term/rel/rt-unparse.lisp 2009-03-24 18:56:17.000000000 +0000
+@@ -117,17 +117,17 @@
+
+ ;;; Just so we don't repeatedly cons identical tokens.
+
+-(defconstant ellipsis-token
++(defconstant-if-unbound ellipsis-token
+ (make-token :kind :lt :subkind :string :value "#"))
+-(defconstant cr-token
++(defconstant-if-unbound cr-token
+ (make-token :kind :whitespace :subkind :cr))
+-(defconstant unindent-token
++(defconstant-if-unbound unindent-token
+ (make-token :kind :whitespace :subkind :unindent))
+-(defconstant tab-left-token
++(defconstant-if-unbound tab-left-token
+ (make-token :kind :whitespace :subkind :tab-left))
+-(defconstant tab-right-token
++(defconstant-if-unbound tab-right-token
+ (make-token :kind :whitespace :subkind :tab-right))
+-(defconstant untab-token
++(defconstant-if-unbound untab-token
+ (make-token :kind :whitespace :subkind :untab))
+
+
+diff -Naur pvs4.2-orig/ess/lang/sb-term/rel/rt-unp-attr.lisp pvs4.2-sbcl/ess/lang/sb-term/rel/rt-unp-attr.lisp
+--- pvs4.2-orig/ess/lang/sb-term/rel/rt-unp-attr.lisp 2007-07-02 20:07:41.000000000 +0000
++++ pvs4.2-sbcl/ess/lang/sb-term/rel/rt-unp-attr.lisp 2009-03-24 18:56:17.000000000 +0000
+@@ -13,7 +13,7 @@
+
+ ;;; Scott Dietzen, Tue Oct 6 15:32:22 1987
+
+-(in-package 'sb-runtime) (use-package :ergolisp)
++(in-package "SB-RUNTIME") (use-package :ergolisp)
+
+
+ ;;; The following is a hack to avoid the problems inherent in the circularity
+@@ -42,38 +42,6 @@
+
+
+
+-(defun memo-uterm (term unp-function &key (top-level? nil))
+- (if (or *disable-caching*
+- (and *disable-nested-caching*
+- (null top-level?)))
+- (funcall unp-function term)
+- (newattr::get-gsyn theuterm
+- term
+- (list unp-function
+- *unparse-style*
+- *no-escapes*
+- *sb-print-depth*
+- *sb-print-length*
+- *formatting-off*))))
+-
+-
+-(defun memo-aw (uterm width indent-unit-width fontwidth fontheight)
+- (if *disable-caching*
+- (let* ((aw (make-aw :uterm uterm
+- :indent-unit-width indent-unit-width)))
+- (format-aw uterm aw width))
+- (newattr::get-gsyn theaw
+- (uterm-term uterm)
+- (list uterm
+- width
+- indent-unit-width
+- fontwidth
+- fontheight))))
+-
+-
+-
+-
+-
+ (newattr::defgcon uterm-args)
+ (newattr::defgsyn theuterm uterm-args)
+
+@@ -105,3 +73,33 @@
+ :indent-unit-width indent-unit-width)))
+ (format-aw uterm aw width))))
+
++
++
++
++(defun memo-uterm (term unp-function &key (top-level? nil))
++ (if (or *disable-caching*
++ (and *disable-nested-caching*
++ (null top-level?)))
++ (funcall unp-function term)
++ (newattr::get-gsyn theuterm
++ term
++ (list unp-function
++ *unparse-style*
++ *no-escapes*
++ *sb-print-depth*
++ *sb-print-length*
++ *formatting-off*))))
++
++
++(defun memo-aw (uterm width indent-unit-width fontwidth fontheight)
++ (if *disable-caching*
++ (let* ((aw (make-aw :uterm uterm
++ :indent-unit-width indent-unit-width)))
++ (format-aw uterm aw width))
++ (newattr::get-gsyn theaw
++ (uterm-term uterm)
++ (list uterm
++ width
++ indent-unit-width
++ fontwidth
++ fontheight))))
+diff -Naur pvs4.2-orig/ess/lang/sb-term/rel/rt-unp-structs.lisp pvs4.2-sbcl/ess/lang/sb-term/rel/rt-unp-structs.lisp
+--- pvs4.2-orig/ess/lang/sb-term/rel/rt-unp-structs.lisp 2007-07-02 20:07:41.000000000 +0000
++++ pvs4.2-sbcl/ess/lang/sb-term/rel/rt-unp-structs.lisp 2009-03-24 18:56:17.000000000 +0000
+@@ -13,7 +13,7 @@
+
+ ;;; Scott Dietzen, Wed Aug 26 17:16:29 1987
+
+-(in-package 'sb-runtime) (use-package :ergolisp)
++(in-package "SB-RUNTIME") (use-package :ergolisp)
+
+ (export '(token-p make-token token-kind token-subkind
+ token-value token-str-value
+diff -Naur pvs4.2-orig/ess/lang/sb-term/rel/sbrt-lang-def.lisp pvs4.2-sbcl/ess/lang/sb-term/rel/sbrt-lang-def.lisp
+--- pvs4.2-orig/ess/lang/sb-term/rel/sbrt-lang-def.lisp 2007-07-02 20:07:41.000000000 +0000
++++ pvs4.2-sbcl/ess/lang/sb-term/rel/sbrt-lang-def.lisp 2009-03-24 18:56:17.000000000 +0000
+@@ -2,7 +2,9 @@
+ ;;; package SB-RUNTIME is seen. fp, Mon Jan 2 11:07:17 1989.
+ #-gcl
+ (defpackage :sb-runtime
+- #+sbcl (:use :common-lisp :ergolisp :oper :occ :term :sort :lang))
++ #+sbcl (:nicknames "RT-SB" "RTSB" "SB-RT" "SBRT")
++ #+sbcl (:use :common-lisp :ergolisp :oper :occ :term :sort :lang)
++ #+sbcl (:shadowing-import-from :sb-int memq))
+ (in-package :sb-runtime)
+ #-sbcl (use-package :ergolisp)
+ #-sbcl (use-package '(:oper :occ :term :sort :lang))
+diff -Naur pvs4.2-orig/ess/lang/sb-term/rel/top.lisp pvs4.2-sbcl/ess/lang/sb-term/rel/top.lisp
+--- pvs4.2-orig/ess/lang/sb-term/rel/top.lisp 2007-07-02 20:07:41.000000000 +0000
++++ pvs4.2-sbcl/ess/lang/sb-term/rel/top.lisp 2009-03-24 18:56:17.000000000 +0000
+@@ -25,7 +25,7 @@
+ ;;; Added calls to preprocessing phase.
+
+
+-(in-package 'syntax-box) (use-package :ergolisp)
++(in-package :syntax-box) (use-package :ergolisp)
+
+ (export '(sb sb-make))
+
+diff -Naur pvs4.2-orig/ess/lang/sb-term/rel/unp-code-revise.lisp pvs4.2-sbcl/ess/lang/sb-term/rel/unp-code-revise.lisp
+--- pvs4.2-orig/ess/lang/sb-term/rel/unp-code-revise.lisp 2007-07-02 20:07:41.000000000 +0000
++++ pvs4.2-sbcl/ess/lang/sb-term/rel/unp-code-revise.lisp 2009-03-24 18:56:17.000000000 +0000
+@@ -14,7 +14,7 @@
+ ;;; This code modifies unparser generator code.
+ ;;; Scott Dietzen, Wed Nov 11 15:38:39 1987
+
+-(in-package 'SB) (use-package :ergolisp)
++(in-package :SB) (use-package :ergolisp)
+
+
+ (defun unp-code-revision (routines)
+diff -Naur pvs4.2-orig/ess/sys/ergolisp/rel/dlambda.lisp pvs4.2-sbcl/ess/sys/ergolisp/rel/dlambda.lisp
+--- pvs4.2-orig/ess/sys/ergolisp/rel/dlambda.lisp 2007-07-02 20:07:41.000000000 +0000
++++ pvs4.2-sbcl/ess/sys/ergolisp/rel/dlambda.lisp 2009-03-24 18:56:17.000000000 +0000
+@@ -26,7 +26,7 @@
+ ;; This is a macro so that setf will work for declare-constructor
+ `(gethash ,constr *constructors-table* :no-info))
+
+-(defconstant *reserved-constrs* '(:as)
++(defconstant-if-unbound *reserved-constrs* '(:as)
+ "List of symbols that may not be used as constructors.")
+
+ (defmacro defreconstr (constr argcnt &key equal)
+diff -Naur pvs4.2-orig/ess/sys/tools/rel/box-system.lisp pvs4.2-sbcl/ess/sys/tools/rel/box-system.lisp
+--- pvs4.2-orig/ess/sys/tools/rel/box-system.lisp 2007-07-02 20:07:41.000000000 +0000
++++ pvs4.2-sbcl/ess/sys/tools/rel/box-system.lisp 2009-03-24 18:56:17.000000000 +0000
+@@ -190,15 +190,11 @@
+ (when lisp-compiler
+ (when boot
+ (load source-file))
+- (if readtable
+- (let ((*readtable* readtable))
+- (compile-file source-file :output-file compiled-file
+- #+(or lucid allegro) :messages #+(or lucid allegro) messages
+- #+(or cmu sbcl) :progress #+(or cmu sbcl) messages
+- ))
++ (let ((*readtable* (if readtable readtable *readtable*))
++ #+sbcl (*compiler-progress* messages))
+ (compile-file source-file :output-file compiled-file
+ #+(or lucid allegro) :messages #+(or lucid allegro) messages
+- #+(or cmu sbcl) :progress #+(or cmu sbcl) messages
++ #+cmu :progress #+cmu messages
+ ))
+ )
+ ;; #+kcl (rename-file (merge-pathnames ".o" source-file) compiled-file)
+@@ -249,6 +245,8 @@
+ (multiple-value-bind (junk1 junk2 result junk4)
+ (run-program "cc" :arguments arguments)
+ result)
++ #+sbcl
++ (sb-ext:process-exit-code (sb-ext:run-program "cc" arguments))
+ #+allegro
+ (excl:run-shell-command
+ (format nil "cc ~{ ~a~}" arguments))))
+@@ -390,8 +388,8 @@
+ ;;; all source files are .lisp, so we need only one set.
+ ;;; Recommend not changing the source extension. -fp
+
+-(defconstant *lisp-source-extension* "lisp")
+-(defconstant *lisp-compiled-extension*
++(defconstant-if-unbound *lisp-source-extension* "lisp")
++(defconstant-if-unbound *lisp-compiled-extension*
+ #+(and allegro sparc) "fasl" ; Sun4
+ #+(and allegro rios) "rfasl" ; PowerPC/RS6000
+ #+(and allegro hpux) "hfasl" ; HP 9000
+@@ -421,14 +419,14 @@
+ for this implementation of Lisp in the file sys/tools/rel/box-system.lisp.
+ Right now it is assumed to be \"bin\".")
+
+-(defconstant *lisp-source-suffix-string*
++(defconstant-if-unbound *lisp-source-suffix-string*
+ (concatenate 'string "." *lisp-source-extension*))
+
+-(defconstant *lisp-compiled-suffix-string*
++(defconstant-if-unbound *lisp-compiled-suffix-string*
+ (concatenate 'string "." *lisp-compiled-extension*))
+
+-(defconstant *lisp-source-extension-pathname*
++(defconstant-if-unbound *lisp-source-extension-pathname*
+ (make-pathname :type *lisp-source-extension*))
+
+-(defconstant *lisp-compiled-extension-pathname*
++(defconstant-if-unbound *lisp-compiled-extension-pathname*
+ (make-pathname :type *lisp-compiled-extension*))
+diff -Naur pvs4.2-orig/ess/sys/tools/rel/print-utils.lisp pvs4.2-sbcl/ess/sys/tools/rel/print-utils.lisp
+--- pvs4.2-orig/ess/sys/tools/rel/print-utils.lisp 2007-07-02 20:07:41.000000000 +0000
++++ pvs4.2-sbcl/ess/sys/tools/rel/print-utils.lisp 2009-03-24 18:56:17.000000000 +0000
+@@ -8,6 +8,7 @@
+ (defpackage :print-utils #+sbcl (:use :common-lisp :ergolisp))
+ (in-package :print-utils) #-sbcl (use-package :ergolisp)
+
++#-sbcl
+ (export '(lisp::print-struct lisp::writing-readably)
+ :lisp)
+ (export '(print-struct writing-readably))
+diff -Naur pvs4.2-orig/ess/sys/tools/rel/regression-test.lisp pvs4.2-sbcl/ess/sys/tools/rel/regression-test.lisp
+--- pvs4.2-orig/ess/sys/tools/rel/regression-test.lisp 2007-07-02 20:07:41.000000000 +0000
++++ pvs4.2-sbcl/ess/sys/tools/rel/regression-test.lisp 2009-03-24 18:56:17.000000000 +0000
+@@ -19,8 +19,8 @@
+ (defvar *regression-testing-p* nil)
+
+ (defun regression-test (&key (name "Anonymous test")
+- form (form-predicate #'identity) script endp)
+- (declare (special name script endp))
++ form (form-predicate #'identity) script donep)
++ (declare (special name script donep))
+ (let ((*regression-testing-p* t))
+ (catch 'script-ended
+ (let ((formval (if (functionp form) (funcall form) (eval form))))
+@@ -43,13 +43,13 @@
+ (cadr (car script)))
+
+ (defun move-script ()
+- (declare (special name script endp))
++ (declare (special name script donep))
+ (when (null script)
+- (if endp
++ (if donep
+ (throw 'script-ended nil)
+ (error "Regression test ~s fell off of end of script." name)))
+ (pop script)
+- (when (and (null script) endp) (throw 'script-ended nil))
++ (when (and (null script) donep) (throw 'script-ended nil))
+ (values))
+
+ (defmacro regression-test-only (key &body body)
+@@ -164,7 +164,7 @@
+ :name "Regressible-error should succeed."
+ :form '(regressible-error :test "Error message ~s." 'foo)
+ :script '((:test "Error message FOO."))
+- :endp t)
++ :donep t)
+
+ #+regression
+ (regression-test
+diff -Naur pvs4.2-orig/ess/term/language/rel/languages.lisp pvs4.2-sbcl/ess/term/language/rel/languages.lisp
+--- pvs4.2-orig/ess/term/language/rel/languages.lisp 2007-07-02 20:07:41.000000000 +0000
++++ pvs4.2-sbcl/ess/term/language/rel/languages.lisp 2009-03-24 18:56:17.000000000 +0000
+@@ -85,18 +85,18 @@
+
+
+
+-(defconstant standard-use-packages
++(defconstant-if-unbound standard-use-packages
+ '("ERGOLISP" "OPER" "OCC" "TERM" "SORT" "SB-RUNTIME" "LANG" "NEWATTR")
+ "The standard packages used by SB output files.")
+
+-(defconstant standard-use-languages
++(defconstant-if-unbound standard-use-languages
+ '("LEXICAL-TERMINALS")
+ "The standard languages used by SB output files.")
+
+
+-(defconstant gen-src-file-ext "lisp")
++(defconstant-if-unbound gen-src-file-ext "lisp")
+
+-(defconstant per-gen-src-file-ext
++(defconstant-if-unbound per-gen-src-file-ext
+ (concatenate 'string "." gen-src-file-ext))
+
+
+diff -Naur pvs4.2-orig/ess/term/trep/rel/attr-prims.lisp pvs4.2-sbcl/ess/term/trep/rel/attr-prims.lisp
+--- pvs4.2-orig/ess/term/trep/rel/attr-prims.lisp 2007-07-02 20:07:41.000000000 +0000
++++ pvs4.2-sbcl/ess/term/trep/rel/attr-prims.lisp 2009-03-24 18:56:17.000000000 +0000
+@@ -19,7 +19,11 @@
+ ;;; features from the terms, so it is the default method for storing
+ ;;; attributes.
+
+-(in-package "TERM" :nicknames '("GTERM")) (use-package :ergolisp)
++(eval-when (compile load eval)
++ (unless (find-package "TERM")
++ (make-package "TERM" :nicknames '("GTERM")
++ :use '(:cl-user :common-lisp :ergolisp))))
++(in-package "TERM")
+
+ (export '(attr-clear-one attr-clear-all))
+
+diff -Naur pvs4.2-orig/ess/term/trep/rel/gterm.lisp pvs4.2-sbcl/ess/term/trep/rel/gterm.lisp
+--- pvs4.2-orig/ess/term/trep/rel/gterm.lisp 2007-07-02 20:07:41.000000000 +0000
++++ pvs4.2-sbcl/ess/term/trep/rel/gterm.lisp 2009-03-24 18:56:17.000000000 +0000
+@@ -29,7 +29,11 @@
+ ;;; instead of a real operator.
+ ;;;
+
+-(in-package :term :nicknames '(:gterm)) (use-package :ergolisp)
++(eval-when (compile load eval)
++ (unless (find-package "TERM")
++ (make-package "TERM" :nicknames '("GTERM")
++ :use '(:cl-user :common-lisp :ergolisp))))
++(in-package "TERM")
+
+ (export '(term termp mk-term ds-term term-op term-args
+ term-attr set-term-attr))
+diff -Naur pvs4.2-orig/install-sh pvs4.2-sbcl/install-sh
+--- pvs4.2-orig/install-sh 2007-07-02 20:07:43.000000000 +0000
++++ pvs4.2-sbcl/install-sh 2009-03-24 18:56:17.000000000 +0000
+@@ -1,7 +1,7 @@
+ #!/bin/sh
+ # install - install a program, script, or datafile
+
+-scriptversion=2005-11-07.23
++scriptversion=2006-12-25.00
+
+ # This originates from X11R5 (mit/util/scripts/install.sh), which was
+ # later released in X11R6 (xc/config/util/install.sh) with the
+@@ -39,52 +39,68 @@
+ # when there is no Makefile.
+ #
+ # This script is compatible with the BSD install script, but was written
+-# from scratch. It can only install one file at a time, a restriction
+-# shared with many OS's install programs.
++# from scratch.
++
++nl='
++'
++IFS=" "" $nl"
+
+ # set DOITPROG to echo to test this script
+
+ # Don't use :- since 4.3BSD and earlier shells don't like it.
+-doit="${DOITPROG-}"
++doit=${DOITPROG-}
++if test -z "$doit"; then
++ doit_exec=exec
++else
++ doit_exec=$doit
++fi
+
+-# put in absolute paths if you don't have them in your path; or use env. vars.
++# Put in absolute file names if you don't have them in your path;
++# or use environment vars.
+
+-mvprog="${MVPROG-mv}"
+-cpprog="${CPPROG-cp}"
+-chmodprog="${CHMODPROG-chmod}"
+-chownprog="${CHOWNPROG-chown}"
+-chgrpprog="${CHGRPPROG-chgrp}"
+-stripprog="${STRIPPROG-strip}"
+-rmprog="${RMPROG-rm}"
+-mkdirprog="${MKDIRPROG-mkdir}"
++chgrpprog=${CHGRPPROG-chgrp}
++chmodprog=${CHMODPROG-chmod}
++chownprog=${CHOWNPROG-chown}
++cmpprog=${CMPPROG-cmp}
++cpprog=${CPPROG-cp}
++mkdirprog=${MKDIRPROG-mkdir}
++mvprog=${MVPROG-mv}
++rmprog=${RMPROG-rm}
++stripprog=${STRIPPROG-strip}
++
++posix_glob='?'
++initialize_posix_glob='
++ test "$posix_glob" != "?" || {
++ if (set -f) 2>/dev/null; then
++ posix_glob=
++ else
++ posix_glob=:
++ fi
++ }
++'
+
+-posix_glob=
+ posix_mkdir=
+
+-# Symbolic mode for testing mkdir with directories.
+-# It is the same as 755, but also tests that "u+" works.
+-test_mode=u=rwx,g=rx,o=rx,u+wx
+-
+ # Desired mode of installed file.
+ mode=0755
+
+-# Desired mode of newly created intermediate directories.
+-# It is empty if not known yet.
+-intermediate_mode=
+-
++chgrpcmd=
+ chmodcmd=$chmodprog
+ chowncmd=
+-chgrpcmd=
+-stripcmd=
++mvcmd=$mvprog
+ rmcmd="$rmprog -f"
+-mvcmd="$mvprog"
++stripcmd=
++
+ src=
+ dst=
+ dir_arg=
+-dstarg=
++dst_arg=
++
++copy_on_change=false
+ no_target_directory=
+
+-usage="Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE
++usage="\
++Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE
+ or: $0 [OPTION]... SRCFILES... DIRECTORY
+ or: $0 [OPTION]... -t DIRECTORY SRCFILES...
+ or: $0 [OPTION]... -d DIRECTORIES...
+@@ -94,81 +110,86 @@
+ In the 4th, create DIRECTORIES.
+
+ Options:
+--c (ignored)
+--d create directories instead of installing files.
+--g GROUP $chgrpprog installed files to GROUP.
+--m MODE $chmodprog installed files to MODE.
+--o USER $chownprog installed files to USER.
+--s $stripprog installed files.
+--t DIRECTORY install into DIRECTORY.
+--T report an error if DSTFILE is a directory.
+---help display this help and exit.
+---version display version info and exit.
++ --help display this help and exit.
++ --version display version info and exit.
++
++ -c (ignored)
++ -C install only if different (preserve the last data modification time)
++ -d create directories instead of installing files.
++ -g GROUP $chgrpprog installed files to GROUP.
++ -m MODE $chmodprog installed files to MODE.
++ -o USER $chownprog installed files to USER.
++ -s $stripprog installed files.
++ -t DIRECTORY install into DIRECTORY.
++ -T report an error if DSTFILE is a directory.
+
+ Environment variables override the default commands:
+- CHGRPPROG CHMODPROG CHOWNPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG
++ CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG
++ RMPROG STRIPPROG
+ "
+
+-while test -n "$1"; do
++while test $# -ne 0; do
+ case $1 in
+- -c) shift
+- continue;;
++ -c) ;;
+
+- -d) dir_arg=true
+- shift
+- continue;;
++ -C) copy_on_change=true;;
++
++ -d) dir_arg=true;;
+
+ -g) chgrpcmd="$chgrpprog $2"
+- shift
+- shift
+- continue;;
++ shift;;
+
+ --help) echo "$usage"; exit $?;;
+
+ -m) mode=$2
+- shift
+- shift
+- continue;;
++ case $mode in
++ *' '* | *' '* | *'
++'* | *'*'* | *'?'* | *'['*)
++ echo "$0: invalid mode: $mode" >&2
++ exit 1;;
++ esac
++ shift;;
+
+ -o) chowncmd="$chownprog $2"
+- shift
+- shift
+- continue;;
+-
+- -s) stripcmd=$stripprog
+- shift
+- continue;;
+-
+- -t) dstarg=$2
+- shift
+- shift
+- continue;;
+-
+- -T) no_target_directory=true
+- shift
+- continue;;
++ shift;;
++
++ -s) stripcmd=$stripprog;;
++
++ -t) dst_arg=$2
++ shift;;
++
++ -T) no_target_directory=true;;
+
+ --version) echo "$0 $scriptversion"; exit $?;;
+
+- *) # When -d is used, all remaining arguments are directories to create.
+- # When -t is used, the destination is already specified.
+- test -n "$dir_arg$dstarg" && break
+- # Otherwise, the last argument is the destination. Remove it from $@.
+- for arg
+- do
+- if test -n "$dstarg"; then
+- # $@ is not empty: it contains at least $arg.
+- set fnord "$@" "$dstarg"
+- shift # fnord
+- fi
+- shift # arg
+- dstarg=$arg
+- done
++ --) shift
+ break;;
++
++ -*) echo "$0: invalid option: $1" >&2
++ exit 1;;
++
++ *) break;;
+ esac
++ shift
+ done
+
+-if test -z "$1"; then
++if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then
++ # When -d is used, all remaining arguments are directories to create.
++ # When -t is used, the destination is already specified.
++ # Otherwise, the last argument is the destination. Remove it from $@.
++ for arg
++ do
++ if test -n "$dst_arg"; then
++ # $@ is not empty: it contains at least $arg.
++ set fnord "$@" "$dst_arg"
++ shift # fnord
++ fi
++ shift # arg
++ dst_arg=$arg
++ done
++fi
++
++if test $# -eq 0; then
+ if test -z "$dir_arg"; then
+ echo "$0: no input file specified." >&2
+ exit 1
+@@ -178,13 +199,38 @@
+ exit 0
+ fi
+
+-test -n "$dir_arg" || trap '(exit $?); exit' 1 2 13 15
++if test -z "$dir_arg"; then
++ trap '(exit $?); exit' 1 2 13 15
++
++ # Set umask so as not to create temps with too-generous modes.
++ # However, 'strip' requires both read and write access to temps.
++ case $mode in
++ # Optimize common cases.
++ *644) cp_umask=133;;
++ *755) cp_umask=22;;
++
++ *[0-7])
++ if test -z "$stripcmd"; then
++ u_plus_rw=
++ else
++ u_plus_rw='% 200'
++ fi
++ cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;;
++ *)
++ if test -z "$stripcmd"; then
++ u_plus_rw=
++ else
++ u_plus_rw=,u+rw
++ fi
++ cp_umask=$mode$u_plus_rw;;
++ esac
++fi
+
+ for src
+ do
+ # Protect names starting with `-'.
+ case $src in
+- -*) src=./$src ;;
++ -*) src=./$src;;
+ esac
+
+ if test -n "$dir_arg"; then
+@@ -202,22 +248,22 @@
+ exit 1
+ fi
+
+- if test -z "$dstarg"; then
++ if test -z "$dst_arg"; then
+ echo "$0: no destination specified." >&2
+ exit 1
+ fi
+
+- dst=$dstarg
++ dst=$dst_arg
+ # Protect names starting with `-'.
+ case $dst in
+- -*) dst=./$dst ;;
++ -*) dst=./$dst;;
+ esac
+
+ # If destination is a directory, append the input filename; won't work
+ # if double slashes aren't ignored.
+ if test -d "$dst"; then
+ if test -n "$no_target_directory"; then
+- echo "$0: $dstarg: Is a directory" >&2
++ echo "$0: $dst_arg: Is a directory" >&2
+ exit 1
+ fi
+ dstdir=$dst
+@@ -230,14 +276,25 @@
+ expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$dst" : 'X\(//\)[^/]' \| \
+ X"$dst" : 'X\(//\)$' \| \
+- X"$dst" : 'X\(/\)' \| \
+- . : '\(.\)' 2>/dev/null ||
++ X"$dst" : 'X\(/\)' \| . 2>/dev/null ||
+ echo X"$dst" |
+- sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+- /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+- /^X\(\/\/\)$/{ s//\1/; q; }
+- /^X\(\/\).*/{ s//\1/; q; }
+- s/.*/./; q'
++ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
++ s//\1/
++ q
++ }
++ /^X\(\/\/\)[^/].*/{
++ s//\1/
++ q
++ }
++ /^X\(\/\/\)$/{
++ s//\1/
++ q
++ }
++ /^X\(\/\).*/{
++ s//\1/
++ q
++ }
++ s/.*/./; q'
+ `
+
+ test -d "$dstdir"
+@@ -250,83 +307,131 @@
+ if test $dstdir_status != 0; then
+ case $posix_mkdir in
+ '')
+- posix_mkdir=false
+- if $mkdirprog -m $test_mode -p -- / >/dev/null 2>&1; then
+- posix_mkdir=true
+- else
+- # Remove any dirs left behind by ancient mkdir implementations.
+- rmdir ./-m "$test_mode" ./-p ./-- 2>/dev/null
+- fi ;;
+- esac
+-
+- if
+- $posix_mkdir && {
++ # Create intermediate dirs using mode 755 as modified by the umask.
++ # This is like FreeBSD 'install' as of 1997-10-28.
++ umask=`umask`
++ case $stripcmd.$umask in
++ # Optimize common cases.
++ *[2367][2367]) mkdir_umask=$umask;;
++ .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;;
++
++ *[0-7])
++ mkdir_umask=`expr $umask + 22 \
++ - $umask % 100 % 40 + $umask % 20 \
++ - $umask % 10 % 4 + $umask % 2
++ `;;
++ *) mkdir_umask=$umask,go-w;;
++ esac
+
+ # With -d, create the new directory with the user-specified mode.
+- # Otherwise, create it using the same intermediate mode that
+- # mkdir -p would use when creating intermediate directories.
+- # POSIX says that this mode is "$(umask -S),u+wx", so use that
+- # if umask -S works.
+-
++ # Otherwise, rely on $mkdir_umask.
+ if test -n "$dir_arg"; then
+- mkdir_mode=$mode
++ mkdir_mode=-m$mode
+ else
+- case $intermediate_mode in
+- '')
+- if umask_S=`(umask -S) 2>/dev/null`; then
+- intermediate_mode=$umask_S,u+wx
+- else
+- intermediate_mode=$test_mode
+- fi ;;
+- esac
+- mkdir_mode=$intermediate_mode
++ mkdir_mode=
+ fi
+
+- $mkdirprog -m "$mkdir_mode" -p -- "$dstdir"
+- }
++ posix_mkdir=false
++ case $umask in
++ *[123567][0-7][0-7])
++ # POSIX mkdir -p sets u+wx bits regardless of umask, which
++ # is incompatible with FreeBSD 'install' when (umask & 300) != 0.
++ ;;
++ *)
++ tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
++ trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0
++
++ if (umask $mkdir_umask &&
++ exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1
++ then
++ if test -z "$dir_arg" || {
++ # Check for POSIX incompatibilities with -m.
++ # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
++ # other-writeable bit of parent directory when it shouldn't.
++ # FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
++ ls_ld_tmpdir=`ls -ld "$tmpdir"`
++ case $ls_ld_tmpdir in
++ d????-?r-*) different_mode=700;;
++ d????-?--*) different_mode=755;;
++ *) false;;
++ esac &&
++ $mkdirprog -m$different_mode -p -- "$tmpdir" && {
++ ls_ld_tmpdir_1=`ls -ld "$tmpdir"`
++ test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
++ }
++ }
++ then posix_mkdir=:
++ fi
++ rmdir "$tmpdir/d" "$tmpdir"
++ else
++ # Remove any dirs left behind by ancient mkdir implementations.
++ rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null
++ fi
++ trap '' 0;;
++ esac;;
++ esac
++
++ if
++ $posix_mkdir && (
++ umask $mkdir_umask &&
++ $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir"
++ )
+ then :
+ else
+
+- # mkdir does not conform to POSIX, or it failed possibly due to
+- # a race condition. Create the directory the slow way, step by
+- # step, checking for races as we go.
++ # The umask is ridiculous, or mkdir does not conform to POSIX,
++ # or it failed possibly due to a race condition. Create the
++ # directory the slow way, step by step, checking for races as we go.
+
+ case $dstdir in
+- /*) pathcomp=/ ;;
+- -*) pathcomp=./ ;;
+- *) pathcomp= ;;
++ /*) prefix='/';;
++ -*) prefix='./';;
++ *) prefix='';;
+ esac
+
+- case $posix_glob in
+- '')
+- if (set -f) 2>/dev/null; then
+- posix_glob=true
+- else
+- posix_glob=false
+- fi ;;
+- esac
++ eval "$initialize_posix_glob"
+
+ oIFS=$IFS
+ IFS=/
+- $posix_glob && set -f
++ $posix_glob set -f
+ set fnord $dstdir
+ shift
+- $posix_glob && set +f
++ $posix_glob set +f
+ IFS=$oIFS
+
++ prefixes=
++
+ for d
+ do
+- test "x$d" = x && continue
++ test -z "$d" && continue
+
+- pathcomp=$pathcomp$d
+- if test ! -d "$pathcomp"; then
+- $mkdirprog "$pathcomp"
+- # Don't fail if two instances are running concurrently.
+- test -d "$pathcomp" || exit 1
++ prefix=$prefix$d
++ if test -d "$prefix"; then
++ prefixes=
++ else
++ if $posix_mkdir; then
++ (umask=$mkdir_umask &&
++ $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break
++ # Don't fail if two instances are running concurrently.
++ test -d "$prefix" || exit 1
++ else
++ case $prefix in
++ *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;;
++ *) qprefix=$prefix;;
++ esac
++ prefixes="$prefixes '$qprefix'"
++ fi
+ fi
+- pathcomp=$pathcomp/
++ prefix=$prefix/
+ done
+- obsolete_mkdir_used=true
++
++ if test -n "$prefixes"; then
++ # Don't fail if two instances are running concurrently.
++ (umask $mkdir_umask &&
++ eval "\$doit_exec \$mkdirprog $prefixes") ||
++ test -d "$dstdir" || exit 1
++ obsolete_mkdir_used=true
++ fi
+ fi
+ fi
+
+@@ -334,7 +439,7 @@
+ { test -z "$chowncmd" || $doit $chowncmd "$dst"; } &&
+ { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } &&
+ { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false ||
+- test -z "$chmodcmd" || $doit $chmodcmd "$mode" "$dst"; } || exit 1
++ test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1
+ else
+
+ # Make a couple of temp file names in the proper directory.
+@@ -345,7 +450,7 @@
+ trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0
+
+ # Copy the file name to the temp name.
+- $doit $cpprog "$src" "$dsttmp" &&
++ (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") &&
+
+ # and set any options; do chmod last to preserve setuid bits.
+ #
+@@ -353,41 +458,54 @@
+ # ignore errors from any of these, just make sure not to ignore
+ # errors from the above "$doit $cpprog $src $dsttmp" command.
+ #
+- { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } \
+- && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } \
+- && { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } \
+- && { test -z "$chmodcmd" || $doit $chmodcmd "$mode" "$dsttmp"; } &&
+-
+- # Now rename the file to the real destination.
+- { $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null \
+- || {
+- # The rename failed, perhaps because mv can't rename something else
+- # to itself, or perhaps because mv is so ancient that it does not
+- # support -f.
+-
+- # Now remove or move aside any old file at destination location.
+- # We try this two ways since rm can't unlink itself on some
+- # systems and the destination file might be busy for other
+- # reasons. In this case, the final cleanup might fail but the new
+- # file should still install successfully.
+- {
+- if test -f "$dst"; then
+- $doit $rmcmd -f "$dst" 2>/dev/null \
+- || { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null \
+- && { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }; }\
+- || {
+- echo "$0: cannot unlink or rename $dst" >&2
+- (exit 1); exit 1
+- }
+- else
+- :
+- fi
+- } &&
+-
+- # Now rename the file to the real destination.
+- $doit $mvcmd "$dsttmp" "$dst"
+- }
+- } || exit 1
++ { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } &&
++ { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } &&
++ { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } &&
++ { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } &&
++
++ # If -C, don't bother to copy if it wouldn't change the file.
++ if $copy_on_change &&
++ old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` &&
++ new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` &&
++
++ eval "$initialize_posix_glob" &&
++ $posix_glob set -f &&
++ set X $old && old=:$2:$4:$5:$6 &&
++ set X $new && new=:$2:$4:$5:$6 &&
++ $posix_glob set +f &&
++
++ test "$old" = "$new" &&
++ $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1
++ then
++ rm -f "$dsttmp"
++ else
++ # Rename the file to the real destination.
++ $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null ||
++
++ # The rename failed, perhaps because mv can't rename something else
++ # to itself, or perhaps because mv is so ancient that it does not
++ # support -f.
++ {
++ # Now remove or move aside any old file at destination location.
++ # We try this two ways since rm can't unlink itself on some
++ # systems and the destination file might be busy for other
++ # reasons. In this case, the final cleanup might fail but the new
++ # file should still install successfully.
++ {
++ test ! -f "$dst" ||
++ $doit $rmcmd -f "$dst" 2>/dev/null ||
++ { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null &&
++ { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }
++ } ||
++ { echo "$0: cannot unlink or rename $dst" >&2
++ (exit 1); exit 1
++ }
++ } &&
++
++ # Now rename the file to the real destination.
++ $doit $mvcmd "$dsttmp" "$dst"
++ }
++ fi || exit 1
+
+ trap '' 0
+ fi
+diff -Naur pvs4.2-orig/Makefile.in pvs4.2-sbcl/Makefile.in
+--- pvs4.2-orig/Makefile.in 2009-03-24 18:55:34.000000000 +0000
++++ pvs4.2-sbcl/Makefile.in 2009-03-24 18:56:17.000000000 +0000
+@@ -90,18 +90,18 @@
+ endif
+ endif
+
+-# ifneq ($(SBCL_HOME),)
+-# # Check that the given SBCL_HOME works
+-# SBCLISPEXE = $(SBCL_HOME)/bin/lisp
+-# ifeq ($(shell if [ -x "$(SBCLISPEXE)" ]; then echo OK; fi),OK)
+-# SBCLVERSION = $(shell $(SBCL_HOME)/bin/lisp -batch -eval '(progn (format t "~a" (lisp-implementation-version)) (terpri) (quit))')
+-# $(warning "SBCL Version $(SBCLVERSION)")
+-# sbcl-devel += $(bindir)/devel/$(SYSTEM)-sbclisp
+-# sbcl-rt += $(bindir)/runtime/$(SYSTEM)-sbclisp
+-# else
+-# $(error "$(SBCLISPEXE) is not executable")
+-# endif
+-# endif
++ifneq ($(SBCLISP_HOME),)
++# Check that the given SBCLISP_HOME works
++SBCLISPEXE = $(SBCLISP_HOME)/bin/sbcl
++ifeq ($(shell if [ -x "$(SBCLISPEXE)" ]; then echo OK; fi),OK)
++SBCLVERSION = $(shell $(SBCLISPEXE) --version)
++$(warning "$(SBCLVERSION)")
++sbcl-devel += $(bindir)/devel/$(SYSTEM)-sbclisp
++sbcl-rt += $(bindir)/runtime/$(SYSTEM)-sbclisp
++else
++$(error "$(SBCLISPEXE) is not executable")
++endif
++endif
+
+
+ LOAD-FOREIGN-EXTENSION=so
+@@ -342,6 +342,7 @@
+ src/tex-support.lisp \
+ src/raw-api.lisp
+
++sbcllisp += src/utils/file-utils-sbcl.lisp
+ cmulisp += src/utils/file-utils-cmu.lisp
+ allegrolisp += src/utils/file-utils.lisp
+
+@@ -372,6 +373,7 @@
+
+ bddlisp = BDD/bdd.lisp BDD/mu.lisp
+ allegrolisp += BDD/bdd-allegro.lisp BDD/mu-allegro.lisp
++sbcllisp += BDD/bdd-sbcl.lisp BDD/mu-sbcl.lisp
+ cmulisp += BDD/bdd-cmu.lisp BDD/mu-cmu.lisp
+
+ PVSiolisp = src/PVSio/pvs-lib.lisp src/PVSio/defattach.lisp \
+@@ -423,6 +425,7 @@
+ groundevallisp := $(patsubst %,$(PVSPATH)%,$(groundevallisp))
+ inst-by-unif-lisp := $(patsubst %,$(PVSPATH)%,$(inst-by-unif-lisp))
+ allegrolisp := $(patsubst %,$(PVSPATH)%,$(allegrolisp))
++sbcllisp := $(patsubst %,$(PVSPATH)%,$(sbcllisp))
+ cmulisp := $(patsubst %,$(PVSPATH)%,$(cmulisp))
+ endif
+
+@@ -437,16 +440,16 @@
+ .PHONY : all devel runtime parser emacs prelude-files-and-regions etags
+
+ ifneq ($(buildcmds),)
+-ifeq ($(CMULISP_HOME)$(ALLEGRO_HOME),)
+-$(error "Must set CMULISP_HOME or ALLEGRO_HOME")
++ifeq ($(SBCLISP_HOME)$(CMULISP_HOME)$(ALLEGRO_HOME),)
++$(error "Must set SBCLISP_HOME, CMULISP_HOME, or ALLEGRO_HOME")
+ endif
+ endif
+
+ all : devel runtime prelude-files-and-regions $(emacs-elc) etags
+
+-devel : $(allegro-devel) $(cmulisp-devel)
++devel : $(allegro-devel) $(sbcl-devel) $(cmulisp-devel)
+
+-runtime : $(allegro-rt) $(cmulisp-rt)
++runtime : $(allegro-rt) $(sbcl-rt) $(cmulisp-rt)
+
+ parser : pvs-parser-out
+
+@@ -454,8 +457,8 @@
+
+ etags : $(PVSPATH)TAGS
+
+-$(PVSPATH)TAGS : $(lisp-files) $(allegrolisp) $(cmulisp) $(pvs-emacs-src)
+- $(ETAGS) $(lisp-files) $(allegrolisp) $(cmulisp) $(pvs-emacs-src)
++$(PVSPATH)TAGS : $(lisp-files) $(allegrolisp) $(sbcllisp) $(cmulisp) $(pvs-emacs-src)
++ $(ETAGS) $(lisp-files) $(allegrolisp) $(sbcllisp) $(cmulisp) $(pvs-emacs-src)
+
+ fileutils = \
+ $(PVSPATH)src/utils/$(PLATFORM)/file_utils.$(LOAD-FOREIGN-EXTENSION) \
+@@ -472,6 +475,56 @@
+ # Here are the rules for building the PVS grammar, pvs-methods file, and
+ # devel and runtime images.
+
++ifneq ($(SBCLISP_HOME),)
++
++ifeq ($(ALLEGRO_HOME),) # Build these with Allegro, if available
++$(PVSPATH)src/pvs-lexer.lisp : $(pvs-parser-in)
++ @echo "******* Creating parser"
++ $(SBCLISPEXE) --load src/make-pvs-parser
++
++$(PVSPATH)src/pvs-methods.lisp : $(PVSPATH)src/make-pvs-methods.lisp \
++ $(PVSPATH)src/defcl.lisp \
++ $(PVSPATH)src/classes-expr.lisp \
++ $(PVSPATH)src/classes-decl.lisp
++ @echo "******* Creating pvs-methods.lisp"
++ $(SBCLISPEXE) --eval "(defvar *pvs-path* \"$(PVSPATH)\")" \
++ --load src/make-pvs-methods.lisp
++endif
++
++$(sbcl-devel) $(sbcl-rt) : $(image-deps) \
++ $(pvs-make-files) $(ess) $(ff-files) \
++ $(lisp-files) $(sbcllisp) \
++ $(PVSPATH)lib/prelude.pvs $(PVSPATH)lib/prelude.prf
++ $(MKDIR) -p $(subst $(SYSTEM)-sbclisp,,$@)
++ @echo "******* Compiling PVS files in Steel Bank Common Lisp (SBCL)"
++ $(SBCLISPEXE) --eval '(require :sb-posix)' \
++ --eval '(require :sb-md5)' \
++ --eval '(load "pvs.system" :verbose t)' \
++ --eval "(let ((*load-pvs-prelude* nil)) \
++ (mk:operate-on-system :pvs :compile))" \
++ --eval '(quit)'
++ cp $(PVSPATH)src/utils/$(PLATFORM)/b64 $(bindir)
++ @echo "******* Building PVS image $@"
++ $(SBCLISPEXE) --eval '(require :sb-posix)' \
++ --eval '(require :sb-md5)' \
++ --eval '(load "pvs.system" :verbose t)' \
++ --eval "(unwind-protect \
++ (mk:operate-on-system :pvs :compile) \
++ (save-lisp-and-die \"$@.core\" \
++ :toplevel (function startup-pvs) \
++ ))"
++ -rm $(PVSPATH)BDD/$(PLATFORM)/bdd-sbcl.*
++ cp $(SBCLISPEXE) $(subst $(SYSTEM)-sbclisp,,$@)
++ cp $(PVSPATH)BDD/$(PLATFORM)/mu.$(LOAD-FOREIGN-EXTENSION) $(subst $(SYSTEM)-sbclisp,,$@)
++ cp $(PVSPATH)BDD/bdd-sbcl.lisp $(PVSPATH)BDD/mu-sbcl.lisp $(subst $(SYSTEM)-sbclisp,,$@)
++ cp $(PVSPATH)src/WS1S/$(PLATFORM)/ws1s.$(LOAD-FOREIGN-EXTENSION) $(subst $(SYSTEM)-sbclisp,,$@)
++ cp $(PVSPATH)src/WS1S/lisp/dfa-foreign-sbcl.lisp $(subst $(SYSTEM)-sbclisp,,$@)
++ cp $(PVSPATH)src/utils/$(PLATFORM)/b64 $(bindir)
++ echo "#!/bin/sh" > $@
++ echo "sbcl --core \`dirname \$$0\`/\`basename \$$0\`.core \$$*" >> $@
++ chmod a+x $@
++endif
++
+ ifneq ($(CMULISP_HOME),)
+
+ ifeq ($(ALLEGRO_HOME),) # Build these with Allegro, if available
+@@ -621,7 +674,7 @@
+
+ faslexts = fasl,rfasl,hfasl,lfasl,mfasl,nfasl,sbin,obin,rbin,mbin,x86f,ppcf,sparcf,x8664s,x86s,ppcs,sparcs,clfasl,wfasl,err
+
+-platforms = ix86-Linux,ix86-MacOSX,powerpc-MacOSX,powerpc-MacOSX,sun4-SunOS5
++platforms = ix86-Linux,ix86_64-Linux,ix86-MacOSX,powerpc-MacOSX,powerpc-MacOSX,sun4-SunOS5
+ # HT: Need to put a comma in a variable, because a literal
+ # comma cannot appear in a makefile function argument.
+ comma:= ,
+diff -Naur pvs4.2-orig/pvs-config.lisp pvs4.2-sbcl/pvs-config.lisp
+--- pvs4.2-orig/pvs-config.lisp 2008-07-20 08:40:19.000000000 +0000
++++ pvs4.2-sbcl/pvs-config.lisp 2009-03-24 18:56:17.000000000 +0000
+@@ -99,7 +99,7 @@
+
+ #+sbcl
+ (defun bye (&optional (exit-status 0))
+- (sb-unix:unix-exit exit-status))
++ (quit :unix-status exit-status))
+
+ (defun pvs-version-and-quit ()
+ (format t "PVS Version ~a" (eval (find-symbol (string :*pvs-version*) :pvs)))
+diff -Naur pvs4.2-orig/pvs.in pvs4.2-sbcl/pvs.in
+--- pvs4.2-orig/pvs.in 2008-07-20 08:48:14.000000000 +0000
++++ pvs4.2-sbcl/pvs.in 2009-03-24 18:56:17.000000000 +0000
+@@ -11,7 +11,7 @@
+ # -version | --version prints the PVS version
+ # -emacs emacsref emacs, xemacs, alias, or pathname
+ # -load-after efile loads emacs file name after PVS emacs files
+-# -lisp name lisp image name - allegro or cmulisp
++# -lisp name lisp image name - allegro, cmulisp, or sbclisp
+ # -runtime use the runtime image (devel is default, if there)
+ # -decision-procedures set the default decision procedures (ics or shostak)
+ # -force-decision-procedures forces the decision procedures to be used
+@@ -42,10 +42,10 @@
+ # PVSVERBOSE - corresponds to the -v argument
+ #
+ # The following environment variables are used by PVS, and are set below:
+-# PVSPATH pvs system path - this should not normally be set by the user
+-# PVSARCH sun4 or ix86
++# PVSPATH pvs system path - this should not normally be set by the user
++# PVSARCH sun4, ix86, ix86_64, or powerpc
+ #
+-# The PVS binary paths are appended to the front of the PATH variable
++# The PVS binary paths are appended to the front of the PATH variable
+ # --------------------------------------------------------------------
+ # PVS
+ # Copyright (C) 2006, SRI International. All Rights Reserved.
+@@ -98,7 +98,8 @@
+ case $2 in
+ allegro) PVSLISP=allegro;;
+ cmulisp) PVSLISP=cmulisp;;
+- *) echo "Only allegro and cmulisp are currently available"
++ sbclisp) PVSLISP=sbclisp;;
++ *) echo "Only allegro, cmulisp, and sbclisp are currently available"
+ exit 1;;
+ esac
+ shift;;
+@@ -170,7 +171,7 @@
+ -version | --version show the PVS version number
+ -emacs emacsref emacs, xemacs, alias, or pathname
+ -load-after efile loads emacs file after PVS emacs files
+- -lisp name lisp image name (allegro or cmulisp)
++ -lisp name lisp image name (allegro, cmulisp, or sbclisp)
+ -runtime use the runtime image
+ -decision-procedures set default decision procedures (ics or shostak)
+ -force-decision-procedures forces the decision procedures (ics or shostak)
+@@ -198,13 +199,17 @@
+ case $opsys in
+ SunOS) majvers=`uname -r | cut -d"." -f1`
+ if [ $majvers = 4 ]
+- then echo "PVS 3.3 only runs under Mac OS X, Linux, FreeBSD, or Solaris"; exit 1
++ then echo "PVS 4.2 only runs under Mac OS X, Linux, FreeBSD, or Solaris"; exit 1
+ fi
+ PVSARCH=sun4;;
+ Linux) # If Linux, we need to determine the Redhat version to use.
+ opsys=Linux
+ majvers=
+- PVSARCH=ix86
++ case `uname -m` in
++ x86) PVSARCH=ix86 ;;
++ x86_64) PVSARCH=ix86_64 ;;
++ *) echo "PVS 4.2 only runs on Intel Linux"; exit 1
++ esac
+ # Allegro does not work with Linux's New Posix Thread Library (NPTL)
+ # used in newer Red Hat kernels and 2.6 kernels. This will force
+ # the old thread-implementation.
+@@ -215,7 +220,11 @@
+ ;;
+ FreeBSD) opsys=Linux
+ majvers=
+- PVSARCH=ix86
++ case `uname -m` in
++ x86) PVSARCH=ix86 ;;
++ x86_64) PVSARCH=ix86_64 ;;
++ *) echo "PVS 4.2 only runs on Intel Linux"; exit 1
++ esac
+ # Allegro does not work with Linux's New Posix Thread Library (NPTL)
+ # used in newer Red Hat kernels and 2.6 kernels. This will force
+ # the old thread-implementation.
+@@ -233,13 +242,13 @@
+ #majvers=`uname -r | cut -d"." -f1`
+ majvers=
+ ;;
+- *) echo "PVS 3.3 only runs under Solaris, Linux, FreeBSD (linux-enabled), or Mac (Darwin 7.4)"; exit 1
++ *) echo "PVS 4.2 only runs under Solaris, Linux, FreeBSD (linux-enabled), or Mac (Darwin 7.4)"; exit 1
+ esac
+
+ binpath=$PVSPATH/bin/$PVSARCH-$opsys${majvers}
+
+-if [ -n "$PVSLISP" -a "$PVSLISP" != "allegro" -a "$PVSLISP" != "cmulisp" ]
+- then echo "ERROR: PVSLISP must be unset, or set to 'allegro' or 'cmulisp'"
++if [ -n "$PVSLISP" -a "$PVSLISP" != "allegro" -a "$PVSLISP" != "cmulisp" -a "$PVSLISP" != "sbclisp" ]
++ then echo "ERROR: PVSLISP must be unset, or set to 'allegro', 'cmulisp', or 'sbclisp'"
+ exit 1
+ fi
+
+@@ -252,6 +261,10 @@
+ then PVSLISP=cmulisp
+ elif [ -x $binpath/runtime/pvs-cmulisp ]
+ then PVSLISP=cmulisp
++ elif [ -x $binpath/devel/pvs-sbclisp ]
++ then PVSLISP=sbclisp
++ elif [ -x $binpath/runtime/pvs-sbclisp ]
++ then PVSLISP=sbclisp
+ else echo "No executable available in $binpath"
+ exit 1
+ fi
+@@ -292,6 +305,16 @@
+ do flags="$flags -load $lf"; done
+ fi
+ ;;
++ sbclisp)
++ noinit="--noinform --no-userinit"
++ evalflag="--eval"
++ if [ -n "$lisploadfiles" ]
++ then
++ flags="$flags --eval (pvs::pvs-init)"
++ for lf in $lisploadfiles
++ do flags="$flags --load $lf"; done
++ fi
++ ;;
+ esac
+
+ PVSPATCHLEVEL=${PVSPATCHLEVEL:-2}
+diff -Naur pvs4.2-orig/pvsio.in pvs4.2-sbcl/pvsio.in
+--- pvs4.2-orig/pvsio.in 2007-11-09 20:39:43.000000000 +0000
++++ pvs4.2-sbcl/pvsio.in 2009-03-24 18:56:17.000000000 +0000
+@@ -22,7 +22,7 @@
+ -T|--timing print timing information for each evaluation
+ -v|--version print PVSio version
+ -V|--verbose print typechecking information
+- -l|--lisp PVS lisp version [allegro,cmulisp]
++ -l|--lisp PVS lisp version [allegro,cmulisp,sbclisp]
+ <file>@<theory>:<main> load <theory> from <file>.pvs, evaluate <main>,
+ and exit
+
+@@ -42,7 +42,8 @@
+ case $2 in
+ allegro) PVSLISP='-lisp allegro';;
+ cmulisp) PVSLISP='-lisp cmulisp';;
+- *) echo "Only allegro and cmulisp are currently available"
++ sbclisp) PVSLISP='-lisp sbclisp';;
++ *) echo "Only allegro, cmulisp, and sbclisp are currently available"
+ exit 1;;
+ esac
+ shift;;
+diff -Naur pvs4.2-orig/pvs-sbcl.spec pvs4.2-sbcl/pvs-sbcl.spec
+--- pvs4.2-orig/pvs-sbcl.spec 1970-01-01 00:00:00.000000000 +0000
++++ pvs4.2-sbcl/pvs-sbcl.spec 2009-03-24 18:56:17.000000000 +0000
+@@ -0,0 +1,131 @@
++Name: pvs-sbcl
++Version: 4.2
++Release: 1%{?dist}
++Summary: The PVS Verification System, SBCL build
++
++Group: Applications/Engineering
++License: GPLv2+
++URL: http://pvs.csl.sri.com/
++Source0: http://pvs.csl.sri.com/download-open/pvs-%{version}-source.tgz
++Source1: http://pvs.csl.sri.com/doc/pvs-prelude.pdf
++Source2: http://pvs.csl.sri.com/doc/interpretations.pdf
++Source3: http://pvs.csl.sri.com/papers/csl-97-2/csl-97-2.ps.gz
++Source4: http://pvs.csl.sri.com/papers/csl-93-9/csl-93-9.ps.gz
++Patch0: pvs-4.2-sbcl.patch
++Patch1: pvs-4.2-unused.patch
++Patch2: pvs-4.2-64bit.patch
++Patch3: pvs-4.2-mona.patch
++Patch4: pvs-4.2-config.patch
++Patch5: pvs-4.2-typo.patch
++Patch6: pvs-4.2-emacs.patch
++Patch7: pvs-4.2-latex.patch
++BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
++
++BuildRequires: sbcl, texinfo-tex, texlive-latex, emacs-el, xemacs-devel
++Requires: sbcl, texlive-latex
++Provides: pvs = %{version}-%{release}, pvsio = %{version}-%{release}
++
++%description
++PVS is a verification system: that is, a specification language integrated
++with support tools and a theorem prover. It is intended to capture the
++state-of-the-art in mechanized formal methods and to be sufficiently rugged
++that it can be used for significant applications. PVS is a research
++prototype: it evolves and improves as we develop or apply new capabilities,
++and as the stress of real use exposes new requirements.
++
++%prep
++%setup -q -c
++cp -p %{SOURCE1} %{SOURCE2} %{SOURCE3} %{SOURCE4} .
++
++# Enable support for building PVS with sbcl
++%patch0 -p1
++
++# Get rid of an unused variable warning
++%patch1 -p1
++
++# Enable building on 64-bit platforms
++%patch2 -p1
++
++# Enable use of a system-installed Mona
++%patch3 -p1
++
++# Update config.sub and config.guess so they'll recognize amd64- systems
++%patch4 -p1
++
++# Fix a few typographical errors that result in miscompilations
++%patch5 -p1
++
++# Modernize the Emacs interface
++%patch6 -p1
++
++# Use the fancyhdr package instead of the obsolete fancyheadings package.
++# Also don't try to make Emacs kill an already dead process.
++%patch7 -p1
++
++%build
++./configure CFLAGS="$RPM_OPT_FLAGS -fPIC"
++make SBCLISP_HOME=/usr PVSPATH=`pwd`/
++
++# Now that we're done building, we don't want the devel version
++rm -fr bin/*/devel
++
++# We also don't want the useless copy of the sbcl binary
++rm -f bin/*/runtime/sbcl
++
++# Run it once to force Lisp compilation of the native interfaces
++bin/relocate > /dev/null
++echo -e '(sb-ext:quit :recklessly-p t)' | ./pvs -raw
++
++# Get rid of some emacs save files and CVS control files
++find . -name .cvsignore -o -name \*~ | xargs rm -f
++
++# Get rid of some temporary files we no longer need
++rm -f doc/release-notes/pvs-release-notes.{pg,ky,tp,fn,cp,vr}
++
++# Build the documentation
++make -C doc/language
++mv doc/language/language.pdf pvs-language-reference.pdf
++
++make -C doc/prover
++mv doc/prover/prover.pdf pvs-prover-guide.pdf
++
++rm -f doc/release-notes/pvs-release-notes.pdf
++make -C doc/release-notes pvs-release-notes.pdf
++
++make -C doc/user-guide
++mv doc/user-guide/user-guide.pdf pvs-system-guide.pdf
++
++# Mimic the effects of the relocate script for the installed location
++sed -i -e "s,^PVSPATH=.*$,PVSPATH=%{_datadir}/pvs," pvs
++sed -i -e "s,^PVSPATH=.*$,PVSPATH=%{_datadir}/pvs," pvsio
++
++%install
++rm -rf $RPM_BUILD_ROOT
++mkdir -p $RPM_BUILD_ROOT%{_bindir}
++mkdir -p $RPM_BUILD_ROOT%{_datadir}/pvs/doc/release-notes
++mkdir -p $RPM_BUILD_ROOT%{_datadir}/texmf/tex/latex/pvs
++cp -a bin emacs lib pvs-tex.sub wish $RPM_BUILD_ROOT%{_datadir}/pvs
++cp -a doc/release-notes/pvs-release-notes.info $RPM_BUILD_ROOT%{_datadir}/pvs/doc/release-notes
++cp -a pvs.sty $RPM_BUILD_ROOT%{_datadir}/texmf/tex/latex/pvs
++cp -a pvs pvsio $RPM_BUILD_ROOT%{_bindir}
++
++# We don't need the relocate script
++rm -f $RPM_BUILD_ROOT%{_datadir}/pvs/bin/relocate
++
++%clean
++rm -rf $RPM_BUILD_ROOT
++
++%post -p /usr/bin/mktexlsr
++
++%postun -p /usr/bin/mktexlsr
++
++%files
++%defattr(-,root,root,-)
++%doc *.pdf *.ps.gz LICENSE NOTICES README doc/PVSio-2.d.pdf Examples
++%{_bindir}/pvs*
++%{_datadir}/pvs
++%{_datadir}/texmf/tex/latex/pvs
++
++%changelog
++* Fri Jan 23 2009 Jerry James <loganjerry@gmail.com> - 4.2-1
++- Initial package, based on cmulisp package
+diff -Naur pvs4.2-orig/pvs.system pvs4.2-sbcl/pvs.system
+--- pvs4.2-orig/pvs.system 2007-09-20 05:19:31.000000000 +0000
++++ pvs4.2-sbcl/pvs.system 2009-03-24 18:56:17.000000000 +0000
+@@ -25,6 +25,16 @@
+ ;; Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ ;; --------------------------------------------------------------------
+
++(in-package :common-lisp)
++
++(#-(or cmu sbcl) progn
++ #+cmu ext:without-package-locks
++ #+sbcl sb-ext:without-package-locks
++ (defmacro defconstant-if-unbound (name value &optional doc)
++ `(defconstant ,name (if (boundp ',name) (symbol-value ',name) ,value)
++ ,@(when doc (list doc))))
++ (export 'defconstant-if-unbound))
++
+ (in-package :cl-user)
+
+ #+allegro
+@@ -46,9 +56,11 @@
+ #+sbcl
+ (defun startup-pvs ()
+ (in-package :pvs)
+- ;; Can't directly call (pvs::pvs-init)
+- (apply (find-symbol (string :pvs-init) :pvs) nil)
+- )
++ ;; Turn off compiler warnings
++ (handler-bind ((sb-ext:compiler-note #'muffle-warning))
++ ;; Can't directly call (pvs::pvs-init)
++ (apply (find-symbol (string :pvs-init) :pvs) nil)
++ (sb-impl::toplevel-init)))
+
+ #+allegro
+ (eval-when (eval load)
+@@ -59,12 +71,17 @@
+ excl:*enclose-printer-errors* nil
+ *print-pretty* t))
+
++#+sbcl
++(eval-when (eval load)
++ (setq *compile-verbose* nil)
++ (setq *compile-print* nil))
++
+ (eval-when (eval load)
+ ;; This sets *pvs-path* and sets *pvs-binary-type*
+ (load "pvs-config.lisp")
+ #+allegro (chdir *pvs-path*))
+
+-(defpackage :ilisp)
++(defpackage :ilisp (:nicknames :ILISP) (:use :common-lisp #+:CMU :conditions))
+ (defpackage :bvec)
+
+ (unless (find-package :make)
+@@ -181,7 +198,11 @@
+ (load (format nil "~a/src/xp" *pvs-path*))
+ #+gcl
+ (load (format nil "~a/src/xp-code" *pvs-path*))
+- (apply (find-symbol :install :xp) :package :pvs nil))
++ #-sbcl
++ (apply (find-symbol :install :xp) :package :pvs nil)
++ #+sbcl
++ (apply (find-symbol "INSTALL" (find-package :xp))
++ :package :pvs nil))
+ #-(or cmu sbcl)
+ (load (format nil "~a/ess/dist-ess.lisp" *pvs-path*))
+ #-gcl
+@@ -215,6 +236,7 @@
+ (let* ((platform #+(and sun4 sunos4) "sun4-SunOS4"
+ #+(and sun4 (not sunos4)) "sun4-SunOS5"
+ #+(and x86 (not macosx)) "ix86-Linux"
++ #+(and x86-64 (not macosx)) "ix86_64-Linux"
+ #+(and macosx powerpc) "powerpc-MacOSX"
+ #+(and macosx x86) "ix86-MacOSX")
+ (utilpath (concatenate 'string
+@@ -281,7 +303,9 @@
+ :components ((:file "hashfn")
+ #+allegro
+ (:file "file-utils")
+- #+(or cmu sbcl)
++ #+sbcl
++ (:file "file-utils-sbcl")
++ #+cmu
+ (:file "file-utils-cmu")))
+ (:module language
+ :source-pathname "src/"
+diff -Naur pvs4.2-orig/src/abstraction/abstract.lisp pvs4.2-sbcl/src/abstraction/abstract.lisp
+--- pvs4.2-orig/src/abstraction/abstract.lisp 2007-07-02 20:07:40.000000000 +0000
++++ pvs4.2-sbcl/src/abstraction/abstract.lisp 2009-03-24 18:56:17.000000000 +0000
+@@ -27,7 +27,7 @@
+ ;; Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ ;; --------------------------------------------------------------------
+
+-(in-package 'pvs)
++(in-package :pvs)
+
+
+ (defvar *abs-cache+* nil)
+diff -Naur pvs4.2-orig/src/classes-decl.lisp pvs4.2-sbcl/src/classes-decl.lisp
+--- pvs4.2-orig/src/classes-decl.lisp 2007-07-02 20:07:40.000000000 +0000
++++ pvs4.2-sbcl/src/classes-decl.lisp 2009-03-24 18:56:17.000000000 +0000
+@@ -141,7 +141,7 @@
+ type-name type-name? type-value types update-expr using-hash
+ var-decl visible?))
+ #+(or cmu sbcl)
+-(ext:without-package-locks
++(#-sbcl ext:without-package-locks #+sbcl sb-ext:without-package-locks
+ (defgeneric class (x))
+ (defgeneric (setf class) (x y))
+ (defgeneric keyword (x))
+@@ -338,6 +338,9 @@
+ ;;; unparser. The type is set by the typechecker to the canonical value
+ ;;; of the declared-type.
+
++(
++ #-sbcl progn
++ #+sbcl sb-ext:without-package-locks
+ (defcl declaration (syntax)
+ (newline-comment :restore-as nil)
+ (id :type (or symbol number) :parse t :restore-as nil)
+@@ -353,6 +356,7 @@
+ (semi :parse t :restore-as nil)
+ (tcc-form :fetch-as nil :ignore t)
+ (typecheck-time :restore-as nil))
++)
+
+ ;;; declared-type-string keeps the string of the declared type for
+ ;;; creating the pvs context - see create-declaration-entry
+diff -Naur pvs4.2-orig/src/classes-expr.lisp pvs4.2-sbcl/src/classes-expr.lisp
+--- pvs4.2-orig/src/classes-expr.lisp 2007-10-11 00:11:41.000000000 +0000
++++ pvs4.2-sbcl/src/classes-expr.lisp 2009-03-24 18:56:17.000000000 +0000
+@@ -35,7 +35,7 @@
+ propositional-application))
+
+ #+(or cmu sbcl)
+-(ext:without-package-locks
++(#-sbcl ext:without-package-locks #+sbcl sb-ext:without-package-locks
+ (defgeneric type (x))
+ (defgeneric (setf type) (x y))
+ (defgeneric number (x))
+@@ -45,7 +45,7 @@
+
+ #+(or cmu sbcl)
+ ;; This is actually defined in utils, but convenient to add here
+-(ext:without-package-locks
++(#-sbcl ext:without-package-locks #+sbcl sb-ext:without-package-locks
+ (defgeneric condition (x)))
+
+ ;;; Provide a class on which to hang syntactic information
+@@ -172,8 +172,13 @@
+ ;; When an extraction-expr is used as a conversion
+ (defcl extraction-conversion (extraction-application))
+
++#-sbcl
+ (defcl number-expr (expr)
+ (number :type integer :parse t :restore-as nil))
++#+sbcl
++(sb-ext:without-package-locks
++ (defcl number-expr (expr)
++ (number :type integer :parse t :restore-as nil)))
+
+ ;; This is for integers of the form xxx.000, where the fractional part is
+ ;; all zeros. We keep it as a number expr, but store the number of zeros so
+@@ -529,10 +534,17 @@
+ ;;; resolution. The inclusions are the predicates which will become
+ ;;; TCCs if that particular resolution is chosen.
+
++#-sbcl
+ (defcl resolution ()
+ (declaration :restore-as nil)
+ module-instance
+ type)
++#+sbcl
++(sb-ext:without-package-locks
++ (defcl resolution ()
++ (declaration :restore-as nil)
++ module-instance
++ type))
+
+ ;(defcl judgement-resolution (resolution)
+ ; judgement-type
+diff -Naur pvs4.2-orig/src/context.lisp pvs4.2-sbcl/src/context.lisp
+--- pvs4.2-orig/src/context.lisp 2008-05-11 20:34:50.000000000 +0000
++++ pvs4.2-sbcl/src/context.lisp 2009-03-24 18:56:17.000000000 +0000
+@@ -402,8 +402,9 @@
+ subdir))
+ (multiple-value-bind (result err)
+ (ignore-lisp-errors #+allegro (excl:make-directory subdir)
+- #+(or cmu sbcl)
+- (unix:unix-mkdir (namestring subdir) #o777))
++ #+cmu (unix:unix-mkdir (namestring subdir) #o777)
++ #+sbcl
++ (sb-unix:unix-mkdir (namestring subdir) #o777))
+ (cond (result (pvs-message "Created directory ~a" subdir)
+ t)
+ (t (pvs-message "Error creating ~a: ~a" subdir err)
+@@ -534,7 +535,7 @@
+
+ #+(or cmu sbcl)
+ (defun md5-file (file)
+- (let ((digest (md5:md5sum-file file))
++ (let ((digest (#+cmu md5:md5sum-file #+sbcl sb-md5:md5sum-file file))
+ (sum 0))
+ (loop for x across digest
+ do (setq sum (+ (* sum 256) x)))
+diff -Naur pvs4.2-orig/src/datatype.lisp pvs4.2-sbcl/src/datatype.lisp
+--- pvs4.2-orig/src/datatype.lisp 2008-05-11 20:36:59.000000000 +0000
++++ pvs4.2-sbcl/src/datatype.lisp 2009-03-24 18:56:17.000000000 +0000
+@@ -203,7 +203,8 @@
+ (checksum-ok? (and adt-ce
+ file-exists?
+ (equal #+allegro (excl:md5-file adt-path)
+- #-allegro (md5:md5sum-file adt-path)
++ #+sbcl (sb-md5:md5sum-file adt-path)
++ #-(or allegro sbcl) (md5:md5sum-file adt-path)
+ (ce-md5sum adt-ce)))))
+ (unless (and file-exists?
+ ce
+diff -Naur pvs4.2-orig/src/defcl.lisp pvs4.2-sbcl/src/defcl.lisp
+--- pvs4.2-orig/src/defcl.lisp 2007-07-02 20:07:40.000000000 +0000
++++ pvs4.2-sbcl/src/defcl.lisp 2009-03-24 18:56:17.000000000 +0000
+@@ -51,11 +51,13 @@
+ (defmacro defcl (name classes &rest args)
+ (setf args (mapcar #'(lambda (a) (if (consp a) a (list a))) args))
+ `(progn ,@(mapcar #'(lambda (a)
+- #+allegro `(declaim (ftype (function
++ #+(or allegro sbcl)
++ `(declaim (ftype (function
+ (t)
+ ,(cadr (member :type a)))
+ ,(car a)))
+- #-allegro `(proclaim '(function ,(car a) (t)
++ #-(or allegro sbcl)
++ `(proclaim '(function ,(car a) (t)
+ ,(cadr (member :type a)))))
+ (remove-if-not #'(lambda (a) (member :type a))
+ args))
+diff -Naur pvs4.2-orig/src/defsystem.lisp pvs4.2-sbcl/src/defsystem.lisp
+--- pvs4.2-orig/src/defsystem.lisp 2007-07-06 19:08:53.000000000 +0000
++++ pvs4.2-sbcl/src/defsystem.lisp 2009-03-24 18:56:17.000000000 +0000
+@@ -4796,7 +4796,7 @@
+ :loader #+:lucid #'load-foreign-files
+ #+:allegro #'load
+ #+(or :cmu :scl) #'alien:load-foreign
+- #+:sbcl #'sb-alien:load-foreign
++ #+:sbcl #'sb-alien:load-shared-object
+ #+(and :lispworks :unix (not :linux) (not :macosx)) #'link-load:read-foreign-modules
+ #+(and :lispworks :unix (or :linux :macosx)) #'fli:register-module
+ #+(and :lispworks :win32) #'fli:register-module
+diff -Naur pvs4.2-orig/src/globals.lisp pvs4.2-sbcl/src/globals.lisp
+--- pvs4.2-orig/src/globals.lisp 2008-07-17 18:12:19.000000000 +0000
++++ pvs4.2-sbcl/src/globals.lisp 2009-03-24 18:56:17.000000000 +0000
+@@ -346,7 +346,9 @@
+ (pprint-indent :block 0)
+ (loop (pprint-exit-if-list-exhausted)
+ (write (pprint-pop) :stream stream :escape nil :pretty nil
+- :pprint-dispatch nil)
++ :pprint-dispatch #-sbcl nil
++ #+sbcl (sb-pretty::make-pprint-dispatch-table)
++ )
+ (pprint-exit-if-list-exhausted)
+ (pprint-newline :mandatory stream)))))
+
+@@ -385,6 +387,7 @@
+
+ (defvar *use-default-dp?* nil)
+ (defvar *prover-print-lines* nil)
++#-sbcl
+ (defvar *print-lines* nil)
+
+ (defvar *substit-dont-simplify* nil)
+diff -Naur pvs4.2-orig/src/groundeval/eval-utils.lisp pvs4.2-sbcl/src/groundeval/eval-utils.lisp
+--- pvs4.2-orig/src/groundeval/eval-utils.lisp 2007-07-02 20:07:40.000000000 +0000
++++ pvs4.2-sbcl/src/groundeval/eval-utils.lisp 2009-03-24 18:56:17.000000000 +0000
+@@ -68,14 +68,14 @@
+ (defmethod print-object ((obj eval-info) stream)
+ (if *debugging-print-object*
+ (call-next-method)
+- (format stream "~@<#<eval-info ~2I~_~:0Iinternal: ~W~:@_external: ~W>~:>"
++ (format stream "~@<#<eval-info ~2I~_~0:Iinternal: ~W~:@_external: ~W>~:>"
+ (internal obj) (external obj))))
+
+ (defmethod print-object ((obj eval-defn-info) stream)
+ (if *debugging-print-object*
+ (call-next-method)
+ (format stream
+- "~@<#<eval-defn-info ~2I~_~:0Iunary: ~W~:@_multiary: ~W~:@_destructive: ~W>~:>"
++ "~@<#<eval-defn-info ~2I~_~0:Iunary: ~W~:@_multiary: ~W~:@_destructive: ~W>~:>"
+ (unary obj) (multiary obj) (destructive obj))))
+
+ (defmethod print-object ((obj eval-defn) stream)
+diff -Naur pvs4.2-orig/src/groundeval/ground-expr.lisp pvs4.2-sbcl/src/groundeval/ground-expr.lisp
+--- pvs4.2-orig/src/groundeval/ground-expr.lisp 2007-07-02 20:07:40.000000000 +0000
++++ pvs4.2-sbcl/src/groundeval/ground-expr.lisp 2009-03-24 18:56:17.000000000 +0000
+@@ -29,7 +29,7 @@
+ ; -- no free variables
+ ;
+
+-(in-package 'pvs)
++(in-package :pvs)
+
+ (defun ground-expr? (expr)
+ (assert (type expr))
+diff -Naur pvs4.2-orig/src/groundeval/pvs2clean.lisp pvs4.2-sbcl/src/groundeval/pvs2clean.lisp
+--- pvs4.2-orig/src/groundeval/pvs2clean.lisp 2007-07-02 20:07:40.000000000 +0000
++++ pvs4.2-sbcl/src/groundeval/pvs2clean.lisp 2009-03-24 18:56:17.000000000 +0000
+@@ -138,7 +138,7 @@
+
+ (defmethod pvs2clean* ((expr projection-application) bindings livevars)
+ (let* ((ll (length (exprs expr)))
+- (dummy (gentemp 'ddd))
++ (dummy (gentemp "DDD"))
+ (match-list (pvs2clean_tuple (matchlist (index expr) ll dummy)))
+ (expr-list (pvs2clean* expr bindings livevars)))
+ `(let ,match-list = ,expr-list in ,dummy)))
+@@ -177,7 +177,7 @@
+ (updateable-free-formal-vars operator)
+ livevars))))
+ (if (clean-updateable? (type operator))
+- (format nil "(pvsSelect ~a ~a)"
++ (format nil "(pvsSelect ~a ~a ~a)"
+ clean-op clean-arg
+ (mk-clean-funcall clean-op
+ (list clean-arg))))))))
+@@ -375,6 +375,7 @@
+ livevars))))))
+ (if else-part
+ (format nil "~a ~% _ -> ~a"
++ selections-clean
+ (pvs2clean* (expression else-part) bindings livevars))
+ selections-clean)))
+
+diff -Naur pvs4.2-orig/src/groundeval/pvseval-update.lisp pvs4.2-sbcl/src/groundeval/pvseval-update.lisp
+--- pvs4.2-orig/src/groundeval/pvseval-update.lisp 2007-12-01 23:04:01.000000000 +0000
++++ pvs4.2-sbcl/src/groundeval/pvseval-update.lisp 2009-03-24 18:56:17.000000000 +0000
+@@ -47,7 +47,7 @@
+ (if (special-variable-p id)
+ (let ((lid (gethash id *lisp-id-hash*)))
+ (or lid
+- (let ((new-lid (intern (gensym (string id)))))
++ (let ((new-lid (intern (symbol-name (gensym (string id))))))
+ (setf (gethash id *lisp-id-hash*) new-lid)
+ new-lid)))
+ id))
+@@ -1779,7 +1779,7 @@
+ :if-exists
+ (if supersede? :supersede :append)
+ :if-does-not-exist :create)
+- (when supersede? (format output "(in-package 'PVS)~%"))
++ (when supersede? (format output "(in-package :pvs)~%"))
+ (print-lisp-defns-to-output (get-theory theory) output))
+ (print-lisp-defns-to-output (get-theory theory) nil)))
+
+diff -Naur pvs4.2-orig/src/groundeval/static-update.lisp pvs4.2-sbcl/src/groundeval/static-update.lisp
+--- pvs4.2-orig/src/groundeval/static-update.lisp 2007-07-02 20:07:40.000000000 +0000
++++ pvs4.2-sbcl/src/groundeval/static-update.lisp 2009-03-24 18:56:17.000000000 +0000
+@@ -42,7 +42,7 @@
+ ;; Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ ;; --------------------------------------------------------------------
+
+-(in-package 'pvs)
++(in-package :pvs)
+
+ (defmethod updateable? ((texpr tupletype))
+ (updateable? (types texpr)))
+diff -Naur pvs4.2-orig/src/ground-prover/prglobals.lisp pvs4.2-sbcl/src/ground-prover/prglobals.lisp
+--- pvs4.2-orig/src/ground-prover/prglobals.lisp 2007-07-02 20:07:40.000000000 +0000
++++ pvs4.2-sbcl/src/ground-prover/prglobals.lisp 2009-03-24 18:56:17.000000000 +0000
+@@ -46,7 +46,7 @@
+ (defconstant true 'true )
+ (defconstant false 'false )
+
+-(defconstant primtypealist
++(defconstant-if-unbound primtypealist
+ '((true . bool)
+ (false . bool)
+ (and . bool)
+@@ -139,16 +139,16 @@
+
+ ;;; the following special declarations are rather offensive:
+
+-(proclaim '(special const sum u s eq lit var coef product ineqpot ))
++(proclaim '(special const sum u s #-sbcl eq lit var coef product ineqpot ))
+
+
+ ;;; the following (til end-of-file) are taken from prpp:
+
+-(defconstant *infixlist* ;temporary list of infixes
++(defconstant-if-unbound *infixlist* ;temporary list of infixes
+ '(equal nequal lessp greaterp lesseq lesseqp greatereq greatereqp
+ PLUS MINUS TIMES DIVIDE DIFFERENCE) )
+
+-(defconstant precedence-alist
++(defconstant-if-unbound precedence-alist
+ '((iff 1)
+ (implies 2)
+ (or 3)
+diff -Naur pvs4.2-orig/src/ground-prover/prmacros.lisp pvs4.2-sbcl/src/ground-prover/prmacros.lisp
+--- pvs4.2-orig/src/ground-prover/prmacros.lisp 2007-07-02 20:07:40.000000000 +0000
++++ pvs4.2-sbcl/src/ground-prover/prmacros.lisp 2009-03-24 18:56:17.000000000 +0000
+@@ -55,21 +55,21 @@
+ (defun prerr (&rest args)
+ (apply #'error args))
+
+-(defconstant *truecons* '(true))
++(defconstant-if-unbound *truecons* '(true))
+
+-(defconstant *eqarithrels* '(greatereqp lesseqp))
++(defconstant-if-unbound *eqarithrels* '(greatereqp lesseqp))
+
+ (defconstant *ifops* nil ;;'(if if*)
+ )
+
+-(defconstant *boolconstants* '(false true))
++(defconstant-if-unbound *boolconstants* '(false true))
+
+-(defconstant *arithrels* '(lessp lesseqp greaterp greatereqp))
++(defconstant-if-unbound *arithrels* '(lessp lesseqp greaterp greatereqp))
+
+-(defconstant *arithops* '(PLUS TIMES DIFFERENCE MINUS))
++(defconstant-if-unbound *arithops* '(PLUS TIMES DIFFERENCE MINUS))
+
+-(defconstant *boolops* '(and or implies not ;;if
+- iff))
++(defconstant-if-unbound *boolops* '(and or implies not ;;if
++ iff))
+
+ (defmacro singleton? (obj)
+ `(and (consp ,obj) (null (cdr ,obj))))
+diff -Naur pvs4.2-orig/src/ground-prover/process.lisp pvs4.2-sbcl/src/ground-prover/process.lisp
+--- pvs4.2-orig/src/ground-prover/process.lisp 2007-07-02 20:07:40.000000000 +0000
++++ pvs4.2-sbcl/src/ground-prover/process.lisp 2009-03-24 18:56:17.000000000 +0000
+@@ -729,7 +729,7 @@
+ ; (set (setsolve atf))
+ (tuple (tupsolve atf))
+ (array (arraysolve atf))
+- (t (error "No solver for type " (prtype (arg1 atf))))
++ (t (error "No solver for type ~a" (prtype (arg1 atf))))
+ )))))
+
+ ; ------------------------------------------------------------------
+@@ -808,7 +808,7 @@
+ ; (set (setnsolve atf))
+ (tuple (tupnsolve atf))
+ (array (arraynsolve atf))
+- (t (error "No nsolve for type "
++ (t (error "No nsolve for type ~a"
+ (or (prtype (arg1 atf)) (prtype (arg2 atf))) ))
+ )))))
+
+diff -Naur pvs4.2-orig/src/interface/pvs-emacs.lisp pvs4.2-sbcl/src/interface/pvs-emacs.lisp
+--- pvs4.2-orig/src/interface/pvs-emacs.lisp 2007-07-02 20:07:40.000000000 +0000
++++ pvs4.2-sbcl/src/interface/pvs-emacs.lisp 2009-03-24 18:56:17.000000000 +0000
+@@ -66,11 +66,15 @@
+ *noninteractive-timeout*
+ ,(not (and (listp form)
+ (memq (car form) *prover-invoking-commands*))))
+- #-(or multiprocessing mp) nil
++ #-(or multiprocessing mp sbcl) nil
+ #+(or multiprocessing mp)
+ (mp:with-timeout (*noninteractive-timeout*
+ (format t "Timed out!"))
+ ,form)
++ #+sbcl
++ (sb-ext:with-timeout *noninteractive-timeout*
++ (handler-case ,form
++ (sb-ext:timeout () (format t "Timed out!"))))
+ ,form))
+ (string (error)
+ (with-output-to-string (string)
+@@ -94,7 +98,7 @@
+ ;;; This replaces ilisp-restore in pvs-init
+ (defun pvs-ilisp-restore ()
+ "Restore the old result history."
+- (declare (special / // + ++ * **))
++ #-sbcl (declare (special / // + ++ * **))
+ (setq // (pop *old-result*)
+ ** (first //)
+ / (pop *old-result*)
+@@ -105,7 +109,7 @@
+ nil)
+
+ (defun pvs-ilisp-save ()
+- (declare (special / // /// + ++ +++))
++ #-sbcl (declare (special / // /// + ++ +++))
+ (unless *old-result*
+ (setq *old-result* (list /// // +++ ++))))
+
+@@ -546,7 +550,8 @@
+ (t (cons (char string pos) result))))
+ (coerce (nreverse result) 'string)))
+
+-(#+(or cmu sbcl) ext:without-package-locks
++(#+cmu ext:without-package-locks
++ #+sbcl sb-ext:without-package-locks
+ #-(or cmu sbcl) progn
+ (defun parse-error (obj message &rest args)
+ ;;(assert (or *in-checker* *current-file*))
+@@ -606,7 +611,8 @@
+ (defvar *type-error-argument* nil)
+ (defvar *skip-all-conversion-checks* nil)
+
+-(#+(or cmu sbcl) ext:without-package-locks
++(#+cmu ext:without-package-locks
++ #+sbcl sb-ext:without-package-locks
+ #-(or cmu sbcl) progn
+ (defun type-error (obj message &rest args)
+ (let ((errmsg (type-error-for-conversion obj message args)))
+diff -Naur pvs4.2-orig/src/linked-hash-table.lisp pvs4.2-sbcl/src/linked-hash-table.lisp
+--- pvs4.2-orig/src/linked-hash-table.lisp 2007-07-02 20:07:40.000000000 +0000
++++ pvs4.2-sbcl/src/linked-hash-table.lisp 2009-03-24 18:56:17.000000000 +0000
+@@ -51,7 +51,7 @@
+ (if (memq test '(eq eql equal equalp))
+ (make-hash-table :test test :size size :rehash-size rehash-size
+ :rehash-threshold rehash-threshold
+- :weak-p weak-keys)
++ #-sbcl :weak-p #+sbcl :weakness weak-keys)
+ (make-pvs-hash-table
+ :strong-eq? (eq test 'strong-tc-eq)
+ :weak-p weak-keys
+@@ -77,6 +77,8 @@
+ :weak-keys (excl:hash-table-weak-keys ht))
+ #-allegro
+ (let* ((test (hash-table-test ht))
++ (weakp #+sbcl (sb-ext:hash-table-weakness ht)
++ #-sbcl (lisp::hash-table-weak-p ht))
+ (newht
+ (if (memq test '(eq eql equal equalp))
+ (make-hash-table
+@@ -84,13 +86,14 @@
+ :size size
+ :rehash-size rehash-size
+ :rehash-threshold rehash-threshold
+- :weak-p (lisp::hash-table-weak-p ht))
++ #-sbcl :weak-p #+sbcl :weakness weakp)
+ (make-pvs-hash-table :strong-eq? (eq test 'strong-tc-eq)
+- :weak-keys? (lisp::hash-table-weak-p ht)
++ :weak-keys? weakp
+ :size size
+ :rehash-size rehash-size
+ :rehash-threshold rehash-threshold
+- :table (lisp::hash-table-table ht)))))
++ :table #-sbcl (lisp::hash-table-table ht)
++ #+sbcl (sb-impl::hash-table-table ht)))))
+ (declare (inline maphash))
+ (maphash #'(lambda (x y) (setf (gethash x newht) y))
+ ht)
+diff -Naur pvs4.2-orig/src/make-pvs-methods.lisp pvs4.2-sbcl/src/make-pvs-methods.lisp
+--- pvs4.2-orig/src/make-pvs-methods.lisp 2007-07-02 20:07:40.000000000 +0000
++++ pvs4.2-sbcl/src/make-pvs-methods.lisp 2009-03-24 18:56:17.000000000 +0000
+@@ -33,8 +33,11 @@
+ ;; This sets *pvs-path* and sets *pvs-binary-type*
+ (load "pvs-config.lisp"))
+
+-(defpackage pvs (:use #+lucid :lucid-common-lisp :lisp
+- #-(or gcl cmu sbcl) :clos #+(or gcl cmu sbcl) :pcl))
++(defpackage pvs (:use #+lucid :lucid-common-lisp #-sbcl :lisp #+sbcl :cl
++ #-(or gcl cmu sbcl) :clos #+(or gcl cmu) :pcl
++ #+sbcl :sb-pcl)
++ #+sbcl (:shadowing-import-from :sb-int memq)
++ #+sbcl (:export memq))
+
+ (in-package :pvs)
+ (import '(cl-user:*pvs-path*))
+diff -Naur pvs4.2-orig/src/metering.lisp pvs4.2-sbcl/src/metering.lisp
+--- pvs4.2-orig/src/metering.lisp 2007-07-02 20:07:40.000000000 +0000
++++ pvs4.2-sbcl/src/metering.lisp 2009-03-24 18:56:17.000000000 +0000
+@@ -288,7 +288,7 @@
+ ;;; to seconds.
+
+ (progn
+- #-(or cmu allegro)
++ #-(or sbcl cmu allegro)
+ (eval-when (compile eval)
+ (warn
+ "You may want to supply implementation-specific get-time functions."))
+@@ -302,6 +302,12 @@
+ ;;; The get-cons macro is called to find the total number of bytes
+ ;;; consed since the beginning of time.
+
++#+sbcl
++(defmacro get-cons ()
++ "The get-cons macro is called to find the total number of bytes
++ consed since the beginning of time."
++ '(sb-ext:get-bytes-consed))
++
+ #+:cmu
+ (defmacro get-cons ()
+ "The get-cons macro is called to find the total number of bytes
+@@ -312,7 +318,7 @@
+ #+:lcl3.0
+ (defmacro get-cons () `(gc-size))
+
+-#-(or :cmu :lcl3.0)
++#-(or sbcl :cmu :lcl3.0)
+ (progn
+ (eval-when (compile eval)
+ (warn "No consing will be reported unless a get-cons function is ~
+@@ -326,6 +332,12 @@
+ ;;; arguments. The function Required-Arguments returns two values: the first
+ ;;; is the number of required arguments, and the second is T iff there are any
+ ;;; non-required arguments (e.g. &optional, &rest, &key).
++#+sbcl
++(defun required-arguments (name)
++ (multiple-value-bind (min max)
++ (sb-kernel:fun-type-nargs (sb-kernel:ctype-of (symbol-function name)))
++ (values (or min 0) (or (null max) (> max min)))))
++
+ #+cmu
+ (progn
+ #-new-compiler
+@@ -387,7 +399,7 @@
+
+
+
+-#-(or :cmu :lcl3.0 (and :allegro (not :coral)))
++#-(or sbcl :cmu :lcl3.0 (and :allegro (not :coral)))
+ (progn
+ (eval-when (compile eval)
+ (warn
+diff -Naur pvs4.2-orig/src/pp-html.lisp pvs4.2-sbcl/src/pp-html.lisp
+--- pvs4.2-orig/src/pp-html.lisp 2007-07-02 20:07:40.000000000 +0000
++++ pvs4.2-sbcl/src/pp-html.lisp 2009-03-24 18:56:17.000000000 +0000
+@@ -611,7 +611,8 @@
+ (when (eq ans :auto)
+ (setq *force-dirs* t)))))
+ #+allegro (excl:make-directory dir)
+- #+(or cmu sbcl) (unix:unix-mkdir dir #o777)
++ #+cmu (unix:unix-mkdir dir #o777)
++ #+sbcl (sb-unix:unix-mkdir dir #o777)
+ (pvs-message "Directory ~a created" dir))
+ (t (html-pvs-error "Directory ~a not created" dir))))))
+
+diff -Naur pvs4.2-orig/src/prover/checker-macros.lisp pvs4.2-sbcl/src/prover/checker-macros.lisp
+--- pvs4.2-orig/src/prover/checker-macros.lisp 2007-07-02 20:07:40.000000000 +0000
++++ pvs4.2-sbcl/src/prover/checker-macros.lisp 2009-03-24 18:56:17.000000000 +0000
+@@ -55,7 +55,7 @@
+ (defvar *printproofstate* nil)
+ (defvar *in-checker* nil)
+ (defvar *in-apply* nil)
+-(defvar *please-interrupt* nil)
++(defvar *please-interrupt* #-sbcl nil #+sbcl t)
+ (defvar *assert-bindings* nil)
+ (defvar *modsubst* nil)
+ (defvar *proving-tcc* nil)
+@@ -143,9 +143,11 @@
+ (defvar *module-context*)
+ ;;(defvar *current-theory*)
+ (defvar *ps* nil)
+-(defvar * '*)
+-(defvar + '+)
+-(defvar - '-)
++(#+sbcl sb-ext:without-package-locks
++ #-sbcl progn
++ (defvar * '*)
++ (defvar + '+)
++ (defvar - '-))
+ (defvar *macro-names* nil)
+ (defvar *subst-type-hash* ;;used in assert-sformnums
+ ;;(make-pvs-hash-table)
+@@ -177,14 +179,22 @@
+ (defmacro with-interrupts-deferred (&body form)
+ `(let ((excl::*without-interrupts* t)) ,@form))
+
+-#+(or cmu sbcl)
++#+cmu
+ (defmacro with-interrupts-allowed (&body form)
+ `(system:with-interrupts ,@form))
+
+-#+(or cmu sbcl)
++#+cmu
+ (defmacro with-interrupts-deferred (&body form)
+ `(system:without-interrupts ,@form))
+
++#+sbcl
++(defmacro with-interrupts-allowed (&body form)
++ `(sb-sys:with-interrupts ,@form))
++
++#+sbcl
++(defmacro with-interrupts-deferred (&body form)
++ `(sb-sys:without-interrupts ,@form))
++
+
+
+ ;;; KCL does not really have the equivalent to the following - punt for now.
+diff -Naur pvs4.2-orig/src/prover/eproofcheck.lisp pvs4.2-sbcl/src/prover/eproofcheck.lisp
+--- pvs4.2-orig/src/prover/eproofcheck.lisp 2008-01-14 11:12:56.000000000 +0000
++++ pvs4.2-sbcl/src/prover/eproofcheck.lisp 2009-03-24 18:56:17.000000000 +0000
+@@ -210,9 +210,15 @@
+ (and *noninteractive*
+ *noninteractive-timeout*))
+ (let ((timeout (or *proof-timeout* *noninteractive-timeout*)))
++ #-sbcl
+ (mp:with-timeout (timeout (pvs-message "Interrupted: ~a sec timeout"
+ timeout))
+- (call-next-method)))
++ (call-next-method))
++ #+sbcl
++ (sb-ext:with-timeout timeout
++ (handler-case (call-next-method)
++ (sb-ext:timeout ()
++ (pvs-message "Interrupted: ~a sec timeout" timeout)))))
+ (call-next-method)))
+
+ (defmethod prove-decl ((decl formula-decl) &key strategy context)
+@@ -3446,7 +3452,7 @@
+ (values 'X nil nil))
+ ((and (or (digit-char-p (char strlbl 0))
+ (char= (char strlbl 0) #\-))
+- (every #'digit-char-p (subseq strlbl) 1))
++ (every #'digit-char-p (subseq strlbl 1)))
+ (error-format-if
+ "~%Label cannot be an integer"))
+ (t
+diff -Naur pvs4.2-orig/src/prover/rules.lisp pvs4.2-sbcl/src/prover/rules.lisp
+--- pvs4.2-orig/src/prover/rules.lisp 2008-01-16 04:53:29.000000000 +0000
++++ pvs4.2-sbcl/src/prover/rules.lisp 2009-03-24 18:56:17.000000000 +0000
+@@ -334,9 +334,15 @@
+ (init-time (get-internal-run-time))
+ (result (let ((*in-apply* ps))
+ (if timeout
++ #-sbcl
+ (mp:with-timeout (timeout nil)
+ (prove* newps)
+ newps)
++ #+sbcl
++ (sb-ext:with-timeout timeout
++ (handler-case
++ (progn (prove* newps) newps)
++ (sb-ext:timeout () nil)))
+ (prove* newps))))
+ (end-time (/ (- (get-internal-run-time) init-time)
+ internal-time-units-per-second)))
+diff -Naur pvs4.2-orig/src/prover/translate-to-yices.lisp pvs4.2-sbcl/src/prover/translate-to-yices.lisp
+--- pvs4.2-orig/src/prover/translate-to-yices.lisp 2007-09-07 20:02:37.000000000 +0000
++++ pvs4.2-sbcl/src/prover/translate-to-yices.lisp 2009-03-24 18:56:17.000000000 +0000
+@@ -910,6 +910,13 @@
+ :input "//dev//null"
+ :output out
+ :error-output :output)
++ #+sbcl
++ (sb-ext:run-program
++ (format nil "~a ~a" *yices-call* (namestring file))
++ nil
++ :input "//dev//null"
++ :output out
++ :error out)
+ #+cmu
+ (extensions:run-program
+ (format nil "~a ~a" *yices-call* (namestring file))
+diff -Naur pvs4.2-orig/src/pvs.lisp pvs4.2-sbcl/src/pvs.lisp
+--- pvs4.2-orig/src/pvs.lisp 2008-07-19 20:29:49.000000000 +0000
++++ pvs4.2-sbcl/src/pvs.lisp 2009-03-24 18:56:17.000000000 +0000
+@@ -102,19 +102,21 @@
+ (let ((exepath (car (make::split-string
+ (environment-variable "LD_LIBRARY_PATH") :item #\:))))
+ (pushnew exepath *pvs-directories*)
+- (ext:load-foreign (format nil "~a/mu.~a" exepath
++ (#+cmu ext:load-foreign #+sbcl sb-alien:load-shared-object
++ (format nil "~a/mu.~a" exepath
+ #+darwin "dylib"
+ #-darwin "so"))
+- (ext:load-foreign (format nil "~a/ws1s.~a" exepath
++ (#+cmu ext:load-foreign #+sbcl sb-alien:load-shared-object
++ (format nil "~a/ws1s.~a" exepath
+ #+darwin "dylib"
+ #-darwin "so"))
+ ;; Have no idea what is going on here, but if you leave this out,
+ ;; bdd-cmu gives a compile error.
+- (fmakunbound 'bdd_cofactor_neg_)
+- (lf "bdd-cmu")
+- (lf "mu-cmu")
++ #+cmu (fmakunbound 'bdd_cofactor_neg_)
++ #+cmu (lf "bdd-cmu") #+sbcl (lf "bdd-sbcl")
++ #+cmu (lf "mu-cmu") #+sbcl (lf "mu-sbcl")
+ (bdd_init)
+- (lf "dfa-foreign-cmu"))
++ #+cmu (lf "dfa-foreign-cmu") #+sbcl (lf "dfa-foreign-sbcl"))
+ (setq *started-with-minus-q*
+ (or dont-load-user-lisp
+ (let ((mq (environment-variable "PVSMINUSQ")))
+diff -Naur pvs4.2-orig/src/restore-theories.lisp pvs4.2-sbcl/src/restore-theories.lisp
+--- pvs4.2-orig/src/restore-theories.lisp 2007-07-02 20:07:40.000000000 +0000
++++ pvs4.2-sbcl/src/restore-theories.lisp 2009-03-24 18:56:17.000000000 +0000
+@@ -27,7 +27,7 @@
+ ;; Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ ;; --------------------------------------------------------------------
+
+-(in-package 'pvs)
++(in-package :pvs)
+
+ ;;; Restores the state of the system from information provided in the
+ ;;; context. The context has the form
+diff -Naur pvs4.2-orig/src/store-object.lisp pvs4.2-sbcl/src/store-object.lisp
+--- pvs4.2-orig/src/store-object.lisp 2007-10-13 21:30:22.000000000 +0000
++++ pvs4.2-sbcl/src/store-object.lisp 2009-03-24 18:56:17.000000000 +0000
+@@ -301,8 +301,8 @@
+ (ensure-vector-size *store-object-store* *store-object-store-size* size)
+ (with-open-file (f file :direction :input
+ :element-type '(unsigned-byte 32))
+- (lisp:read-sequence *store-object-store* f
+- :start 0 :end size))
++ (cl:read-sequence *store-object-store* f
++ :start 0 :end size))
+ (when reverse-endian
+ (dotimes (i size)
+ (setf (object-store i)
+diff -Naur pvs4.2-orig/src/tex-support.lisp pvs4.2-sbcl/src/tex-support.lisp
+--- pvs4.2-orig/src/tex-support.lisp 2008-03-11 22:53:37.000000000 +0000
++++ pvs4.2-sbcl/src/tex-support.lisp 2009-03-24 18:56:17.000000000 +0000
+@@ -532,7 +532,7 @@
+ (when (and *report-mode*
+ (loop for sf in neg-s-forms
+ thereis (memq sf par-sforms)))
+- (format stream "~% & $\\vdots$ \\\\" *prover-indent*)))
++ (format stream "~%~VT & $\\vdots$ \\\\" *prover-indent*)))
+ (t (format stream "\\strut\\\\")))
+ (format stream "\\hline~%")
+ (cond (pos-s-forms
+diff -Naur pvs4.2-orig/src/utils/file-utils-sbcl.lisp pvs4.2-sbcl/src/utils/file-utils-sbcl.lisp
+--- pvs4.2-orig/src/utils/file-utils-sbcl.lisp 1970-01-01 00:00:00.000000000 +0000
++++ pvs4.2-sbcl/src/utils/file-utils-sbcl.lisp 2009-03-24 18:56:17.000000000 +0000
+@@ -0,0 +1,66 @@
++;; --------------------------------------------------------------------
++;; PVS
++;; Copyright (C) 2008, 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., 51 Franklin Street - Fifth Floor, Boston, MA
++;; 02110-1301, USA.
++;; --------------------------------------------------------------------
++
++(in-package :pvs)
++(require :sb-posix)
++(export '(file-exists-p directory-p read-permission? write-permission?
++ file-write-time get-file-info))
++
++(defun remove-backslashes (string)
++ (declare (type string string))
++ (sb-impl::remove-backslashes string 0 (length string)))
++
++(defun file-exists-p (file)
++ (handler-case
++ (zerop
++ (sb-posix:access
++ (remove-backslashes (namestring (merge-pathnames file)))
++ sb-posix:f-ok))
++ (sb-posix:syscall-error () nil)))
++
++(defun directory-p (dir)
++ (handler-case
++ (let ((filestring (namestring (merge-pathnames dir))))
++ (when (sb-posix:s-isdir (sb-posix:stat-mode (sb-posix:stat filestring)))
++ ;; Needs to end with a slash!!!
++ (pathname (if (char= (char filestring (1- (length filestring))) #\/)
++ filestring
++ (concatenate 'string filestring "/")))))
++ (sb-posix:syscall-error () nil)))
++
++(defun read-permission? (file)
++ (handler-case (zerop (sb-posix:access file sb-posix:r-ok))
++ (sb-posix:syscall-error () nil)))
++
++(defun write-permission? (file)
++ (handler-case (zerop (sb-posix:access file sb-posix:w-ok))
++ (sb-posix:syscall-error () nil)))
++
++(defconstant u1970 (encode-universal-time 0 0 0 1 1 1970 0))
++
++(defun file-write-time (file)
++ (handler-case (+ u1970 (sb-posix:stat-mtime (sb-posix:stat file)))
++ (sb-posix:syscall-error () nil)))
++
++(defun get-file-info (file)
++ (handler-case
++ (let ((stat (sb-posix:stat file)))
++ (list (sb-posix:stat-dev stat) (sb-posix:stat-ino stat)))
++ (sb-posix:syscall-error () nil)))
+diff -Naur pvs4.2-orig/src/utils/hashfn.lisp pvs4.2-sbcl/src/utils/hashfn.lisp
+--- pvs4.2-orig/src/utils/hashfn.lisp 2007-10-11 00:14:03.000000000 +0000
++++ pvs4.2-sbcl/src/utils/hashfn.lisp 2009-03-24 18:56:17.000000000 +0000
+@@ -56,7 +56,7 @@
+ ;; Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ ;; --------------------------------------------------------------------
+
+-(in-package 'pvs)
++(in-package :pvs)
+
+ ;(declaim (function pvs-sxhash* (T list) (integer 0 65535)))
+
+@@ -64,7 +64,7 @@
+ ;(defun tc-eq (x y &optional bindings)
+ ; (tc-eq* x y bindings))
+
+-(defconstant pvs-sxhash-byte (byte #+allegro 24 #-allegro 29 0))
++(defconstant-if-unbound pvs-sxhash-byte (byte #+allegro 24 #-allegro 29 0))
+
+ (defconstant pvs-max-hashnum (1- (expt 2 #+allegro 24 #-allegro 29)))
+
+@@ -104,7 +104,7 @@
+ (declare (ignore bindings))
+ (the positive-fixnum (sxhash x)))
+
+-(defconstant nil-sxhash (sxhash nil))
++(defconstant-if-unbound nil-sxhash (sxhash nil))
+
+ (defmethod pvs-sxhash* ((x null) bindings)
+ (declare (ignore bindings))
+diff -Naur pvs4.2-orig/src/utils/ix86_64-Linux/Makefile pvs4.2-sbcl/src/utils/ix86_64-Linux/Makefile
+--- pvs4.2-orig/src/utils/ix86_64-Linux/Makefile 1970-01-01 00:00:00.000000000 +0000
++++ pvs4.2-sbcl/src/utils/ix86_64-Linux/Makefile 2009-03-24 18:56:17.000000000 +0000
+@@ -0,0 +1,23 @@
++LD = gcc
++LDFLAGS = -shared -L./
++CC=gcc
++CFLAGS=-fPIC
++WFLAGS=-Wall
++VPATH=..
++
++obj=file_utils.o
++
++.SUFFIXES:
++.SUFFIXES: .c .o
++.c.o : ; $(CC) $(XCFLAGS) ${WFLAGS} ${CFLAGS} -c $< -o $@
++
++all : file_utils.so b64
++
++file_utils.so: ${obj}
++ $(LD) ../utils-ld-table $(LDFLAGS) -o file_utils.so ${obj} -lc
++
++b64: ../b64.c
++ $(CC) -o ./b64 ../b64.c
++
++clean :
++ rm -f *.o *.a *.so b64
+diff -Naur pvs4.2-orig/src/utils.lisp pvs4.2-sbcl/src/utils.lisp
+--- pvs4.2-orig/src/utils.lisp 2008-07-17 10:35:11.000000000 +0000
++++ pvs4.2-sbcl/src/utils.lisp 2009-03-24 18:56:17.000000000 +0000
+@@ -137,11 +137,12 @@
+ (let* ((test (hash-table-test ht))
+ (size (hash-table-count ht))
+ (weak? #+allegro (excl:hash-table-weak-keys ht)
+- #+(or cmu sbcl) (lisp::hash-table-weak-p ht))
++ #+cmu (lisp::hash-table-weak-p ht)
++ #+sbcl (sb-ext:hash-table-weakness ht))
+ (new-ht (if (memq test '(eq eql equal equalp))
+ (make-hash-table
+ :test test :size size
+- #+allegro :weak-keys #+(or cmu sbcl) :weak-p weak?)
++ #+allegro :weak-keys #+cmu :weak-p #+sbcl :weakness weak?)
+ (make-pvs-hash-table :strong-eq? (eq test 'strong-tc-eq)
+ :size size
+ :weak-keys? weak?))))
+@@ -279,7 +280,8 @@
+ #+(and allegro (version>= 6) (not (version>= 7)))
+ (excl::variable-special-p obj nil)
+ #+(and allegro (not (version>= 6))) (clos::variable-special-p obj nil)
+- #+(or cmu sbcl) (eq (extensions:info variable kind obj) :special)
++ #+cmu (eq (extensions:info variable kind obj) :special)
++ #+sbcl (sb-walker:var-globally-special-p obj)
+ #+harlequin-common-lisp (system:declared-special-p obj)
+ #-(or lucid kcl allegro harlequin-common-lisp cmu sbcl)
+ (error "Need to handle special variables for this version of lisp")
+@@ -310,14 +312,22 @@
+ (namestring (working-directory))))
+ nil)
+
+-#+(or gcl cmu sbcl)
++#+(or gcl cmu)
+ (defun working-directory ()
+ (pathname (nth-value 1 (unix:unix-current-directory))))
+
+-#+(or gcl cmu sbcl)
++#+(or gcl cmu)
+ (defun set-working-directory (dir)
+ (unix:unix-chdir (namestring dir)))
+
++#+sbcl
++(defun working-directory ()
++ (make-pathname :directory (sb-posix:getcwd)))
++
++#+sbcl
++(defun set-working-directory (dir)
++ (sb-posix:chdir dir))
++
+ #+allegro
+ (defun working-directory ()
+ (excl:current-directory))
+@@ -334,10 +344,14 @@
+ (defun environment-variable (string)
+ (sys:getenv string))
+
+-#+(or cmu sbcl)
++#+cmu
+ (defun environment-variable (string)
+ (tools:getenv string))
+
++#+sbcl
++(defun environment-variable (string)
++ (sb-posix:getenv string))
++
+ #+harlequin-common-lisp
+ (defun environment-variable (string)
+ ;; This didn't work before
+@@ -370,13 +384,20 @@
+ :show-cmd nil
+ :output-stream (open "/dev/null" :direction :output
+ :if-exists :append)))
+-#+(or cmu sbcl)
++#+cmu
+ (defun chmod (prot file)
+ (extensions:run-program
+ "chmod"
+ (list prot (namestring file))
+ :output nil :error nil :wait nil))
+
++#+sbcl
++(defun chmod (prot file)
++ (sb-ext:run-program
++ "chmod"
++ (list prot (namestring file))
++ :output nil :error nil :wait nil))
++
+ #+gcl
+ (defun chmod (prot file)
+ (system (format nil "chmod ~a ~a" prot (namestring file))))
+@@ -605,11 +626,12 @@
+
+ (defun shortpath (directory)
+ (or (gethash directory *shortpath-directories*)
+- (let* ((dirlist (pathname-directory
++ (let* ((realdir (namestring (truename directory)))
++ (dirlist (pathname-directory
+ (directory-p
+- (#+allegro excl:pathname-resolve-symbolic-links
+- #+(or cmu sbcl) unix:unix-resolve-links
+- (namestring (truename directory))))))
++ #+allegro (excl:pathname-resolve-symbolic-links realdir)
++ #+cmu (unix:unix-resolve-links realdir)
++ #-(or allegro cmu) realdir)))
+ (file-info (get-file-info directory))
+ (result (if (eq (car dirlist) :absolute)
+ (shortpath* (reverse (cdr dirlist)) file-info)
+@@ -2915,10 +2937,14 @@
+ (defun direct-superclasses (class)
+ (slot-value class 'pcl:class-direct-superclasses))
+
+-#+(or cmu sbcl)
++#+cmu
+ (defun direct-superclasses (class)
+ (class-direct-superclasses class))
+
++#+sbcl
++(defun direct-superclasses (class)
++ (sb-mop:class-direct-superclasses class))
++
+ (defun types-of (obj)
+ (let ((types nil))
+ (labels ((tof (type)
+@@ -3225,7 +3251,7 @@
+ (when (compiled-function-p #'pvs-gc-after-hook)
+ (setf excl:*gc-after-hook* #'pvs-gc-after-hook)))
+
+-#+(or cmu sbcl)
++#+cmu
+ (eval-when (load)
+ (setf extensions:*gc-verbose* nil))
+
+@@ -4022,7 +4048,8 @@
+ (every #'(lambda (slot)
+ (let ((name (slot-value slot
+ '#+allegro excl::name
+- #+(or cmu sbcl) pcl::name)))
++ #+cmu pcl::name
++ #+sbcl sb-pcl::name)))
+ (equals (slot-value x name) (slot-value y name))))
+ slots)))
+
+@@ -4059,8 +4086,12 @@
+ #-(or allegro cmu sbcl)
+ (error "Need a hash-table for tc-eq for this lisp"))
+
+-#+(or cmu sbcl)
++#+cmu
+ (extensions:define-hash-table-test 'tc-eq-test #'tc-eq #'pvs-sxhash)
+-#+(or cmu sbcl)
++#+cmu
+ (extensions:define-hash-table-test 'strong-tc-eq-test
+ #'strong-tc-eq #'pvs-sxhash)
++#+sbcl
++(sb-int:define-hash-table-test 'tc-eq-test #'tc-eq #'pvs-sxhash)
++#+sbcl
++(sb-int:define-hash-table-test 'strong-tc-eq-test #'strong-tc-eq #'pvs-sxhash)
+diff -Naur pvs4.2-orig/src/WS1S/ix86_64-Linux/Makefile pvs4.2-sbcl/src/WS1S/ix86_64-Linux/Makefile
+--- pvs4.2-orig/src/WS1S/ix86_64-Linux/Makefile 1970-01-01 00:00:00.000000000 +0000
++++ pvs4.2-sbcl/src/WS1S/ix86_64-Linux/Makefile 2009-03-24 18:56:40.000000000 +0000
+@@ -0,0 +1,64 @@
++ifneq (,)
++This makefile requires GNU Make.
++endif
++
++BDD = ../mona/BDD
++DFA = ../mona/DFA
++UTILS = ../mona/Mem
++INCLUDES = -I$(BDD) -I$(DFA) -I$(UTILS)
++LD = gcc
++LDFLAGS = -shared -L./
++CC = gcc
++CFLAGS += -fPIC -D_POSIX_SOURCE -DSYSV $(INCLUDES)
++XCFLAGS = -O
++SHELL = /bin/sh
++VPATH = ..:../mona/BDD:../mona/DFA:../mona/Mem
++
++obj = analyze.o prefix.o product.o \
++ quotient.o basic.o external.o \
++ makebasic.o minimize.o printdfa.o \
++ project.o dfa.o \
++ bdd.o bdd_double.o bdd_external.o \
++ bdd_manager.o hash.o bdd_dump.o \
++ bdd_trace.o bdd_cache.o \
++ dlmalloc.o mem.o \
++ ws1s_extended_interface.o
++
++.SUFFIXES:
++.SUFFIXES: .c .o
++.c.o : ; $(CC) $(XCFLAGS) ${CFLAGS} -c $< -o $@
++
++all : ws1s.so
++
++ws1s_extended_interface.o : ../ws1s_extended_interface.c
++ $(CC) $(XCFLAGS) ${CFLAGS} -c $< -o $@
++
++ws1s.so : ${obj}
++ $(LD) ../ws1s-ld-table $(LDFLAGS) -o ws1s.so ${obj}
++
++bdd.o: bdd.c bdd.h bdd_internal.h
++bdd_double.o: bdd_double.c bdd.h bdd_internal.h
++bdd_external.o: bdd_external.c bdd_external.h mem.h
++bdd_manager.o: bdd_manager.c bdd.h bdd_internal.h
++hash.o: hash.c mem.h hash.h
++bdd_dump.o: bdd_dump.c bdd_dump.h
++bdd_trace.o: bdd_trace.c bdd.h bdd_internal.h
++bdd_cache.o: bdd_cache.c bdd.h bdd_internal.h
++
++analyze.o: analyze.c dfa.h mem.h
++prefix.o: prefix.c dfa.h mem.h
++product.o: product.c dfa.h bdd.h hash.h mem.h
++quotient.o: quotient.c dfa.h hash.h mem.h
++basic.o: basic.c dfa.h mem.h
++external.o: external.c dfa.h bdd_external.h mem.h
++makebasic.o: makebasic.c dfa.h bdd_internal.h
++minimize.o: minimize.c dfa.h hash.h mem.h
++printdfa.o: printdfa.c dfa.h mem.h
++project.o: project.c dfa.h hash.h mem.h
++dfa.o: dfa.c dfa.h bdd.h hash.h mem.h
++
++dlmalloc.o: dlmalloc.c dlmalloc.h
++mem.o: mem.c dlmalloc.h
++
++clean :
++ rm -f *.o *.a *.so
+diff -Naur pvs4.2-orig/src/WS1S/ix86-Linux/Makefile pvs4.2-sbcl/src/WS1S/ix86-Linux/Makefile
+--- pvs4.2-orig/src/WS1S/ix86-Linux/Makefile 2007-07-02 20:07:40.000000000 +0000
++++ pvs4.2-sbcl/src/WS1S/ix86-Linux/Makefile 2009-03-24 18:56:17.000000000 +0000
+@@ -14,15 +14,7 @@
+ SHELL = /bin/sh
+ VPATH = ..:../mona/BDD:../mona/DFA:../mona/Mem
+
+-obj = analyze.o prefix.o product.o \
+- quotient.o basic.o external.o \
+- makebasic.o minimize.o printdfa.o \
+- project.o dfa.o \
+- bdd.o bdd_double.o bdd_external.o \
+- bdd_manager.o hash.o bdd_dump.o \
+- bdd_trace.o bdd_cache.o \
+- dlmalloc.o mem.o \
+- ws1s_extended_interface.o
++obj = ws1s_table.o ws1s_extended_interface.o
+
+ .SUFFIXES:
+ .SUFFIXES: .c .o
+@@ -34,7 +26,7 @@
+ $(CC) $(XCFLAGS) ${CFLAGS} -c $< -o $@
+
+ ws1s.so : ${obj}
+- $(LD) ../ws1s-ld-table $(LDFLAGS) -o ws1s.so ${obj}
++ $(CC) -shared $(CFLAGS) -o ws1s.so ${obj}
+
+ bdd.o: bdd.c bdd.h bdd_internal.h
+ bdd_double.o: bdd_double.c bdd.h bdd_internal.h
+diff -Naur pvs4.2-orig/src/WS1S/lisp/dfa-foreign-sbcl.lisp pvs4.2-sbcl/src/WS1S/lisp/dfa-foreign-sbcl.lisp
+--- pvs4.2-orig/src/WS1S/lisp/dfa-foreign-sbcl.lisp 1970-01-01 00:00:00.000000000 +0000
++++ pvs4.2-sbcl/src/WS1S/lisp/dfa-foreign-sbcl.lisp 2009-03-24 18:56:17.000000000 +0000
+@@ -0,0 +1,275 @@
++;; --------------------------------------------------------------------
++;; 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.
++;; --------------------------------------------------------------------
++
++(in-package :pvs)
++
++;; Structure of a DFA in foreign space
++(sb-alien:define-alien-type nil
++ (sb-alien:struct mona-dfa
++ (bddm (* t)) ; Manager of BDD nodes
++ (ns (integer 32)) ; Number of states
++ (q (* t)) ; Transition array
++ (s (integer 32)) ; Start State
++ (f (* (integer 32))))) ; State Status Array
++
++;; Predefined basic automata
++
++(sb-alien:define-alien-routine ("ws1s___dfaTrue" mona-true) ; true
++ (* (sb-alien:struct mona-dfa)))
++
++(sb-alien:define-alien-routine ("ws1s___dfaFalse" mona-false) ; false
++ (* (sb-alien:struct mona-dfa)))
++
++(sb-alien:define-alien-routine ("ws1s___dfaConst" mona-const) ; p_i = n
++ (* (sb-alien:struct mona-dfa))
++ (n (integer 32)) (i (integer 32)))
++
++(sb-alien:define-alien-routine ("ws1s___dfaLess" mona-less) ; p_i < p_j
++ (* (sb-alien:struct mona-dfa))
++ (i (integer 32)) (j (integer 32)))
++
++(sb-alien:define-alien-routine ("ws1s___dfaLesseq" mona-lesseq) ; p_i <= p_j
++ (* (sb-alien:struct mona-dfa))
++ (i (integer 32)) (j (integer 32)))
++
++(sb-alien:define-alien-routine ("ws1s___dfaPlus1" mona-plus1) ; p_i = p_j + n
++ (* (sb-alien:struct mona-dfa))
++ (i (integer 32)) (j (integer 32)) (n (integer 32)))
++
++(sb-alien:define-alien-routine ("ws1s___dfaMinus1" mona-minus1) ; p_i = p_i - p_j
++ (* (sb-alien:struct mona-dfa))
++ (i (integer 32)) (j (integer 32)))
++
++(sb-alien:define-alien-routine ("ws1s___dfaEq1" mona-eq1) ; p_i = p_j
++ (* (sb-alien:struct mona-dfa))
++ (i (integer 32)) (j (integer 32)))
++
++(sb-alien:define-alien-routine ("ws1s___dfaEq2" mona-eq2) ; P_i = P_j
++ (* (sb-alien:struct mona-dfa))
++ (i (integer 32)) (j (integer 32)))
++
++(sb-alien:define-alien-routine ("ws1s___dfaPlus2" mona-plus2) ; P_i = P_j + 1
++ (* (sb-alien:struct mona-dfa))
++ (i (integer 32)) (j (integer 32)))
++
++(sb-alien:define-alien-routine ("ws1s___dfaMinus2" mona-minus2) ; P_i = P_j - 1
++ (* (sb-alien:struct mona-dfa))
++ (i (integer 32)) (j (integer 32)))
++
++(sb-alien:define-alien-routine ("ws1s___dfaPlusModulo1" mona-plusmodulo1) ; p_i = p_j + 1 % p_k
++ (* (sb-alien:struct mona-dfa))
++ (i (integer 32)) (j (integer 32)) (k (integer 32)))
++
++(sb-alien:define-alien-routine ("ws1s___dfaMinusModulo1" mona-minusmodulo1) ; p_i = p_j - 1 % p_k
++ (* (sb-alien:struct mona-dfa))
++ (i (integer 32)) (j (integer 32)) (k (integer 32)))
++
++(sb-alien:define-alien-routine ("ws1s___dfaEmpty" mona-empty) ; P_i = empty
++ (* (sb-alien:struct mona-dfa))
++ (i (integer 32)))
++
++(sb-alien:define-alien-routine ("ws1s___dfaIn" mona-in) ; p_i in P_j recognizes <X,X>(<0,X>+)<1,1>(<X,X>*)
++ (* (sb-alien:struct mona-dfa))
++ (i (integer 32)) (j (integer 32)))
++
++(sb-alien:define-alien-routine ("ws1s___dfaSubset" mona-subset) ; P_i sub P_j
++ (* (sb-alien:struct mona-dfa))
++ (i (integer 32)) (j (integer 32)))
++
++(sb-alien:define-alien-routine ("ws1s___dfaUnion" mona-union) ; P_i = P_j union P_k
++ (* (sb-alien:struct mona-dfa))
++ (i (integer 32)) (j (integer 32)) (k (integer 32)))
++
++(sb-alien:define-alien-routine ("ws1s___dfaInter" mona-intersection) ; P_i = P_j inter P_k
++ (* (sb-alien:struct mona-dfa))
++ (i (integer 32)) (j (integer 32)) (k (integer 32)))
++
++(sb-alien:define-alien-routine ("ws1s___dfaSetminus" mona-difference) ; P_i = P_j \ P_k
++ (* (sb-alien:struct mona-dfa))
++ (i (integer 32)) (j (integer 32)) (k (integer 32)))
++
++(sb-alien:define-alien-routine ("ws1s___dfaMax" mona-max) ; p_i = max(P_j)
++ (* (sb-alien:struct mona-dfa))
++ (i (integer 32)) (j (integer 32)))
++
++(sb-alien:define-alien-routine ("ws1s___dfaMin" mona-min) ; p_i = min(P_j)
++ (* (sb-alien:struct mona-dfa))
++ (i (integer 32)) (j (integer 32)))
++
++(sb-alien:define-alien-routine ("ws1s___dfaBoolvar" mona-boolvar) ; b_i
++ (* (sb-alien:struct mona-dfa))
++ (b (integer 32)))
++
++(sb-alien:define-alien-routine ("ws1s___dfaPresbConst" mona-presburger-const) ; P_i = pconst(n)
++ (* (sb-alien:struct mona-dfa))
++ (i (integer 32)) (n (integer 32)))
++
++(sb-alien:define-alien-routine ("ws1s___dfaSingleton" mona-singleton) ; singleton(P_i)
++ (* (sb-alien:struct mona-dfa))
++ (i (integer 32)))
++
++(sb-alien:define-alien-routine ("ws1s___dfaFirstOrder" mona-first-order) ; recognizes 0*1+
++ (* (sb-alien:struct mona-dfa))
++ (i (integer 32)))
++
++
++;; Automaton operations
++
++(sb-alien:define-alien-routine ("ws1s___dfaFree" mona-free!)
++ sb-alien:void
++ (a (* (sb-alien:struct mona-dfa))))
++
++(sb-alien:define-alien-routine ("ws1s___dfaNegation" mona-negation!)
++ sb-alien:void
++ (a (* (sb-alien:struct mona-dfa))))
++
++(sb-alien:define-alien-routine ("ws1s___dfaRestrict" mona-restrict!)
++ sb-alien:void
++ (a (* (sb-alien:struct mona-dfa))))
++
++(sb-alien:define-alien-routine ("ws1s___dfaUnrestrict" mona-unrestrict!)
++ sb-alien:void
++ (a (* (sb-alien:struct mona-dfa))))
++
++(sb-alien:define-alien-routine ("ws1s___dfaCopy" mona-copy)
++ (* (sb-alien:struct mona-dfa))
++ (a (* (sb-alien:struct mona-dfa))))
++
++(sb-alien:define-alien-routine ("ws1s___dfaProduct" mona-product)
++ (* (sb-alien:struct mona-dfa))
++ (a1 (* (sb-alien:struct mona-dfa)))
++ (a2 (* (sb-alien:struct mona-dfa)))
++ (mode (integer 32)))
++
++(sb-alien:define-alien-routine ("ws1s___dfaPrefixClose" mona-prefix-close!)
++ sb-alien:void
++ (a (* (sb-alien:struct mona-dfa))))
++
++(sb-alien:define-alien-routine ("ws1s___dfaConjunction" mona-conjunction)
++ (* (sb-alien:struct mona-dfa))
++ (a1 (* (sb-alien:struct mona-dfa))) (a2 (* (sb-alien:struct mona-dfa))))
++
++(sb-alien:define-alien-routine ("ws1s___dfaDisjunction" mona-disjunction)
++ (* (sb-alien:struct mona-dfa))
++ (a1 (* (sb-alien:struct mona-dfa))) (a2 (* (sb-alien:struct mona-dfa))))
++
++(sb-alien:define-alien-routine ("ws1s___dfaImplication" mona-implication)
++ (* (sb-alien:struct mona-dfa))
++ (a1 (* (sb-alien:struct mona-dfa))) (a2 (* (sb-alien:struct mona-dfa))))
++
++(sb-alien:define-alien-routine ("ws1s___dfaIff" mona-iff)
++ (* (sb-alien:struct mona-dfa))
++ (a1 (* (sb-alien:struct mona-dfa))) (a2 (* (sb-alien:struct mona-dfa))))
++
++(sb-alien:define-alien-routine ("ws1s___dfaStatus" mona-status)
++ (integer 32)
++ (a (* (sb-alien:struct mona-dfa))))
++
++(sb-alien:define-alien-routine ("ws1s___dfaProject" mona-project)
++ ; projects away track var_index from a and
++ ; determinizes the resulting automaton
++ (* (sb-alien:struct mona-dfa))
++ (a (* (sb-alien:struct mona-dfa))) (index (sb-alien:unsigned 32)))
++
++(sb-alien:define-alien-routine ("ws1s___dfaRightQuotient" mona-right-quotient!)
++ sb-alien:void
++ (a (* (sb-alien:struct mona-dfa))) (index (sb-alien:unsigned 32)))
++
++(sb-alien:define-alien-routine ("ws1s___dfaMinimize" mona-minimize) ; Minimization
++ (* (sb-alien:struct mona-dfa))
++ (a (* (sb-alien:struct mona-dfa))))
++
++
++;; Analysis and printing
++
++(sb-alien:define-alien-routine ("ws1s___dfaMakeExample" mona-make-example)
++ sb-alien:c-string
++ (a (* (sb-alien:struct mona-dfa)))
++ (kind (integer 32))
++ (num (integer 32))
++ (indices (array (sb-alien:unsigned 32))))
++
++(sb-alien:define-alien-routine ("ws1s___dfaAnalyze" mona-analyze)
++ sb-alien:void
++ (a (* (sb-alien:struct mona-dfa)))
++ (num (integer 32))
++ (names (array sb-alien:c-string))
++ (indices (array sb-alien:unsigned))
++ (orders (array sb-alien:char))
++ (treestyle (integer 32)))
++
++(sb-alien:define-alien-routine ("ws1s___dfaPrintVitals" mona-print-vitals)
++ sb-alien:void
++ (a (* (sb-alien:struct mona-dfa))))
++
++(sb-alien:define-alien-routine ("ws1s___dfaPrint" mona-print)
++ sb-alien:void
++ (a (* (sb-alien:struct mona-dfa)))
++ (num (integer 32))
++ (names (array sb-alien:c-string))
++ (indices (array (sb-alien:unsigned 32))))
++
++(sb-alien:define-alien-routine ("ws1s___dfaPrintGraphviz" mona-print-graphviz)
++ sb-alien:void
++ (a (* (sb-alien:struct mona-dfa)))
++ (num (integer 32))
++ (indices (array (sb-alien:unsigned 32))))
++
++(sb-alien:define-alien-routine ("ws1s___dfaPrintVerbose" mona-print-verbose)
++ sb-alien:void
++ (a (* (sb-alien:struct mona-dfa))))
++
++(sb-alien:define-alien-routine ("ws1s___bdd_size" bdd-size)
++ (sb-alien:unsigned 32)
++ (bbdm (* t)))
++
++
++;; Constructing Automata Explicitly
++
++(sb-alien:define-alien-routine ("ws1s___dfaSetup" mona-setup)
++ sb-alien:void
++ (s (integer 32))
++ (len (integer 32))
++ (indices (array (integer 32))))
++
++(sb-alien:define-alien-routine ("ws1s___dfaAllocExceptions" mona-alloc-exceptions)
++ sb-alien:void
++ (n (integer 32)))
++
++(sb-alien:define-alien-routine ("ws1s___dfaStoreException" mona-store-exception)
++ sb-alien:void
++ (s (integer 32)) (path sb-alien:c-string))
++
++(sb-alien:define-alien-routine ("ws1s___dfaStoreState" mona-store-state)
++ sb-alien:void
++ (s (integer 32)))
++
++(sb-alien:define-alien-routine ("ws1s___dfaBuild" mona-build)
++ (* (sb-alien:struct mona-dfa))
++ (statuses (array sb-alien:char)))
++
++;; Exporting
++
++(sb-alien:define-alien-routine ("ws1s___dfaExport" mona-export)
++ (integer 32)
++ (a (* (sb-alien:struct mona-dfa)))
++ (filename sb-alien:c-string)
++ (num (integer 32))
++ (names (array sb-alien:c-string))
++ (orders (array sb-alien:char)))
+diff -Naur pvs4.2-orig/src/WS1S/lisp/symtab.lisp pvs4.2-sbcl/src/WS1S/lisp/symtab.lisp
+--- pvs4.2-orig/src/WS1S/lisp/symtab.lisp 2007-07-02 20:07:39.000000000 +0000
++++ pvs4.2-sbcl/src/WS1S/lisp/symtab.lisp 2009-03-24 18:56:17.000000000 +0000
+@@ -81,7 +81,7 @@
+ (let* ((free (symtab-freevars symtab))
+ (size (length free))
+ (offsets (make-array size :element-type 'fixnum))
+- (fvars (make-array size :element-type 'string))
++ (fvars (make-array size :element-type 'string :initial-element ""))
+ (types (make-string size))
+ (i 0))
+ (mapc #'(lambda (bndng)
+diff -Naur pvs4.2-orig/src/WS1S/lisp/ws1s-strategy.lisp pvs4.2-sbcl/src/WS1S/lisp/ws1s-strategy.lisp
+--- pvs4.2-orig/src/WS1S/lisp/ws1s-strategy.lisp 2007-07-02 20:07:39.000000000 +0000
++++ pvs4.2-sbcl/src/WS1S/lisp/ws1s-strategy.lisp 2009-03-24 18:56:17.000000000 +0000
+@@ -193,7 +193,7 @@
+ (loop* 0 (emptyset-operator))))
+
+ (defun ws1s-automaton-output (p num fvars offsets)
+- (format t "~2%Free vars:~2%" fvars)
++ (format t "~2%Free vars:~{ ~s~}~2%" fvars)
+ (dfa-print p num fvars offsets)
+ (format t "~%"))
+
diff --git a/sci-mathematics/pvs/pvs-4.2-r1.ebuild b/sci-mathematics/pvs/pvs-4.2-r1.ebuild
new file mode 100644
index 000000000..42333c210
--- /dev/null
+++ b/sci-mathematics/pvs/pvs-4.2-r1.ebuild
@@ -0,0 +1,83 @@
+# Copyright 1999-2009 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: Exp $
+
+inherit eutils
+
+DESCRIPTION="PVS is a verification system written in Common Lisp"
+HOMEPAGE="http://pvs.csl.sri.com/"
+SRC_URI="http://pvs.csl.sri.com/download-open/${P}-source.tgz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~ppc ~sparc ~x86"
+
+IUSE="doc"
+
+RDEPEND="|| ( app-editors/emacs app-editors/xemacs )
+ !x86? ( dev-lisp/sbcl ) x86? ( dev-lisp/cmucl )"
+
+DEPEND="${RDEPEND}
+ doc? ( app-text/texlive
+ app-text/ghostscript-gpl )"
+
+src_unpack() {
+ unpack ${A}
+ epatch "${FILESDIR}/pvs-4.2-patch-make"
+ epatch "${FILESDIR}/pvs-4.2-patch-bddp"
+ case $(tc-arch ${CTARGET}) in
+ "x86")
+ ;;
+ *)
+ epatch "${FILESDIR}/pvs-4.2-patch-sbcl"
+ ;;
+ esac
+ ln -s ../sum.tex ./doc/user-guide/sum.tex
+ emake -C doc/release-notes clean
+ rm doc/release-notes/pvs-release-notes.pdf
+}
+
+src_compile() {
+ econf || die "econf failed"
+ case $(tc-arch ${CTARGET}) in
+ "x86")
+ CMULISP_HOME="/usr" emake || die "emake failed"
+ ;;
+ *)
+ SBCLISP_HOME="/usr" emake -j1 || die "emake failed"
+ ;;
+ esac
+ bin/relocate && ./pvsio no_test
+
+ if use doc; then
+ emake -j1 -C doc/language || die "emake language doc failed"
+ emake -j1 -C doc/prover || die "emake prover doc failed"
+ emake -j1 -C doc/release-notes || die "emake release-notes doc failed"
+ emake -j1 -C doc/user-guide || die "emake user-guide doc failed"
+ fi
+}
+
+src_install() {
+ rm -R bin/relocate emacs/emacs19
+ mkdir tex
+ mv pvs-tex.sub pvs.sty tex/
+ mv Examples examples
+ mkdir -p "${D}"/usr/share/pvs
+ mv bin emacs examples lib tex wish "${D}"/usr/share/pvs/
+ sed -i -e "s,^PVSPATH=.*$,PVSPATH=/usr/share/pvs," pvs
+ sed -i -e "s,^PVSPATH=.*$,PVSPATH=/usr/share/pvs," pvsio
+ cp pvs pvsio "${D}"/usr/share/pvs/
+ dobin pvs pvsio
+ dodoc INSTALL LICENSE NOTICES README
+
+ if use doc; then
+ mv doc/PVSio-2.d.pdf pvsio-reference-manual.pdf
+ mv doc/language/language.pdf pvs-language-reference.pdf
+ mv doc/prover/prover.pdf pvs-prover-guide.pdf
+ mv doc/release-notes/pvs-release-notes.pdf pvs-release-notes.pdf
+ mv doc/user-guide/user-guide.pdf pvs-system-guide.pdf
+ dodoc pvsio-reference-manual.pdf pvs-language-reference.pdf \
+ pvs-prover-guide.pdf pvs-release-notes.pdf pvs-system-guide.pdf
+ fi
+}
+
diff --git a/sci-mathematics/pvs/pvs-4.2.ebuild b/sci-mathematics/pvs/pvs-4.2.ebuild
new file mode 100644
index 000000000..2b7446960
--- /dev/null
+++ b/sci-mathematics/pvs/pvs-4.2.ebuild
@@ -0,0 +1,46 @@
+# Copyright 1999-2009 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: Exp $
+
+inherit eutils
+
+DESCRIPTION="PVS is a verification system written in Common Lisp"
+HOMEPAGE="http://pvs.csl.sri.com/"
+SRC_URI="http://pvs.csl.sri.com/download-open/${P}-source.tgz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~x86"
+
+IUSE=""
+
+RDEPEND="dev-lisp/cmucl
+ || ( app-editors/emacs app-editors/xemacs )"
+
+DEPEND="${RDEPEND}"
+
+src_unpack() {
+ unpack ${A}
+ epatch "${FILESDIR}/pvs-4.2-patch-make"
+}
+
+src_compile() {
+ econf || die "econf failed"
+ CMULISP_HOME="/usr" emake || die "emake failed"
+ bin/relocate && ./pvsio test
+}
+
+src_install() {
+ rm -R bin/relocate emacs/emacs19
+ mkdir tex
+ mv pvs-tex.sub pvs.sty tex/
+ mv Examples examples
+ mkdir -p "${D}"/usr/share/pvs
+ mv bin emacs examples lib tex wish "${D}"/usr/share/pvs/
+ sed -i -e "s,^PVSPATH=.*$,PVSPATH=/usr/share/pvs," pvs
+ sed -i -e "s,^PVSPATH=.*$,PVSPATH=/usr/share/pvs," pvsio
+ cp pvs pvsio "${D}"/usr/share/pvs/
+ dobin pvs pvsio
+ dodoc INSTALL LICENSE NOTICES README
+}
+
diff --git a/sci-mathematics/why/Manifest b/sci-mathematics/why/Manifest
new file mode 100644
index 000000000..0138a2c23
--- /dev/null
+++ b/sci-mathematics/why/Manifest
@@ -0,0 +1,2 @@
+DIST why-2.17.tar.gz 2506291 RMD160 97cad17d196eabef8a64e8881661bdb8ecbab75d SHA1 930e577f12849f204f49cf10147ee9c646d169df SHA256 39186ca1e20712eeecb0c4330b8998c70b1c11e93279039a79a053da5393aed5
+EBUILD why-2.17.ebuild 1170 RMD160 7a71fbe7793aefdf7c1a5061fbcaaca9130b142e SHA1 dbb5017c0e9e49620368aa31f8dbabe271fb603a SHA256 07c420f238e9a5977ad9b5d45797240e01b54ff03d72aea2cc5c1d51a4341265
diff --git a/sci-mathematics/why/why-2.17.ebuild b/sci-mathematics/why/why-2.17.ebuild
new file mode 100644
index 000000000..b3c67f892
--- /dev/null
+++ b/sci-mathematics/why/why-2.17.ebuild
@@ -0,0 +1,50 @@
+# Copyright 1999-2009 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: Exp $
+
+DESCRIPTION="Why is a software verification platform."
+HOMEPAGE="http://why.lri.fr/"
+SRC_URI="http://why.lri.fr/download/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~ppc ~sparc ~x86"
+
+IUSE="apron coq doc gappa gtk pff pvs"
+
+RDEPEND="apron? ( sci-mathematics/apron )
+ coq? ( sci-mathematics/coq )
+ gappa? ( sci-mathematics/gappalib-coq )
+ pff? ( sci-mathematics/pff )
+ pvs? ( sci-mathematics/pvs )"
+
+DEPEND="${RDEPEND}
+ >=dev-lang/ocaml-3.09
+ gtk? ( >=dev-ml/lablgtk-2.6 )"
+
+src_unpack() {
+ unpack ${A}
+ cd ${S}
+
+ sed -i Makefile.in \
+ -e "s/\$(COQLIB)/\$(DESTDIR)\/\$(COQLIB)/g" \
+ -e "s/-w \$(DESTDIR)\/\$(COQLIB)/-w \$(COQLIB)/g" \
+ -e "s/\$(PVSLIB)\/why/\$(DESTDIR)\$(PVSLIB)\/why/g"
+}
+
+src_compile(){
+ econf $(use_enable apron) || die "econf failed"
+ #Makfile need a fix to enable parallel building
+ emake -j1 DESTDIR="/" || die "emake failed"
+}
+
+src_install(){
+ emake install DESTDIR="${D}" || die "emake install failed"
+ dodoc CHANGES COPYING README Version
+ doman doc/why.1
+
+ if use doc; then
+ dodoc doc/manual.ps
+ fi
+}
+