bin/isabelle
author wenzelm
Wed, 22 Nov 2000 21:41:39 +0100
changeset 10511 efb3428c9879
parent 10104 cf49932f3c42
child 10555 2323ec838401
permissions -rwxr-xr-x
tuned;
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
3203
af42c8cc8e75 fixed bash path!!!
wenzelm
parents: 3184
diff changeset
     1
#!/bin/bash
2292
c1c5652600f1 isabelle: Basic Isabelle startup script.
wenzelm
parents:
diff changeset
     2
#
2308
641be5ad47af improved 'not found' messages;
wenzelm
parents: 2292
diff changeset
     3
# $Id$
9786
wenzelm
parents: 8359
diff changeset
     4
# Author: Markus Wenzel, TU Muenchen
wenzelm
parents: 8359
diff changeset
     5
# License: GPL (GNU GENERAL PUBLIC LICENSE)
2308
641be5ad47af improved 'not found' messages;
wenzelm
parents: 2292
diff changeset
     6
#
2292
c1c5652600f1 isabelle: Basic Isabelle startup script.
wenzelm
parents:
diff changeset
     7
# Basic Isabelle startup script.
c1c5652600f1 isabelle: Basic Isabelle startup script.
wenzelm
parents:
diff changeset
     8
c1c5652600f1 isabelle: Basic Isabelle startup script.
wenzelm
parents:
diff changeset
     9
c1c5652600f1 isabelle: Basic Isabelle startup script.
wenzelm
parents:
diff changeset
    10
## settings
c1c5652600f1 isabelle: Basic Isabelle startup script.
wenzelm
parents:
diff changeset
    11
10511
wenzelm
parents: 10104
diff changeset
    12
PRG="$(basename "$0")"
2704
afa01c9f1ab0 more robust handling of invocation errors;
wenzelm
parents: 2591
diff changeset
    13
10511
wenzelm
parents: 10104
diff changeset
    14
ISABELLE_HOME="$(dirname "$0")/.."
9786
wenzelm
parents: 8359
diff changeset
    15
. "$ISABELLE_HOME/lib/scripts/getsettings" || \
2936
bd33e7aae062 fixed { ... } shell syntax to accomodate bash 2.x;
wenzelm
parents: 2768
diff changeset
    16
  { echo "$PRG probably not called from its original place!"; exit 2; }
2292
c1c5652600f1 isabelle: Basic Isabelle startup script.
wenzelm
parents:
diff changeset
    17
c1c5652600f1 isabelle: Basic Isabelle startup script.
wenzelm
parents:
diff changeset
    18
c1c5652600f1 isabelle: Basic Isabelle startup script.
wenzelm
parents:
diff changeset
    19
## diagnostics
c1c5652600f1 isabelle: Basic Isabelle startup script.
wenzelm
parents:
diff changeset
    20
c1c5652600f1 isabelle: Basic Isabelle startup script.
wenzelm
parents:
diff changeset
    21
