adding a simple check to only run with a SWI-Prolog version known to work
authorbulwahn
Thu, 28 Oct 2010 17:28:45 +0200
changeset 40243 3102b27ca03a
parent 40228 19cd739f4b0a
child 40244 783c23f6afbf
adding a simple check to only run with a SWI-Prolog version known to work * * * taking the isabelle platform into account when finding the prolog system
src/HOL/Predicate_Compile_Examples/ROOT.ML
src/HOL/Tools/Predicate_Compile/etc/settings
src/HOL/Tools/Predicate_Compile/lib/scripts/swipl_version
--- a/src/HOL/Predicate_Compile_Examples/ROOT.ML	Thu Oct 28 15:10:34 2010 +0200
+++ b/src/HOL/Predicate_Compile_Examples/ROOT.ML	Thu Oct 28 17:28:45 2010 +0200
@@ -12,11 +12,12 @@
 if getenv "EXEC_SWIPL" = "" andalso getenv "EXEC_YAP" = "" then
   (warning "No prolog system found - skipping some example theories"; ())
 else
-  (use_thys [
-    "Code_Prolog_Examples",
-    "Context_Free_Grammar_Example",
-    "Hotel_Example_Prolog",
-    "Lambda_Example",
-    "List_Examples"];
-   Unsynchronized.setmp quick_and_dirty true use_thys ["Reg_Exp_Example"]);
-
+  if not (getenv "EXEC_SWIPL" = "") orelse (getenv "SWIPL_VERSION" = "5.10.1") then
+     (use_thys [
+        "Code_Prolog_Examples",
+        "Context_Free_Grammar_Example",
+        "Hotel_Example_Prolog",
+        "Lambda_Example",
+        "List_Examples"];
+      Unsynchronized.setmp quick_and_dirty true use_thys ["Reg_Exp_Example"])
+    else (warning "Unsupported SWI-Prolog version - skipping some example theories"; ());
--- a/src/HOL/Tools/Predicate_Compile/etc/settings	Thu Oct 28 15:10:34 2010 +0200
+++ b/src/HOL/Tools/Predicate_Compile/etc/settings	Thu Oct 28 17:28:45 2010 +0200
@@ -1,13 +1,16 @@
 
 EXEC_SWIPL=$(choosefrom \
-  "$ISABELLE_HOME/contrib/swipl/bin/swipl" \
-  "$ISABELLE_HOME/contrib_devel/swipl/bin/swipl" \
+  "$ISABELLE_HOME/contrib/swipl/$ISABELLE_PLATFORM/bin/swipl" \
+  "$ISABELLE_HOME/contrib_devel/swipl/$ISABELLE_PLATFORM/bin/swipl" \
   "$ISABELLE_HOME/../swipl" \
   $(type -p swipl) \
   "")
 
 EXEC_YAP=$(choosefrom \
-  "$ISABELLE_HOME/contrib/yap" \
+  "$ISABELLE_HOME/contrib/yap/$ISABELLE_PLATFORM/bin/yap" \
+  "$ISABELLE_HOME/contrib_devel/yap/$ISABELLE_PLATFORM/bin/yap" \
   "$ISABELLE_HOME/../yap" \
   $(type -p yap) \
   "")
+
+SWIPL_VERSION=$("$COMPONENT/lib/scripts/swipl_version")
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/HOL/Tools/Predicate_Compile/lib/scripts/swipl_version	Thu Oct 28 17:28:45 2010 +0200
@@ -0,0 +1,12 @@
+#!/usr/bin/env bash
+#
+# Author: Lukas Bulwahn, TU Muenchen, 2010
+#
+# Determine SWI-Prolog version
+
+if [ "$EXEC_SWIPL" = "" ]; then
+  echo ""
+else
+  VERSION=`$EXEC_SWIPL --version`
+  echo `expr match "$VERSION" 'SWI-Prolog version \([0-9\.]*\)'`
+fi