function usage()
c1c5652600f1 isabelle: Basic Isabelle startup script.
wenzelm
parents:
diff changeset
    22
{
c1c5652600f1 isabelle: Basic Isabelle startup script.
wenzelm
parents:
diff changeset
    23
  echo
c1c5652600f1 isabelle: Basic Isabelle startup script.
wenzelm
parents:
diff changeset
    24
  echo "Usage: $PRG [OPTIONS] [INPUT] [OUTPUT]"
c1c5652600f1 isabelle: Basic Isabelle startup script.
wenzelm
parents:
diff changeset
    25
  echo
c1c5652600f1 isabelle: Basic Isabelle startup script.
wenzelm
parents:
diff changeset
    26
  echo "  Options are:"
10104
cf49932f3c42 option -C;
wenzelm
parents: 9982
diff changeset
    27
  echo "    -C           tell ML system to copy output image"
5815
b4d4a97df438 option -I: startup Isar interaction mode;
wenzelm
parents: 4539
diff changeset
    28
  echo "    -I           startup Isar interaction mode"
9982
1860276fc8de tuned msg;
wenzelm
parents: 9972
diff changeset
    29
  echo "    -P           startup Proof General interaction mode"
8359
124ad46105dd option -c: tell ML system to compress output image;
wenzelm
parents: 7887
diff changeset
    30
  echo "    -c           tell ML system to compress output image"
2343
2588b63b42ca added -norc option;
wenzelm
parents: 2308
diff changeset
    31
  echo "    -e MLTEXT    pass MLTEXT to the ML session"
2704
afa01c9f1ab0 more robust handling of invocation errors;
wenzelm
parents: 2591
diff changeset
    32
  echo "    -m MODE      add print mode for output"
2292
c1c5652600f1 isabelle: Basic Isabelle startup script.
wenzelm
parents:
diff changeset
    33
  echo "    -q           non-interactive session"
c1c5652600f1 isabelle: Basic Isabelle startup script.
wenzelm
parents:
diff changeset
    34
  echo "    -r           open heap file read-only"
4516
f90b2d459a1b added -u option (again);
wenzelm
parents: 4355
diff changeset
    35
  echo "    -u           pass 'use\"ROOT.ML\";' to the ML session"
3502
ec22ba0a26ec added -w option;
wenzelm
parents: 3203
diff changeset
    36
  echo "    -w           reset write permissions on OUTPUT"
2292
c1c5652600f1 isabelle: Basic Isabelle startup script.
wenzelm
parents:
diff changeset
    37
  echo
3184
4e0bbfb113d5 renamed DEFAULT_LOGIC to ISABELLE_LOGIC;
wenzelm
parents: 3183
diff changeset
    38
  echo "  INPUT (default \"$ISABELLE_LOGIC\") and OUTPUT specify in/out heaps."
7887
eedfff88ee40 tuned usage;
wenzelm
parents: 6286
diff changeset
    39
  echo "  These are either names to be searched in the Isabelle path, or"
eedfff88ee40 tuned usage;
wenzelm
parents: 6286
diff changeset
    40
  echo "  actual file names (containing at least one /)."
2768
bc6d915b8019 renamed SYSTEM to RAW_ML_SYSTEM;
wenzelm
parents: 2735
diff changeset
    41
  echo "  If INPUT is \"RAW_ML_SYSTEM\", just start the bare bones ML system."
2292
c1c5652600f1 isabelle: Basic Isabelle startup script.
wenzelm
parents:
diff changeset
    42
  echo
c1c5652600f1 isabelle: Basic Isabelle startup script.
wenzelm
parents:
diff changeset
    43
  exit 1
c1c5652600f1 isabelle: Basic Isabelle startup script.
wenzelm
parents:
diff changeset
    44
}
c1c5652600f1 isabelle: Basic Isabelle startup script.
wenzelm
parents:
diff changeset
    45
c1c5652600f1 isabelle: Basic Isabelle startup script.
wenzelm
parents:
diff changeset
    46
function fail()
c1c5652600f1 isabelle: Basic Isabelle startup script.
wenzelm
parents:
diff changeset
    47
{
2343
2588b63b42ca added -norc option;
wenzelm
parents: 2308
diff changeset
    48
  echo "$1" >&2
2292
c1c5652600f1 isabelle: Basic Isabelle startup script.
wenzelm
parents:
diff changeset
    49
  exit 2
c1c5652600f1 isabelle: Basic Isabelle startup script.
wenzelm
parents:
diff changeset
    50
}
c1c5652600f1 isabelle: Basic Isabelle startup script.
wenzelm
parents:
diff changeset
    51
c1c5652600f1 isabelle: Basic Isabelle startup script.
wenzelm
parents:
diff changeset
    52
c1c5652600f1 isabelle: Basic Isabelle startup script.
wenzelm
parents:
diff changeset
    53
## process command line
c1c5652600f1 isabelle: Basic Isabelle startup script.
wenzelm
parents:
diff changeset
    54
c1c5652600f1 isabelle: Basic Isabelle startup script.
wenzelm
parents:
diff changeset
    55
# options
c1c5652600f1 isabelle: Basic Isabelle startup script.
wenzelm
parents:
diff changeset
    56
10104
cf49932f3c42 option -C;
wenzelm
parents: 9982
diff changeset
    57
COPYDB=""
9972
05afcc505da3 -P option;
wenzelm
parents: 9786
diff changeset
    58
ISAR=false
05afcc505da3 -P option;
wenzelm
parents: 9786
diff changeset
    59
PROOFGENERAL=""
8359
124ad46105dd option -c: tell ML system to compress output image;
wenzelm
parents: 7887
diff changeset
    60
COMPRESS=""
2292
c1c5652600f1 isabelle: Basic Isabelle startup script.
wenzelm
parents:
diff changeset
    61
MLTEXT=""
2704
afa01c9f1ab0 more robust handling of invocation errors;
wenzelm
parents: 2591
diff changeset
    62
MODES=""
2292
c1c5652600f1 isabelle: Basic Isabelle startup script.
wenzelm
parents:
diff changeset
    63
TERMINATE=""
c1c5652600f1 isabelle: Basic Isabelle startup script.
wenzelm
parents:
diff changeset
    64
READONLY=""
3502
ec22ba0a26ec added -w option;
wenzelm
parents: 3203
diff changeset
    65
NOWRITE=""
2292
c1c5652600f1 isabelle: Basic Isabelle startup script.
wenzelm
parents:
diff changeset
    66
10104
cf49932f3c42 option -C;
wenzelm
parents: 9982
diff changeset
    67
while getopts "CIPce:m:qruw" OPT
2292
c1c5652600f1 isabelle: Basic Isabelle startup script.
wenzelm
parents:
diff changeset
    68
do
c1c5652600f1 isabelle: Basic Isabelle startup script.
wenzelm
parents:
diff changeset
    69
  case "$OPT" in
10104
cf49932f3c42 option -C;
wenzelm
parents: 9982
diff changeset
    70
    C)
cf49932f3c42 option -C;
wenzelm
parents: 9982
diff changeset
    71
      COPYDB=true
cf49932f3c42 option -C;
wenzelm
parents: 9982
diff changeset
    72
      ;;
5815
b4d4a97df438 option -I: startup Isar interaction mode;
wenzelm
parents: 4539
diff changeset
    73
    I)
9972
05afcc505da3 -P option;
wenzelm
parents: 9786
diff changeset
    74
      ISAR=true
05afcc505da3 -P option;
wenzelm
parents: 9786
diff changeset
    75
      ;;
05afcc505da3 -P option;
wenzelm
parents: 9786
diff changeset
    76
    P)
05afcc505da3 -P option;
wenzelm
parents: 9786
diff changeset
    77
      PROOFGENERAL=true
5815
b4d4a97df438 option -I: startup Isar interaction mode;
wenzelm
parents: 4539
diff changeset
    78
      ;;
8359
124ad46105dd option -c: tell ML system to compress output image;
wenzelm
parents: 7887
diff changeset
    79
    c)
124ad46105dd option -c: tell ML system to compress output image;
wenzelm
parents: 7887
diff changeset
    80
      COMPRESS=true
124ad46105dd option -c: tell ML system to compress output image;
wenzelm
parents: 7887
diff changeset
    81
      ;;
2292
c1c5652600f1 isabelle: Basic Isabelle startup script.
wenzelm
parents:
diff changeset
    82
    e)
c1c5652600f1 isabelle: Basic Isabelle startup script.
wenzelm
parents:
diff changeset
    83
      MLTEXT="$MLTEXT $OPTARG"
c1c5652600f1 isabelle: Basic Isabelle startup script.
wenzelm
parents:
diff changeset
    84
      ;;
2704
afa01c9f1ab0 more robust handling of invocation errors;
wenzelm
parents: 2591
diff changeset
    85
    m)
afa01c9f1ab0 more robust handling of invocation errors;
wenzelm
parents: 2591
diff changeset
    86
      if [ -z "$MODES" ]; then
afa01c9f1ab0 more robust handling of invocation errors;
wenzelm
parents: 2591
diff changeset
    87
        MODES="\"$OPTARG\""
afa01c9f1ab0 more robust handling of invocation errors;
wenzelm
parents: 2591
diff changeset
    88
      else
6286
ce30e19af3df fixed order of multiple -m options;
wenzelm
parents: 5954
diff changeset
    89
        MODES="$MODES, \"$OPTARG\""
2704
afa01c9f1ab0 more robust handling of invocation errors;
wenzelm
parents: 2591
diff changeset
    90
      fi
afa01c9f1ab0 more robust handling of invocation errors;
wenzelm
parents: 2591
diff changeset
    91
      ;;
2292
c1c5652600f1 isabelle: Basic Isabelle startup script.
wenzelm
parents:
diff changeset
    92
    q)
c1c5652600f1 isabelle: Basic Isabelle startup script.
wenzelm
parents:
diff changeset
    93
      TERMINATE=true
c1c5652600f1 isabelle: Basic Isabelle startup script.
wenzelm
parents:
diff changeset
    94
      ;;
c1c5652600f1 isabelle: Basic Isabelle startup script.
wenzelm
parents:
diff changeset
    95
    r)
c1c5652600f1 isabelle: Basic Isabelle startup script.
wenzelm
parents:
diff changeset
    96
      READONLY=true
c1c5652600f1 isabelle: Basic Isabelle startup script.
wenzelm
parents:
diff changeset
    97
      ;;
4516
f90b2d459a1b added -u option (again);
wenzelm
parents: 4355
diff changeset
    98
    u)
f90b2d459a1b added -u option (again);
wenzelm
parents: 4355
diff changeset
    99
      MLTEXT="$MLTEXT use\"ROOT.ML\";"
f90b2d459a1b added -u option (again);
wenzelm
parents: 4355
diff changeset
   100
      ;;
3502
ec22ba0a26ec added -w option;
wenzelm
parents: 3203
diff changeset
   101
    w)
ec22ba0a26ec added -w option;
wenzelm
parents: 3203
diff changeset
   102
      NOWRITE=true
ec22ba0a26ec added -w option;
wenzelm
parents: 3203
diff changeset
   103
      ;;
2292
c1c5652600f1 isabelle: Basic Isabelle startup script.
wenzelm
parents:
diff changeset
   104
    \?)
c1c5652600f1 isabelle: Basic Isabelle startup script.
wenzelm
parents:
diff changeset
   105
      usage
c1c5652600f1 isabelle: Basic Isabelle startup script.
wenzelm
parents:
diff changeset
   106
      ;;
c1c5652600f1 isabelle: Basic Isabelle startup script.
wenzelm
parents:
diff changeset
   107
  esac
c1c5652600f1 isabelle: Basic Isabelle startup script.
wenzelm
parents:
diff changeset
   108
done
c1c5652600f1 isabelle: Basic Isabelle startup script.
wenzelm
parents:
diff changeset
   109
c1c5652600f1 isabelle: Basic Isabelle startup script.
wenzelm
parents:
diff changeset
   110
shift $(($OPTIND - 1))
c1c5652600f1 isabelle: Basic Isabelle startup script.
wenzelm
parents:
diff changeset
   111
c1c5652600f1 isabelle: Basic Isabelle startup script.
wenzelm
parents:
diff changeset
   112
c1c5652600f1 isabelle: Basic Isabelle startup script.
wenzelm
parents:
diff changeset
   113
# args
c1c5652600f1 isabelle: Basic Isabelle startup script.
wenzelm
parents:
diff changeset
   114
c1c5652600f1 isabelle: Basic Isabelle startup script.
wenzelm
parents:
diff changeset
   115
INPUT=""
c1c5652600f1 isabelle: Basic Isabelle startup script.
wenzelm
parents:
diff changeset
   116
OUTPUT=""
c1c5652600f1 isabelle: Basic Isabelle startup script.
wenzelm
parents:
diff changeset
   117
9786
wenzelm
parents: 8359
diff changeset
   118
if [ "$#" -ge 1 ]; then
2292
c1c5652600f1 isabelle: Basic Isabelle startup script.
wenzelm
parents:
diff changeset
   119
  INPUT="$1"
c1c5652600f1 isabelle: Basic Isabelle startup script.
wenzelm
parents:
diff changeset
   120
  shift
c1c5652600f1 isabelle: Basic Isabelle startup script.
wenzelm
parents:
diff changeset
   121
fi
c1c5652600f1 isabelle: Basic Isabelle startup script.
wenzelm
parents:
diff changeset
   122
9786
wenzelm
parents: 8359
diff changeset
   123
if [ "$#" -ge 1 ]; then
2292
c1c5652600f1 isabelle: Basic Isabelle startup script.
wenzelm
parents:
diff changeset
   124
  OUTPUT="$1"
c1c5652600f1 isabelle: Basic Isabelle startup script.
wenzelm
parents:
diff changeset
   125
  shift
c1c5652600f1 isabelle: Basic Isabelle startup script.
wenzelm
parents:
diff changeset
   126
fi
c1c5652600f1 isabelle: Basic Isabelle startup script.
wenzelm
parents:
diff changeset
   127
9786
wenzelm
parents: 8359
diff changeset
   128
[ "$#" -ne 0 ] && { echo "Bad args: $*"; usage; }
2292
c1c5652600f1 isabelle: Basic Isabelle startup script.
wenzelm
parents:
diff changeset
   129
c1c5652600f1 isabelle: Basic Isabelle startup script.
wenzelm
parents:
diff changeset
   130
c1c5652600f1 isabelle: Basic Isabelle startup script.
wenzelm
parents:
diff changeset
   131
## check ML system
c1c5652600f1 isabelle: Basic Isabelle startup script.
wenzelm
parents:
diff changeset
   132
2308
641be5ad47af improved 'not found' messages;
wenzelm
parents: 2292
diff changeset
   133
[ -z "$ML_SYSTEM" ] && fail "Missing ML system settings! Unable to run Isabelle."
2292
c1c5652600f1 isabelle: Basic Isabelle startup script.
wenzelm
parents:
diff changeset
   134
c1c5652600f1 isabelle: Basic Isabelle startup script.
wenzelm
parents:
diff changeset
   135
c1c5652600f1 isabelle: Basic Isabelle startup script.
wenzelm
parents:
diff changeset
   136
## input heap file
c1c5652600f1 isabelle: Basic Isabelle startup script.
wenzelm
parents:
diff changeset
   137
3184
4e0bbfb113d5 renamed DEFAULT_LOGIC to ISABELLE_LOGIC;
wenzelm
parents: 3183
diff changeset
   138
[ -z "$INPUT" ] && INPUT="$ISABELLE_LOGIC"
2292
c1c5652600f1 isabelle: Basic Isabelle startup script.
wenzelm
parents:
diff changeset
   139
c1c5652600f1 isabelle: Basic Isabelle startup script.
wenzelm
parents:
diff changeset
   140
case "$INPUT" in
2768
bc6d915b8019 renamed SYSTEM to RAW_ML_SYSTEM;
wenzelm
parents: 2735
diff changeset
   141
  RAW_ML_SYSTEM)
2292
c1c5652600f1 isabelle: Basic Isabelle startup script.
wenzelm
parents:
diff changeset
   142
    INFILE=""
c1c5652600f1 isabelle: Basic Isabelle startup script.
wenzelm
parents:
diff changeset
   143
    ;;
c1c5652600f1 isabelle: Basic Isabelle startup script.
wenzelm
parents:
diff changeset
   144
  */*)
c1c5652600f1 isabelle: Basic Isabelle startup script.
wenzelm
parents:
diff changeset
   145
    INFILE="$INPUT"
2343
2588b63b42ca added -norc option;
wenzelm
parents: 2308
diff changeset
   146
    [ ! -f "$INFILE" ] && fail "Bad heap file: \"$INFILE\""
2292
c1c5652600f1 isabelle: Basic Isabelle startup script.
wenzelm
parents:
diff changeset
   147
    ;;
c1c5652600f1 isabelle: Basic Isabelle startup script.
wenzelm
parents:
diff changeset
   148
  *)
9786
wenzelm
parents: 8359
diff changeset
   149
    INFILE=""
2308
641be5ad47af improved 'not found' messages;
wenzelm
parents: 2292
diff changeset
   150
    ISA_PATH=""
9786
wenzelm
parents: 8359
diff changeset
   151
wenzelm
parents: 8359
diff changeset
   152
    ORIG_IFS="$IFS"
wenzelm
parents: 8359
diff changeset
   153
    IFS=":"
wenzelm
parents: 8359
diff changeset
   154
    for DIR in $ISABELLE_PATH
2292
c1c5652600f1 isabelle: Basic Isabelle startup script.
wenzelm
parents:
diff changeset
   155
    do
9786
wenzelm
parents: 8359
diff changeset
   156
      DIR="$DIR/$ML_IDENTIFIER"
wenzelm
parents: 8359
diff changeset
   157
      ISA_PATH="$ISA_PATH  $DIR\n"
wenzelm
parents: 8359
diff changeset
   158
      [ -z "$INFILE" -a -f "$DIR/$INPUT" ] && INFILE="$DIR/$INPUT"
2292
c1c5652600f1 isabelle: Basic Isabelle startup script.
wenzelm
parents:
diff changeset
   159
    done
9786
wenzelm
parents: 8359
diff changeset
   160
    IFS="$ORIG_IFS"
wenzelm
parents: 8359
diff changeset
   161
2308
641be5ad47af improved 'not found' messages;
wenzelm
parents: 2292
diff changeset
   162
    if [ -z "$INFILE" ]; then
2343
2588b63b42ca added -norc option;
wenzelm
parents: 2308
diff changeset
   163
      echo "Unknown logic \"$INPUT\" -- no heap file found in:" >&2
9786
wenzelm
parents: 8359
diff changeset
   164
      echo -ne "$ISA_PATH" >&2
2308
641be5ad47af improved 'not found' messages;
wenzelm
parents: 2292
diff changeset
   165
      exit 2
641be5ad47af improved 'not found' messages;
wenzelm
parents: 2292
diff changeset
   166
    fi
2292
c1c5652600f1 isabelle: Basic Isabelle startup script.
wenzelm
parents:
diff changeset
   167
    ;;
c1c5652600f1 isabelle: Basic Isabelle startup script.
wenzelm
parents:
diff changeset
   168
esac
c1c5652600f1 isabelle: Basic Isabelle startup script.
wenzelm
parents:
diff changeset
   169
c1c5652600f1 isabelle: Basic Isabelle startup script.
wenzelm
parents:
diff changeset
   170
c1c5652600f1 isabelle: Basic Isabelle startup script.
wenzelm
parents:
diff changeset
   171
## output heap file
c1c5652600f1 isabelle: Basic Isabelle startup script.
wenzelm
parents:
diff changeset
   172
c1c5652600f1 isabelle: Basic Isabelle startup script.
wenzelm
parents:
diff changeset
   173
case "$OUTPUT" in
c1c5652600f1 isabelle: Basic Isabelle startup script.
wenzelm
parents:
diff changeset
   174
  "")
c1c5652600f1 isabelle: Basic Isabelle startup script.
wenzelm
parents:
diff changeset
   175
    [ -z "$READONLY" -a -w "$INFILE" ] && OUTFILE="$INFILE"
c1c5652600f1 isabelle: Basic Isabelle startup script.
wenzelm
parents:
diff changeset
   176
    ;;
c1c5652600f1 isabelle: Basic Isabelle startup script.
wenzelm
parents:
diff changeset
   177
  */*)
c1c5652600f1 isabelle: Basic Isabelle startup script.
wenzelm
parents:
diff changeset
   178
    OUTFILE="$OUTPUT"
c1c5652600f1 isabelle: Basic Isabelle startup script.
wenzelm
parents:
diff changeset
   179
    ;;
c1c5652600f1 isabelle: Basic Isabelle startup script.
wenzelm
parents:
diff changeset
   180
  *)
3118
24dae6222579 fixed ISABELLE_OUTPUT, ISABELLE_PATH (finally?);
wenzelm
parents: 3054
diff changeset
   181
    mkdir -p "$ISABELLE_OUTPUT"
24dae6222579 fixed ISABELLE_OUTPUT, ISABELLE_PATH (finally?);
wenzelm
parents: 3054
diff changeset
   182
    OUTFILE="$ISABELLE_OUTPUT/$OUTPUT"
2292
c1c5652600f1 isabelle: Basic Isabelle startup script.
wenzelm
parents:
diff changeset
   183
    ;;
c1c5652600f1 isabelle: Basic Isabelle startup script.
wenzelm
parents:
diff changeset
   184
esac
c1c5652600f1 isabelle: Basic Isabelle startup script.
wenzelm
parents:
diff changeset
   185
c1c5652600f1 isabelle: Basic Isabelle startup script.
wenzelm
parents:
diff changeset
   186
4333
1d326b826851 ISABELLE_TMP;
wenzelm
parents: 3502
diff changeset
   187
## prepare tmp directory
1d326b826851 ISABELLE_TMP;
wenzelm
parents: 3502
diff changeset
   188
1d326b826851 ISABELLE_TMP;
wenzelm
parents: 3502
diff changeset
   189
[ -z "$ISABELLE_TMP_PREFIX" ] && ISABELLE_TMP_PREFIX=/tmp/isabelle
1d326b826851 ISABELLE_TMP;
wenzelm
parents: 3502
diff changeset
   190
1d326b826851 ISABELLE_TMP;
wenzelm
parents: 3502
diff changeset
   191
ISABELLE_TMP="$ISABELLE_TMP_PREFIX$$"
1d326b826851 ISABELLE_TMP;
wenzelm
parents: 3502
diff changeset
   192
mkdir -p "$ISABELLE_TMP"
1d326b826851 ISABELLE_TMP;
wenzelm
parents: 3502
diff changeset
   193
1d326b826851 ISABELLE_TMP;
wenzelm
parents: 3502
diff changeset
   194
2292
c1c5652600f1 isabelle: Basic Isabelle startup script.
wenzelm
parents:
diff changeset
   195
## run it!
c1c5652600f1 isabelle: Basic Isabelle startup script.
wenzelm
parents:
diff changeset
   196
9786
wenzelm
parents: 8359
diff changeset
   197
ML_SYSTEM_BASE=$(echo "$ML_SYSTEM" | cut -f1 -d-)
2292
c1c5652600f1 isabelle: Basic Isabelle startup script.
wenzelm
parents:
diff changeset
   198
2704
afa01c9f1ab0 more robust handling of invocation errors;
wenzelm
parents: 2591
diff changeset
   199
[ -n "$MODES" ] && MLTEXT="print_mode := [$MODES]; $MLTEXT"
afa01c9f1ab0 more robust handling of invocation errors;
wenzelm
parents: 2591
diff changeset
   200
9972
05afcc505da3 -P option;
wenzelm
parents: 9786
diff changeset
   201
if [ -n "$PROOFGENERAL" ]; then
05afcc505da3 -P option;
wenzelm
parents: 9786
diff changeset
   202
  MLTEXT="$MLTEXT; ProofGeneral.init $ISAR;"
05afcc505da3 -P option;
wenzelm
parents: 9786
diff changeset
   203
elif [ "$ISAR" = true ]; then
05afcc505da3 -P option;
wenzelm
parents: 9786
diff changeset
   204
  MLTEXT="$MLTEXT; Isar.main();"
05afcc505da3 -P option;
wenzelm
parents: 9786
diff changeset
   205
fi
05afcc505da3 -P option;
wenzelm
parents: 9786
diff changeset
   206
10104
cf49932f3c42 option -C;
wenzelm
parents: 9982
diff changeset
   207
export INFILE OUTFILE COPYDB COMPRESS MLTEXT TERMINATE NOWRITE ISABELLE_TMP
4333
1d326b826851 ISABELLE_TMP;
wenzelm
parents: 3502
diff changeset
   208
9786
wenzelm
parents: 8359
diff changeset
   209
if [ -f "$ISABELLE_HOME/lib/scripts/run-$ML_SYSTEM" ]; then
wenzelm
parents: 8359
diff changeset
   210
  "$ISABELLE_HOME/lib/scripts/run-$ML_SYSTEM"
4333
1d326b826851 ISABELLE_TMP;
wenzelm
parents: 3502
diff changeset
   211
else
9786
wenzelm
parents: 8359
diff changeset
   212
  "$ISABELLE_HOME/lib/scripts/run-$ML_SYSTEM_BASE"
4333
1d326b826851 ISABELLE_TMP;
wenzelm
parents: 3502
diff changeset
   213
fi
9786
wenzelm
parents: 8359
diff changeset
   214
RC="$?"
4333
1d326b826851 ISABELLE_TMP;
wenzelm
parents: 3502
diff changeset
   215
1d326b826851 ISABELLE_TMP;
wenzelm
parents: 3502
diff changeset
   216
#Do not even think of 'rm -r'!!
9786
wenzelm
parents: 8359
diff changeset
   217
rmdir "$ISABELLE_TMP"
4355
68c7c544570c pass return code!!
wenzelm
parents: 4333
diff changeset
   218
9786
wenzelm
parents: 8359
diff changeset
   219
exit "$RC"