merged; order-prover
authorLukas Stevens <mail@lukas-stevens.de>
Mon, 06 Sep 2021 12:08:20 +0200
branchorder-prover
changeset 74561 4732ff992445
parent 74548 92a74ae14fbc (current diff)
parent 74560 38c01d7e9f5b (diff)
child 74562 20275085448d
merged;
src/HOL/Data_Structures/Set2_Join.thy
src/HOL/Library/RBT_Impl.thy
src/HOL/Orderings.thy
src/Provers/order_tac.ML
--- a/.hgignore	Wed Mar 31 16:01:31 2021 +0200
+++ b/.hgignore	Mon Sep 06 12:08:20 2021 +0200
@@ -16,8 +16,6 @@
 ^heaps/
 ^browser_info/
 ^doc/.*\.pdf
-^lib/classes/
-^src/Tools/jEdit/dist/
 ^src/Tools/VSCode/out/
 ^src/Tools/VSCode/extension/node_modules/
 ^Admin/jenkins/ci-extras/target/
--- a/Admin/Isabelle_app/build	Wed Mar 31 16:01:31 2021 +0200
+++ b/Admin/Isabelle_app/build	Mon Sep 06 12:08:20 2021 +0200
@@ -2,6 +2,7 @@
 
 set -e
 
+unset CDPATH
 THIS="$(cd "$(dirname "$0")"; pwd)"
 cd "$THIS"
 
--- a/Admin/PLATFORMS	Wed Mar 31 16:01:31 2021 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,115 +0,0 @@
-Multi-platform support of Isabelle
-==================================
-
-Preamble
---------
-
-The general programming model is that of a stylized ML + Scala + POSIX
-environment, with a minimum of system-specific code in user-space
-tools.
-
-The Isabelle system infrastructure provides some facilities to make
-this work, e.g. see the ML and Scala modules File and Path, or
-functions like Isabelle_System.bash.  The settings environment also
-provides some means for portability, e.g. the bash function
-"platform_path" to keep the impression that Windows/Cygwin adheres to
-Isabelle/POSIX standards, although Poly/ML and the JVM are native on
-Windows.
-
-When producing add-on tools, it is important to stay within this clean
-room of Isabelle, and refrain from non-portable access to operating
-system functions. The Isabelle environment uses peculiar scripts for
-GNU bash and perl as system glue: this style should be observed as far
-as possible.
-
-
-Supported platforms
--------------------
-
-A broad range of hardware and operating system platforms are supported
-by building executables on base-line versions that are neither too old
-nor too new. Common OS families work: Linux, Windows, macOS, but
-exotic ones are unsupported: BSD, Solaris, NixOS.
-
-Official (full support):
-
-  x86_64-linux      Ubuntu 14.04 LTS
-
-  x86_64-darwin     macOS 10.13 High Sierra (lapbroy68 MacBookPro11,2)
-                    macOS 10.14 Mojave (mini2 Macmini8,1)
-                    macOS 10.15 Catalina (laramac01 Macmini8,1)
-                    macOS 11.1 Big Sur (mini1 Macmini8,1)
-
-  x86_64-windows    Windows 10
-  x86_64-cygwin     Cygwin 3.1.x https://isabelle.sketis.net/cygwin_2021 (x86_64/release)
-
-New (experimental):
-
-  arm64-linux       Raspberry Pi OS 64bit beta (Debian 10 / Buster)
-
-  arm64-darwin      macOS 11.1 Big Sur
-
-
-64 bit vs. 32 bit platform personality
---------------------------------------
-
-Isabelle requires 64 bit hardware running a 64 bit operating
-system. Only Windows still supports native x86 executables, but the
-POSIX emulation on Windows via Cygwin64 works exclusively for x86_64.
-
-The Isabelle settings environment provides variable
-ISABELLE_PLATFORM64 to refer to the standard platform personality. On
-Windows this is for Cygwin64, but the following native platform
-identifiers are available as well:
-
-  ISABELLE_WINDOWS_PLATFORM64
-  ISABELLE_WINDOWS_PLATFORM32
-
-These are always empty on Linux and macOS, and non-empty on
-Windows. For example, this is how to refer to native Windows and
-fall-back on Unix (always 64 bit):
-
-  "${ISABELLE_WINDOWS_PLATFORM64:-$ISABELLE_PLATFORM64}"
-
-And this is for old 32 bit executables on Windows, but still 64 bit on
-Unix:
-
-  "${ISABELLE_WINDOWS_PLATFORM32:-$ISABELLE_PLATFORM64}"
-
-
-Dependable system tools
------------------------
-
-The following portable system tools can be taken for granted:
-
-* Scala on top of Java.  Isabelle/Scala irons out many oddities and
-  portability issues of the Java platform.
-
-* GNU bash as uniform shell on all platforms. The POSIX "standard"
-  shell /bin/sh does *not* work portably -- there are too many
-  non-standard implementations of it. On Debian and Ubuntu /bin/sh is
-  actually /bin/dash and introduces many oddities.
-
-* Perl as largely portable system programming language, with its
-  fairly robust support for processes, signals, sockets etc.
-
-
-Known problems
---------------
-
-* macOS: If MacPorts is installed there is some danger that
-  accidental references to its shared libraries are created
-  (e.g. libgmp).  Use otool -L to check if compiled binaries also work
-  without MacPorts.
-
-* macOS: If MacPorts is installed and its version of Perl takes
-  precedence over /usr/bin/perl in the PATH, then the end-user needs
-  to take care of installing extra modules, e.g. for HTTP support.
-  Such add-ons are usually included in Apple's /usr/bin/perl by
-  default.
-
-* Common Unix tools like /bin/sh, /bin/kill, sed, ulimit are
-  notoriously non-portable an should be avoided.
-
-* The traditional "uname" Unix tool only tells about its own executable
-  format, not the underlying platform!
--- a/Admin/Release/CHECKLIST	Wed Mar 31 16:01:31 2021 +0200
+++ b/Admin/Release/CHECKLIST	Mon Sep 06 12:08:20 2021 +0200
@@ -15,6 +15,8 @@
 
 - test Isabelle/jEdit: print buffer
 
+- test Isabelle/jEdit: deactivate main plugin;
+
 - test "#!/usr/bin/env isabelle_scala_script";
 
 - test Windows 10 subsystem for Linux:
@@ -43,7 +45,7 @@
 
 - update https://isabelle.sketis.net/repos/isabelle-website
 
-- check doc/Contents, src/Tools/jEdit/dist/doc/Contents;
+- check doc/Contents, $JEDIT_HOME/doc/Contents;
 
 - test old HD display: Linux, Windows, macOS;
 
@@ -74,7 +76,7 @@
 
 - fully-automated packaging (e.g. on lxcisa0):
 
-  hg up -r DISTNAME && Admin/build_release -b HOL -l -O -R DISTNAME /home/isabelle/dist
+  hg up -r DISTNAME && Admin/build_release -D /home/isabelle/dist -b HOL -l -R DISTNAME
 
 - Docker image:
 
--- a/Admin/Windows/Cygwin/README	Wed Mar 31 16:01:31 2021 +0200
+++ b/Admin/Windows/Cygwin/README	Mon Sep 06 12:08:20 2021 +0200
@@ -18,6 +18,7 @@
   - https://isabelle.sketis.net/cygwin_2018  (Isabelle2018)
   - https://isabelle.sketis.net/cygwin_2019  (Isabelle2019)
   - https://isabelle.sketis.net/cygwin_2020  (Isabelle2020)
+  - https://isabelle.sketis.net/cygwin_2021  (Isabelle2021)
 
 * Apache2 redirects for virtual host isabelle.conf:
 ```
@@ -43,6 +44,8 @@
   Redirect /cygwin_2019/noarch/release https://ftp.eq.uc.pt/software/pc/prog/cygwin/noarch/release
   Redirect /cygwin_2020/x86_64/release https://ftp.eq.uc.pt/software/pc/prog/cygwin/x86_64/release
   Redirect /cygwin_2020/noarch/release https://ftp.eq.uc.pt/software/pc/prog/cygwin/noarch/release
+  Redirect /cygwin_2021/x86_64/release https://ftp.eq.uc.pt/software/pc/prog/cygwin/x86_64/release
+  Redirect /cygwin_2021/noarch/release https://ftp.eq.uc.pt/software/pc/prog/cygwin/noarch/release
 ```
 
 * Quasi-component: "isabelle build_cygwin" (as Administrator)
--- a/Admin/Windows/launch4j/isabelle.xml	Wed Mar 31 16:01:31 2021 +0200
+++ b/Admin/Windows/launch4j/isabelle.xml	Mon Sep 06 12:08:20 2021 +0200
@@ -15,7 +15,7 @@
   <manifest></manifest>
   <icon>{ICON}</icon>
   <classPath>
-    <mainClass>isabelle.Main</mainClass>
+    <mainClass>isabelle.jedit.Main</mainClass>
 {CLASSPATH}
   </classPath>
   <singleInstance>
--- a/Admin/bash_process/bash_process.c	Wed Mar 31 16:01:31 2021 +0200
+++ b/Admin/bash_process/bash_process.c	Mon Sep 06 12:08:20 2021 +0200
@@ -37,13 +37,12 @@
 {
   /* args */
 
-  if (argc < 3) {
-    fprintf(stderr, "Bad arguments: PID_FILE and TIMING_FILE required\n");
+  if (argc < 2) {
+    fprintf(stderr, "Bad arguments: missing TIMING_FILE\n");
     fflush(stderr);
     exit(1);
   }
-  char *pid_name = argv[1];
-  char *timing_name = argv[2];
+  char *timing_name = argv[1];
 
 
   /* potential fork */
@@ -101,26 +100,16 @@
 
   /* report pid */
 
-  if (strcmp(pid_name, "-") == 0) {
-    fprintf(stdout, "%d\n", getpid());
-    fflush(stdout);
-  }
-  else if (strlen(pid_name) > 0) {
-    FILE *pid_file;
-    pid_file = fopen(pid_name, "w");
-    if (pid_file == NULL) fail("Cannot open pid file");
-    fprintf(pid_file, "%d", getpid());
-    fclose(pid_file);
-  }
+  fprintf(stdout, "%d\n", getpid());
+  fflush(stdout);
 
 
   /* shift command line */
 
   int i;
-  for (i = 3; i < argc; i++) {
-    argv[i - 3] = argv[i];
+  for (i = 2; i < argc; i++) {
+    argv[i - 2] = argv[i];
   }
-  argv[argc - 3] = NULL;
   argv[argc - 2] = NULL;
   argv[argc - 1] = NULL;
 
--- a/Admin/bash_process/build	Wed Mar 31 16:01:31 2021 +0200
+++ b/Admin/bash_process/build	Mon Sep 06 12:08:20 2021 +0200
@@ -2,6 +2,7 @@
 #
 # Multi-platform build script
 
+unset CDPATH
 THIS="$(cd "$(dirname "$0")"; pwd)"
 PRG="$(basename "$0")"
 
@@ -36,16 +37,16 @@
 mkdir -p "$TARGET"
 
 case "$TARGET" in
+  arm64-linux)
+    cc -Wall bash_process.c -o "$TARGET/bash_process"
+    ;;
   x86_64-linux | x86_64-darwin)
     cc -Wall -m64 bash_process.c -o "$TARGET/bash_process"
     ;;
-  x86-linux | x86-darwin)
-    cc -Wall -m32 bash_process.c -o "$TARGET/bash_process"
-    ;;
-  x86_64-cygwin | x86-cygwin)
+  x86_64-cygwin)
     cc -Wall bash_process.c -o "$TARGET/bash_process.exe"
     ;;
   *)
-    cc -Wall bash_process.c -o "$TARGET/bash_process"
+    fail "Bad target platform: \"$TARGET\""
     ;;
 esac
--- a/Admin/bash_process/etc/settings	Wed Mar 31 16:01:31 2021 +0200
+++ b/Admin/bash_process/etc/settings	Mon Sep 06 12:08:20 2021 +0200
@@ -1,3 +1,3 @@
 # -*- shell-script -*- :mode=shellscript:
 
-ISABELLE_BASH_PROCESS="$COMPONENT/${ISABELLE_PLATFORM64:-$ISABELLE_PLATFORM32}/bash_process"
+ISABELLE_BASH_PROCESS="$COMPONENT/$ISABELLE_PLATFORM64/bash_process"
--- a/Admin/build	Wed Mar 31 16:01:31 2021 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,90 +0,0 @@
-#!/usr/bin/env bash
-#
-# Administrative build for Isabelle source distribution.
-
-## directory layout
-
-if [ -z "$ISABELLE_HOME" ]; then
-  ISABELLE_HOME="$(cd "$(dirname "$0")"; cd "$(pwd -P)"; cd ..; pwd)"
-  ISABELLE_TOOL="$ISABELLE_HOME/bin/isabelle"
-fi
-
-
-## diagnostics
-
-PRG="$(basename "$0")"
-
-function usage()
-{
-  cat <<EOF
-
-Usage: $PRG [MODULES]
-
-  Produce Isabelle distribution modules from current repository sources.
-  The MODULES list may contain any of the following:
-
-    all             all modules below
-    browser         graph browser
-    jars            Isabelle/Scala
-    jars_fresh      fresh build of jars
-
-EOF
-  exit 1
-}
-
-function fail()
-{
-  echo "$1" >&2
-  exit 2
-}
-
-
-## process command line
-
-[ "$#" -eq 0 ] && usage
-
-MODULES="$@"; shift "$#"
-
-
-## modules
-
-function build_all ()
-{
-  build_browser
-  build_jars
-}
-
-
-function build_browser ()
-{
-  pushd "$ISABELLE_HOME/lib/browser" >/dev/null
-  "$ISABELLE_TOOL" env ./build || exit $?
-  popd >/dev/null
-}
-
-
-function build_jars ()
-{
-  pushd "$ISABELLE_HOME" >/dev/null
-  "$ISABELLE_TOOL" env src/Pure/build-jars "$@" || exit $?
-  popd >/dev/null
-}
-
-
-## main
-
-#FIXME workarounds for scalac 2.11.0
-export CYGWIN="nodosfilewarning"
-function stty() { :; }
-export -f stty
-
-for MODULE in $MODULES
-do
-  case $MODULE in
-    all) build_all;;
-    browser) build_browser;;
-    jars) build_jars;;
-    jars_fresh) build_jars -f;;
-    *) fail "Bad module $MODULE"
-  esac
-done
--- a/Admin/build_history	Wed Mar 31 16:01:31 2021 +0200
+++ b/Admin/build_history	Mon Sep 06 12:08:20 2021 +0200
@@ -2,7 +2,8 @@
 #
 # DESCRIPTION: build history versions from another repository clone
 
+unset CDPATH
 THIS="$(cd "$(dirname "$0")"; pwd)"
 
-"$THIS/build" jars > /dev/null || exit $?
-exec "$THIS/../bin/isabelle_java" isabelle.Build_History "$@"
+"$THIS/../bin/isabelle" scala_build -q || exit $?
+"$THIS/../bin/isabelle_java" isabelle.Build_History "$@"
--- a/Admin/build_release	Wed Mar 31 16:01:31 2021 +0200
+++ b/Admin/build_release	Mon Sep 06 12:08:20 2021 +0200
@@ -2,7 +2,8 @@
 #
 # DESCRIPTION: build full Isabelle distribution from repository
 
+unset CDPATH
 THIS="$(cd "$(dirname "$0")"; pwd)"
 
-"$THIS/build" jars || exit $?
-exec "$THIS/../bin/isabelle_java" isabelle.Build_Release "$@"
+"$THIS/../bin/isabelle" scala_build -q || exit $?
+"$THIS/../bin/isabelle_java" isabelle.Build_Release "$@"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Admin/components/PLATFORMS	Mon Sep 06 12:08:20 2021 +0200
@@ -0,0 +1,110 @@
+Multi-platform support of Isabelle
+==================================
+
+Preamble
+--------
+
+The general programming model is that of a stylized ML + Scala + POSIX
+environment, with a minimum of system-specific code in user-space
+tools.
+
+The Isabelle system infrastructure provides some facilities to make
+this work, e.g. see the ML and Scala modules File and Path, or
+functions like Isabelle_System.bash.  The settings environment also
+provides some means for portability, e.g. the bash function
+"platform_path" to keep the impression that Windows/Cygwin adheres to
+Isabelle/POSIX standards, although many executables are native on
+Windows (notably Poly/ML and Java).
+
+When producing add-on tools, it is important to stay within this clean
+room of Isabelle, and refrain from non-portable access to operating
+system functions. The Isabelle environment uses GNU bash and
+Isabelle/Scala as portable system infrastructure, using somewhat
+peculiar implementation techniques.
+
+
+Supported platforms
+-------------------
+
+A broad range of hardware and operating system platforms are supported
+by building executables on base-line versions that are neither too old
+nor too new. Common OS families should work: Linux, macOS,
+Windows. More exotic platforms are unsupported: NixOS, BSD, Solaris.
+
+Official platforms:
+
+  x86_64-linux      Ubuntu 16.04 LTS
+
+  x86_64-darwin     macOS 10.13 High Sierra (lapbroy68 MacBookPro11,2)
+                    macOS 10.14 Mojave (mini2 Macmini8,1)
+                    macOS 10.15 Catalina (laramac01 Macmini8,1)
+                    macOS 11 Big Sur (mini1 Macmini8,1)
+
+  arm64-darwin      macOS 11 Big Sur
+
+  x86_64-windows    Windows 10
+  x86_64-cygwin     Cygwin 3.1.x https://isabelle.sketis.net/cygwin_2021 (x86_64/release)
+
+Experimental platforms:
+
+  arm64-linux       Raspberry Pi OS 64bit beta (Debian 10 / Buster)
+
+
+64 bit vs. 32 bit platform personality
+--------------------------------------
+
+Isabelle requires 64 bit hardware running a 64 bit operating
+system. Only Windows still supports native x86 executables, but the
+POSIX emulation on Windows via Cygwin64 works exclusively for x86_64.
+
+The Isabelle settings environment provides variable
+ISABELLE_PLATFORM64 to refer to the standard platform personality. On
+Windows this is for Cygwin64, but the following native platform
+identifiers are available as well:
+
+  ISABELLE_WINDOWS_PLATFORM64
+  ISABELLE_WINDOWS_PLATFORM32
+
+These are always empty on Linux and macOS, and non-empty on
+Windows. For example, this is how to refer to native Windows and
+fall-back on Unix (always 64 bit):
+
+  "${ISABELLE_WINDOWS_PLATFORM64:-$ISABELLE_PLATFORM64}"
+
+And this is for old 32 bit executables on Windows, but still 64 bit on
+Unix:
+
+  "${ISABELLE_WINDOWS_PLATFORM32:-$ISABELLE_PLATFORM64}"
+
+For Apple Silicon the native platform is "$ISABELLE_APPLE_PLATFORM64"
+(arm64-darwin), but thanks to Rosetta 2 "$ISABELLE_PLATFORM64"
+(x64_64-darwin) works routinely with fairly good performance.
+
+
+Dependable system tools
+-----------------------
+
+The following portable system tools can be taken for granted:
+
+* Scala on top of Java.  Isabelle/Scala irons out many fine points of
+  the Java platform to make it fully portable as described above.
+
+* GNU bash as uniform shell on all platforms. The POSIX "standard"
+  shell /bin/sh does *not* work portably -- there are too many
+  non-standard implementations of it. On Debian and Ubuntu /bin/sh is
+  actually /bin/dash and introduces many oddities.
+
+
+Known problems
+--------------
+
+* macOS: If Homebrew or MacPorts is installed, there is some danger
+  that accidental references to its shared libraries are created
+  (e.g. libgmp).  Use otool -L to check if compiled binaries also work
+  without MacPorts.
+
+* Common Unix tools like /bin/sh, /bin/kill, sed, ulimit are
+  notoriously non-portable an should be avoided.
+
+* The traditional "uname" Unix tool only tells about its own
+  executable format, not the underlying platform!
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Admin/components/bundled-linux_arm	Mon Sep 06 12:08:20 2021 +0200
@@ -0,0 +1,2 @@
+#additional components to be bundled for release
+Isabelle_app-20210126
--- a/Admin/components/components.sha1	Wed Mar 31 16:01:31 2021 +0200
+++ b/Admin/components/components.sha1	Mon Sep 06 12:08:20 2021 +0200
@@ -13,6 +13,9 @@
 97b2491382130a841b3bbaebdcf8720c4d4fb227  bash_process-1.2.2.tar.gz
 5c5b7c18cc1dc2a4d22b997dac196da09eaca868  bash_process-1.2.3-1.tar.gz
 48b01bd9436e243ffcb7297f08b498d0c0875ed9  bash_process-1.2.3.tar.gz
+11815d5f3af0de9022e903ed8702c136591f06fe  bash_process-1.2.4-1.tar.gz
+729486311833e4eff0fbf2d8041dddad520ca88c  bash_process-1.2.4-2.tar.gz
+7ae9ec8aab2d8a811842d9dc67d8bf6c179e11ee  bash_process-1.2.4.tar.gz
 9e21f447bfa0431ae5097301d553dd6df3c58218  bash_process-1.2.tar.gz
 a65ce644b6094d41e9f991ef851cf05eff5dd0a9  bib2xhtml-20171221.tar.gz
 4085dd6060a32d7e0d2e3f874c463a9964fd409b  bib2xhtml-20190409.tar.gz
@@ -87,7 +90,10 @@
 dac46ce81cee10fb36a9d39b414dec7b7b671545  flatlaf-1.0-rc2.tar.gz
 d94e6da7299004890c04a7b395a3f2d381a3281e  flatlaf-1.0-rc3.tar.gz
 7ca3e6a8c9bd837990e64d89e7fa07a7e7cf78ff  flatlaf-1.0.tar.gz
+9908e5ab721f1c0035c0ab04dc7ad0bd00a8db27  flatlaf-1.2.tar.gz
+f339234ec18369679be0095264e0c0af7762f351  gnu-utils-20210414.tar.gz
 683acd94761ef460cca1a628f650355370de5afb  hol-light-bundle-0.5-126.tar.gz
+989234b3799fe8750f3c24825d1f717c24fb0214  idea-icons-20210508.tar.gz
 20b53cfc3ffc5b15c1eabc91846915b49b4c0367  isabelle_fonts-20151021.tar.gz
 736844204b2ef83974cd9f0a215738b767958c41  isabelle_fonts-20151104.tar.gz
 9502c1aea938021f154adadff254c5c55da344bd  isabelle_fonts-20151106.tar.gz
@@ -115,6 +121,21 @@
 b166b4bd583b6442a5d75eab06f7adbb66919d6d  isabelle_fonts-20210319.tar.gz
 9467ad54a9ac10a6e7e8db5458d8d2a5516eba96  isabelle_fonts-20210321.tar.gz
 1f7a0b9829ecac6552b21e995ad0f0ac168634f3  isabelle_fonts-20210322.tar.gz
+916adccd2f40c55116b68b92ce1eccb24d4dd9a2  isabelle_setup-20210630.tar.gz
+c611e363287fcc9bdd93c33bef85fa4e66cd3f37  isabelle_setup-20210701.tar.gz
+a0e7527448ef0f7ce164a38a50dc26e98de3cad6  isabelle_setup-20210709.tar.gz
+e413706694b0968245ee15183af2d464814ce0a4  isabelle_setup-20210711.tar.gz
+d2c9fd7b73457a460111edd6eb93a133272935fb  isabelle_setup-20210715.tar.gz
+a5f478ba1088f67c2c86dc2fa7764b6d884e5ae5  isabelle_setup-20210716-1.tar.gz
+79fad009cb22aa5e7cb4aed3c810ad5f61790293  isabelle_setup-20210716.tar.gz
+692a39f716998e556ec9559c9ca362fc8fc9d5b6  isabelle_setup-20210717-1.tar.gz
+7322d6d84d75c486a58ed36630431db4499e3232  isabelle_setup-20210717-2.tar.gz
+14f8508bcae9140815bb23e430e26d2cbc504b81  isabelle_setup-20210717.tar.gz
+ca801d5c380ea896ee32b309ff19ae5f34538963  isabelle_setup-20210718.tar.gz
+ac9739e38e4fbbfce1a71a0987a57b22f83922d3  isabelle_setup-20210724-1.tar.gz
+4554679cc8ea31e539655810a14d14216b383d0e  isabelle_setup-20210724-2.tar.gz
+127a75ae33e97480d352087fcb9b47a632d77169  isabelle_setup-20210724.tar.gz
+309909ec6d43ae460338e9af54c1b2a48adcb1ec  isabelle_setup-20210726.tar.gz
 0b2206f914336dec4923dd0479d8cee4b904f544  jdk-11+28.tar.gz
 e12574d838ed55ef2845acf1152329572ab0cc56  jdk-11.0.10+9.tar.gz
 3e05213cad47dbef52804fe329395db9b4e57f39  jdk-11.0.2+9.tar.gz
@@ -158,6 +179,10 @@
 dfb087bd64c3e5da79430e0ba706b9abc559c090  jdk-8u66.tar.gz
 2ac389babd15aa5ddd1a424c1509e1c459e6fbb1  jdk-8u72.tar.gz
 caa0cf65481b6207f66437576643f41dabae3c83  jdk-8u92.tar.gz
+778fd85c827ec49d2d658a832d20e63916186b0d  jedit-20210715.tar.gz
+beb99f2cb0bd4e595c5c597d3970c46aa21616e4  jedit-20210717.tar.gz
+33dd96cd83f2c6a26c035b7a0ee57624655224c5  jedit-20210724.tar.gz
+0e4fd4d66388ddc760fa5fbd8d4a9a3b77cf59c7  jedit-20210802.tar.gz
 44775a22f42a9d665696bfb49e53c79371c394b0  jedit_build-20111217.tar.gz
 a242a688810f2bccf24587b0062ce8027bf77fa2  jedit_build-20120304.tar.gz
 4c948dee53f74361c097c08f49a1a5ff9b17bd1d  jedit_build-20120307.tar.gz
@@ -200,6 +225,9 @@
 533b1ee6459f59bcbe4f09e214ad2cb990fb6952  jedit_build-20200908.tar.gz
 f9966b5ed26740bb5b8bddbfe947fcefaea43d4d  jedit_build-20201223.tar.gz
 0bdbd36eda5992396e9c6b66aa24259d4dd7559c  jedit_build-20210201.tar.gz
+a0744f1948abdde4bfb51dd4769b619e7444baf1  jedit_build-20210510-1.tar.gz
+837d6c8f72ecb21ad59a2544c69aadc9f05684c6  jedit_build-20210510.tar.gz
+7bdae3d24b10261f6cb277446cf9ecab6062bd6f  jedit_build-20210708.tar.gz
 0bd2bc2d9a491ba5fc8dd99df27c04f11a72e8fa  jfreechart-1.0.14-1.tar.gz
 8122526f1fc362ddae1a328bdbc2152853186fee  jfreechart-1.0.14.tar.gz
 d911f63a5c9b4c7335bb73f805cb1711ce017a84  jfreechart-1.5.0.tar.gz
@@ -280,6 +308,7 @@
 9043828803483ca14df64488dff014ad050a6d34  polyml-5.8.1-20200228.tar.gz
 1186607e2c43b77db86731f12fbedb531ca50a21  polyml-5.8.1-20200708.tar.gz
 22ae16bf7850e73b903d2ca8eb506da05b441cf3  polyml-5.8.1.tar.gz
+cb8e85387315f62dcfc6b21ec378186e58068f76  polyml-5.8.2.tar.gz
 d1fd6eced69dc1df7226432fcb824568e0994ff2  polyml-5.8.tar.gz
 49f1adfacdd6d29fa9f72035d94a31eaac411a97  polyml-test-0a6ebca445fc.tar.gz
 2a8c4421e0a03c0d6ad556b3c36c34eb11568adb  polyml-test-1236652ebd55.tar.gz
@@ -337,6 +366,7 @@
 a0622fe75c3482ba7dc3ce74d58583b648a1ff0d  scala-2.13.4-1.tar.gz
 ec53cce3c5edda1145ec5d13924a5f9418995c15  scala-2.13.4.tar.gz
 f51981baf34c020ad103b262f81796c37abcaa4a  scala-2.13.5.tar.gz
+0a7cab09dec357dab7819273f2542ff1c3ea0968  scala-2.13.6.tar.gz
 b447017e81600cc5e30dd61b5d4962f6da01aa80  scala-2.8.1.final.tar.gz
 5659440f6b86db29f0c9c0de7249b7e24a647126  scala-2.9.2.tar.gz
 abe7a3b50da529d557a478e9f631a22429418a67  smbc-0.4.1.tar.gz
@@ -358,6 +388,7 @@
 6e19948ff4a821e2052fc9b3ddd9ae343f4fcdbb  stack-1.9.3.tar.gz
 f969443705aa8619e93af5b34ea98d15cd7efaf1  stack-2.1.3.tar.gz
 ebd0221d038966aa8bde075f1b0189ff867b02ca  stack-2.5.1.tar.gz
+fa2d882ec45cbc8c7d2f3838b705a8316696dc66  stack-2.7.3.tar.gz
 1f4a2053cc1f34fa36c4d9d2ac906ad4ebc863fd  sumatra_pdf-2.1.1.tar.gz
 601e08d048d8e50b0729429c8928b667d9b6bde9  sumatra_pdf-2.3.2.tar.gz
 14d46c2eb1a34821703da59d543433f581e91df3  sumatra_pdf-2.4.tar.gz
--- a/Admin/components/main	Wed Mar 31 16:01:31 2021 +0200
+++ b/Admin/components/main	Mon Sep 06 12:08:20 2021 +0200
@@ -1,26 +1,29 @@
-#main components for everyday use, without big impact on overall build time
-bash_process-1.2.3-1
+#main components for repository clones or release bundles
+gnu-utils-20210414
+bash_process-1.2.4-2
 bib2xhtml-20190409
 csdp-6.1.1
 cvc4-1.8
 e-2.5-1
-flatlaf-1.0
+flatlaf-1.2
+idea-icons-20210508
 isabelle_fonts-20210322
+isabelle_setup-20210726
 jdk-15.0.2+7
-jedit_build-20210201
+jedit-20210802
 jfreechart-1.5.1
 jortho-1.0-2
 kodkodi-1.5.6-1
 nunchaku-0.5
 opam-2.0.7
-polyml-test-f86ae3dc1686
+polyml-5.8.2
 postgresql-42.2.18
 scala-2.13.5
 smbc-0.4.1
 spass-3.8ds-2
 sqlite-jdbc-3.34.0
 ssh-java-20190323
-stack-2.5.1
+stack-2.7.3
 vampire-4.2.2
 verit-2020.10-rmx-1
 xz-java-1.8
--- a/Admin/components/optional	Wed Mar 31 16:01:31 2021 +0200
+++ b/Admin/components/optional	Mon Sep 06 12:08:20 2021 +0200
@@ -1,2 +1,2 @@
-#optional components that could impact build time significantly
+#optional components: somewhat experimental tools
 hol-light-bundle-0.5-126
--- a/Admin/components/windows	Wed Mar 31 16:01:31 2021 +0200
+++ b/Admin/components/windows	Mon Sep 06 12:08:20 2021 +0200
@@ -1,2 +1,2 @@
-#components for "windows" platform family
+#additional components to be bundled for release
 sumatra_pdf-3.1.2-2
--- a/Admin/cronjob/README	Wed Mar 31 16:01:31 2021 +0200
+++ b/Admin/cronjob/README	Mon Sep 06 12:08:20 2021 +0200
@@ -21,7 +21,7 @@
 Build Log Database Server
 =========================
 
-- Ubuntu 18.04 LTS Linux Server standard installation
+- Ubuntu 20.04 LTS Linux Server standard installation
   https://help.ubuntu.com/lts/serverguide
 
 - apt install unattended-upgrades
--- a/Admin/cronjob/main	Wed Mar 31 16:01:31 2021 +0200
+++ b/Admin/cronjob/main	Mon Sep 06 12:08:20 2021 +0200
@@ -2,11 +2,11 @@
 #
 # DESCRIPTION: start the main Isabelle cronjob
 
+unset CDPATH
 THIS="$(cd "$(dirname "$0")"; pwd)"
 
 source "$HOME/.bashrc"
 
 export ISABELLE_IDENTIFIER="cronjob"
-"$THIS/../build" jars_fresh || exit $?
-
-exec "$THIS/../../bin/isabelle_java" isabelle.Isabelle_Cronjob "$@"
+"$THIS/../../bin/isabelle" scala_build -q || exit $?
+"$THIS/../../bin/isabelle_java" isabelle.Isabelle_Cronjob "$@"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Admin/etc/build.props	Mon Sep 06 12:08:20 2021 +0200
@@ -0,0 +1,3 @@
+title = Isabelle/Scala/Admin
+module = $ISABELLE_HOME/lib/classes/isabelle_admin.jar
+services = isabelle.Admin_Tools
--- a/Admin/etc/options	Wed Mar 31 16:01:31 2021 +0200
+++ b/Admin/etc/options	Mon Sep 06 12:08:20 2021 +0200
@@ -5,13 +5,16 @@
 option isabelle_components_server : string = "lxbroy10.informatik.tu-muenchen.de"
   -- "user@host for SSH connection"
 
-option isabelle_components_dir : string = "/home/isabelle/components"
+option isabelle_components_dir : string = "/p/home/isabelle/components"
   -- "webspace for ISABELLE_COMPONENT_REPOSITORY"
 
-option isabelle_components_contrib_dir : string = "/home/isabelle/contrib"
+option isabelle_components_contrib_dir : string = "/p/home/isabelle/contrib"
   -- "unpacked components for remote build services"
 
 
+option build_host_linux_arm : string = ""
+  -- "SSH user@host for remote build of heaps"
+
 option build_host_linux : string = ""
   -- "SSH user@host for remote build of heaps"
 
--- a/Admin/haskell/stack/README	Wed Mar 31 16:01:31 2021 +0200
+++ b/Admin/haskell/stack/README	Mon Sep 06 12:08:20 2021 +0200
@@ -1,12 +1,12 @@
-This is stack 1.9.3 -- the Haskell Tool Stack.
+This is stack 2.5.1 -- the Haskell Tool Stack.
 
 See also https://www.haskellstack.org and executables from
-https://github.com/commercialhaskell/stack/releases as follows:
+https://github.com/commercialhaskell/stack/releases/tag/v2.7.3 as follows:
 
-  * x86_64-linux: stack-1.9.3-linux-x86_64-static.tar.gz
-  * x86_64-darwin: stack-1.9.3-osx-x86_64.tar.gz
-  * x86_64-windows: stack-1.9.3-windows-x86_64.tar.gz
+  * x86_64-linux: stack-2.7.3-linux-x86_64.tar.gz
+  * x86_64-darwin: stack-2.7.3-osx-x86_64.tar.gz
+  * x86_64-windows: stack-2.7.3-windows-x86_64.tar.gz
 
 
     Makarius
-    07-Dec-2018
+    25-Jul-2021
--- a/Admin/init	Wed Mar 31 16:01:31 2021 +0200
+++ b/Admin/init	Mon Sep 06 12:08:20 2021 +0200
@@ -7,6 +7,7 @@
 
 ## environment
 
+unset CDPATH
 export ISABELLE_HOME="$(cd "$(dirname "$0")"; cd "$(pwd -P)"; cd ..; pwd)"
 
 ISABELLE_REPOS="https://isabelle.sketis.net/repos/isabelle"
@@ -21,16 +22,18 @@
   echo
   echo "  Options are:"
   echo "    -C           force clean working directory (no backup!)"
+  echo "    -I NAME      set \$ISABELLE_HOME/etc/ISABELLE_IDENTIFIER (or reset via -I:)"
+  echo "    -L           local history only: no pull from repository server"
   echo "    -R           version is current official release"
   echo "    -U URL       Isabelle repository server"
   echo "                 (default: \"$ISABELLE_REPOS\")"
-  echo "    -V PATH      version from explicit file, or directory that contains"
-  echo "                 the file \"ISABELLE_VERSION\""
+  echo "    -V PATH      version is taken from file, or directory"
+  echo "                 with file \"ISABELLE_VERSION\""
   echo "    -c           check clean working directory"
   echo "    -f           fresh build of Isabelle/Scala/jEdit"
   echo "    -n           no build of Isabelle/Scala/jEdit"
-  echo "    -r REV       version in Mercurial notation (changeset id or tag)"
-  echo "    -u           version is latest tip from repository server or local clone"
+  echo "    -r REV       version given in Mercurial notation (changeset id or tag)"
+  echo "    -u           update to latest tip"
   echo
   echo "  Initialize the current ISABELLE_HOME directory, which needs to be a"
   echo "  repository clone (all versions) or repository archive (fixed version)."
@@ -51,6 +54,9 @@
 #options
 
 BUILD_OPTIONS="-b"
+UPDATE_IDENTIFIER=""
+IDENTIFIER=""
+PULL="true"
 
 CLEAN_FORCE=""
 CLEAN_CHECK=""
@@ -60,12 +66,23 @@
 VERSION_PATH=""
 VERSION_REV=""
 
-while getopts "CRU:V:cfnr:u" OPT
+while getopts "CI:LRU:V:cfnr:u" OPT
 do
   case "$OPT" in
     C)
       CLEAN_FORCE="--clean"
       ;;
+    I)
+      UPDATE_IDENTIFIER="true"
+      if [ "$OPTARG" = ":" ]; then
+        IDENTIFIER=""
+      else
+        IDENTIFIER="$OPTARG"
+      fi
+      ;;
+    L)
+      PULL=""
+      ;;
     R)
       VERSION="true"
       VERSION_RELEASE="true"
@@ -118,9 +135,27 @@
 
 ## main
 
+if [ -f "$ISABELLE_HOME/etc/ISABELLE_IDENTIFIER" ]; then
+  OLD_IDENTIFIER="$(cat "$ISABELLE_HOME/etc/ISABELLE_IDENTIFIER")"
+else
+  OLD_IDENTIFIER=""
+fi
+
+if [ -n "$UPDATE_IDENTIFIER" -a "$IDENTIFIER" != "$OLD_IDENTIFIER" ]; then
+  OLD_ISABELLE_HOME_USER="$("$ISABELLE_HOME/bin/isabelle" getenv -b ISABELLE_HOME_USER)"
+  if [ -n "$IDENTIFIER" ]; then
+    echo -n "$IDENTIFIER" > "$ISABELLE_HOME/etc/ISABELLE_IDENTIFIER"
+  else
+    rm -f "$ISABELLE_HOME/etc/ISABELLE_IDENTIFIER"
+  fi
+  ISABELLE_HOME_USER="$("$ISABELLE_HOME/bin/isabelle" getenv -b ISABELLE_HOME_USER)"
+  echo "Changed \$ISABELLE_HOME/etc/ISABELLE_IDENTIFIER: \"$OLD_IDENTIFIER\" ~> \"$IDENTIFIER\""
+  echo "Changed \$ISABELLE_HOME_USER: \"$OLD_ISABELLE_HOME_USER\" ~> \"$ISABELLE_HOME_USER\""
+fi
+
 if [ -z "$VERSION" ]; then
-  "$ISABELLE_HOME/bin/isabelle" components -I || exit "?$"
-  "$ISABELLE_HOME/bin/isabelle" components -a || exit "?$"
+  "$ISABELLE_HOME/bin/isabelle" components -I || exit "$?"
+  "$ISABELLE_HOME/bin/isabelle" components -a || exit "$?"
   if [ -n "$BUILD_OPTIONS" ]; then
     "$ISABELLE_HOME/bin/isabelle" jedit $BUILD_OPTIONS
   fi
@@ -151,10 +186,12 @@
   export HGPLAIN=
 
   #Atomic exec: avoid inplace update of running script!
-  export CLEAN_FORCE CLEAN_CHECK REV ISABELLE_REPOS BUILD_OPTIONS
+  export PULL CLEAN_FORCE CLEAN_CHECK REV ISABELLE_REPOS BUILD_OPTIONS
   exec bash -c '
     set -e
-    "${HG:-hg}" -R "$ISABELLE_HOME" pull -r "$REV" "$ISABELLE_REPOS"
+    if [ -n "$PULL" ]; then
+      "${HG:-hg}" -R "$ISABELLE_HOME" pull -r "$REV" "$ISABELLE_REPOS"
+    fi
     "${HG:-hg}" -R "$ISABELLE_HOME" update -r "$REV" $CLEAN_FORCE $CLEAN_CHECK
     "$ISABELLE_HOME/bin/isabelle" components -a
     if [ -n "$BUILD_OPTIONS" ]; then
--- a/Admin/jenkins/build/ci_build_benchmark.scala	Wed Mar 31 16:01:31 2021 +0200
+++ b/Admin/jenkins/build/ci_build_benchmark.scala	Mon Sep 06 12:08:20 2021 +0200
@@ -9,8 +9,8 @@
   def include = Nil
   def select = List(Path.explode("$ISABELLE_HOME/src/Benchmarks"))
 
-  def pre_hook(args: List[String]) = {}
-  def post_hook(results: Build.Results) = {}
+  def pre_hook(args: List[String]) = Result.ok
+  def post_hook(results: Build.Results) = Result.ok
 
   def selection = Sessions.Selection(session_groups = List("timing"))
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Admin/lib/Tools/build_setup	Mon Sep 06 12:08:20 2021 +0200
@@ -0,0 +1,78 @@
+#!/usr/bin/env bash
+#
+# Author: Makarius
+#
+# DESCRIPTION: build component for Isabelle/Java setup tool
+
+## usage
+
+PRG=$(basename "$0")
+
+function usage()
+{
+  echo
+  echo "Usage: isabelle $PRG [OPTIONS] COMPONENT_DIR"
+  echo
+  echo "  Build component for Isabelle/Java setup tool."
+  echo
+  exit 1
+}
+
+function fail()
+{
+  echo "$1" >&2
+  exit 2
+}
+
+
+## process command line
+
+[ "$#" -ge 1 ] && { COMPONENT_DIR="$1"; shift; }
+[ "$#" -ne 0 -o -z "$COMPONENT_DIR" ] && usage
+
+
+
+## main
+
+[ -d "$COMPONENT_DIR" ] && fail "Directory already exists: \"$COMPONENT_DIR\""
+
+
+# etc/settings
+
+mkdir -p "$COMPONENT_DIR/etc"
+cat > "$COMPONENT_DIR/etc/settings" <<EOF
+# -*- shell-script -*- :mode=shellscript:
+
+ISABELLE_SETUP_JAR="\$COMPONENT/lib/isabelle_setup.jar"
+classpath "\$ISABELLE_SETUP_JAR"
+EOF
+
+
+# build jar
+
+TARGET_DIR="$COMPONENT_DIR/lib"
+mkdir -p "$TARGET_DIR/isabelle/setup"
+
+declare -a ARGS=("-Xlint:unchecked")
+
+SOURCES="$(perl -e 'while (<>) { if (m/(\S+\.java)/)  { print "$1 "; } }' "$ISABELLE_HOME/src/Tools/Setup/etc/build.props")"
+for SRC in $SOURCES
+do
+  ARGS["${#ARGS[@]}"]="$(platform_path "$ISABELLE_HOME/src/Tools/Setup/$SRC")"
+done
+
+isabelle_jdk javac $ISABELLE_JAVAC_OPTIONS -d "$TARGET_DIR" \
+  -classpath "$(platform_path "$ISABELLE_CLASSPATH")" "${ARGS[@]}" || \
+  fail "Failed to compile sources"
+
+isabelle_jdk jar -c -f "$(platform_path "$TARGET_DIR/isabelle_setup.jar")" \
+  -e "isabelle.setup.Setup" -C "$TARGET_DIR" isabelle || fail "Failed to produce jar"
+
+rm -rf "$TARGET_DIR/isabelle"
+
+
+# README
+
+cat > "$COMPONENT_DIR/README" <<EOF
+Isabelle setup in pure Java, see also \$ISABELLE_HOME/src/Tools/Setup/.
+EOF
--- a/Admin/polyml/README	Wed Mar 31 16:01:31 2021 +0200
+++ b/Admin/polyml/README	Mon Sep 06 12:08:20 2021 +0200
@@ -1,9 +1,10 @@
 Poly/ML for Isabelle
 ====================
 
-This compilation of Poly/ML (http://www.polyml.org) is based on the
-repository version
-https://github.com/polyml/polyml/commit/f86ae3dc1686
+This compilation of Poly/ML (https://www.polyml.org) is based on the
+source distribution from
+https://github.com/polyml/polyml/commits/fixes-5.8.2 up to commit
+e6a463e1614f.
 
 The Isabelle repository provides an administrative tool "isabelle
 build_polyml", which can be used in the polyml component directory as
@@ -36,16 +37,22 @@
 
 * Download:
 
-  $ curl https://gmplib.org/download/gmp/gmp-6.1.2.tar.xz | xz -dc | tar xf -
-  $ cd gmp-6.1.2
+  $ curl https://gmplib.org/download/gmp/gmp-6.2.1.tar.bz2 | tar xjf -
+  $ cd gmp-6.2.1
 
 * build:
 
   $ make distclean
+
+  #Intel
   $ ./configure --enable-cxx --build=core2-apple-darwin"$(uname -r)"
+
+  #ARM
+  $ ./configure --enable-cxx --build=aarch64-apple-darwin"$(uname -r)"
+
   $ make && make check
   $ sudo make install
 
 
         Makarius
-        19-Nov-2020
+        11-May-2021
--- a/CONTRIBUTORS	Wed Mar 31 16:01:31 2021 +0200
+++ b/CONTRIBUTORS	Mon Sep 06 12:08:20 2021 +0200
@@ -6,6 +6,18 @@
 Contributions to this Isabelle version
 --------------------------------------
 
+* July 2021: Florian Haftmann
+  Further consolidation of bit operations and word types.
+
+* July 2021: Jasmin Blanchette and Martin Desharnais
+  Various improvements to Sledgehammer.
+
+* June 2021: Florian Haftmann
+  More context situations susceptible to global_interpretation.
+
+* March 2021: Lukas Stevens
+  New order prover
+
 * March 2021: Florian Haftmann
   Dedicated session for combinatorics.
 
--- a/NEWS	Wed Mar 31 16:01:31 2021 +0200
+++ b/NEWS	Mon Sep 06 12:08:20 2021 +0200
@@ -9,6 +9,17 @@
 
 *** General ***
 
+* Configuration option "show_results" controls output of final results
+in commands like 'definition' or 'theorem'. Output is normally enabled
+in interactive mode, but it could occasionally cause unnecessary
+slowdown. It can be disabled like this:
+
+  context notes [[show_results = true]]
+  begin
+    definition "test = True"
+    theorem test by (simp add: test_def)
+  end
+
 * Timeouts for Isabelle/ML tools are subject to system option
 "timeout_scale" --- this already used for the overall session build
 process before, and allows to adapt to slow machines. The underlying
@@ -27,23 +38,104 @@
 Isabelle/jEdit.
 
 
+*** Isabelle/jEdit Prover IDE ***
+
+* More robust 'proof' outline for method "induct": support nested cases.
+
+* Support for built-in font substitution of jEdit text area.
+
+* The main plugin for Isabelle/jEdit can be deactivated and reactivated
+as documented --- was broken at least since Isabelle2018.
+
+
 *** Document preparation ***
 
+* More predefined symbols: \<interleave> \<sslash> (package "stmaryrd"), \<checkmark> \<crossmark> (LaTeX package
+"pifont").
+
+* High-quality blackboard-bold symbols from font "txmia" (LaTeX package
+"pxfonts"): \<bbbA>\<bool>\<complex>\<bbbD>\<bbbE>\<bbbF>\<bbbG>\<bbbH>\<bbbI>\<bbbJ>\<bbbK>\<bbbL>\<bbbM>\<nat>\<bbbO>\<bbbP>\<rat>\<real>\<bbbS>\<bbbT>\<bbbU>\<bbbV>\<bbbW>\<bbbX>\<bbbY>\<int>.
+
+* Document antiquotations for ML text have been refined: "def" and "ref"
+variants support index entries, e.g. @{ML} (no entry) vs. @{ML_def}
+(bold entry) vs. @{ML_ref} (regular entry); @{ML_type} supports explicit
+type arguments for constructors (only relevant for index), e.g.
+@{ML_type \<open>'a list\<close>} vs. @{ML_type 'a \<open>list\<close>}; @{ML_op} has been renamed
+to @{ML_infix}. Minor INCOMPATIBILITY concerning name and syntax.
+
+* Option "document_logo" determines if an instance of the Isabelle logo
+should be created in the document output directory. The given string
+specifies the name of the logo variant, while "_" (underscore) refers to
+the unnamed variant. The output file name is always "isabelle_logo.pdf".
+
+* Option "document_preprocessor" specifies the name of an executable
+that is run within the document output directory, after preparing the
+document sources and before the actual build process. This allows to
+apply adhoc patches, without requiring a separate "build" script.
+
+* Option "document_build" determines the document build engine, as
+defined in Isabelle/Scala (as system service). The subsequent engines
+are provided by the Isabelle distribution:
+
+  - "lualatex" (default): use ISABELLE_LUALATEX for a standard LaTeX
+    build with optional ISABELLE_BIBTEX and ISABELLE_MAKEINDEX
+
+  - "pdflatex": as above, but use ISABELLE_PDFLATEX (legacy mode for
+    special LaTeX styles)
+
+  - "build": delegate to the executable "./build pdf"
+
+The presence of a "build" command within the document output directory
+explicitly requires document_build=build. Minor INCOMPATIBILITY, need to
+adjust session ROOT options.
+
+* The command-line tool "isabelle latex" has been discontinued,
+INCOMPATIBILITY for old document build scripts.
+
+  - Former "isabelle latex -o sty" has become obsolete: Isabelle .sty
+    files are automatically generated within the document output
+    directory.
+
+  - Former "isabelle latex -o pdf" should be replaced by
+    "$ISABELLE_LUALATEX root" or "$ISABELLE_PDFLATEX root" (without
+    quotes), according to the intended LaTeX engine.
+
+  - Former "isabelle latex -o bbl" should be replaced by
+    "$ISABELLE_BIBTEX root" (without quotes).
+
+  - Former "isabelle latex -o idx" should be replaced by
+    "$ISABELLE_MAKEINDEX root" (without quotes).
+
+* Option "document_bibliography" explicitly enables the use of bibtex;
+the default is to check the presence of root.bib, but it could have a
+different name.
+
 * Improved LaTeX typesetting of \<open>...\<close> using \guilsinglleft ...
 \guilsinglright. INCOMPATIBILITY, need to use \usepackage[T1]{fontenc}
 (which is now also the default in "isabelle mkroot").
 
+* Simplified typesetting of \<guillemotleft>...\<guillemotright> using \guillemotleft ...
+\guillemotright from \usepackage[T1]{fontenc} --- \usepackage{babel} is
+no longer required.
+
+
+*** Pure ***
+
+* "global_interpretation" is applicable in instantiation and overloading
+targets and in any nested target built on top of a target supporting
+"global_interpretation".
+
 
 *** HOL ***
 
-* Theory Multiset: dedicated predicate "multiset" is gone, use
-explict expression instead.  Minor INCOMPATIBILITY.
-
-* Theory Multiset: consolidated abbreviations Mempty, Melem, not_Melem
-to empty_mset, member_mset, not_member_mset respectively.  Minor
-INCOMPATIBILITY.
-
-* Theory Multiset: consolidated operation and fact names:
+* Theory "HOL-Library.Multiset": dedicated predicate "multiset" is gone,
+use explict expression instead. Minor INCOMPATIBILITY.
+
+* Theory "HOL-Library.Multiset": consolidated abbreviations Mempty,
+Melem, not_Melem to empty_mset, member_mset, not_member_mset
+respectively. Minor INCOMPATIBILITY.
+
+* Theory "HOL-Library.Multiset": consolidated operation and fact names:
     inf_subset_mset ~> inter_mset
     sup_subset_mset ~> union_mset
     multiset_inter_def ~> inter_mset_def
@@ -51,43 +143,111 @@
     multiset_inter_count ~> count_inter_mset
     sup_subset_mset_count ~> count_union_mset
 
-* Theory Multiset: syntax precendence for membership operations has been
-adjusted to match the corresponding precendences on sets.  Rare
-INCOMPATIBILITY.
-
-* HOL-Analysis/HOL-Probability: indexed products of discrete
-distributions, negative binomial distribution, Hoeffding's inequality,
-Chernoff bounds, Cauchy–Schwarz inequality for nn_integral, and some
-more small lemmas. Some theorems that were stated awkwardly before were
-corrected. Minor INCOMPATIBILITY.
+* Theory "HOL-Library.Multiset": syntax precendence for membership
+operations has been adjusted to match the corresponding precendences on
+sets. Rare INCOMPATIBILITY.
+
+* Theory "HOL-Library.Cardinality": code generator setup based on the
+type classes finite_UNIV and card_UNIV has been moved to
+"HOL-Library.Code_Cardinality", to avoid incompatibilities with
+other code setups for sets in AFP/Containers. Applications relying on
+this code setup should import "HOL-Library.Code_Cardinality". Minor
+INCOMPATIBILITY.
+
+* Session "HOL-Analysis" and "HOL-Probability": indexed products of
+discrete distributions, negative binomial distribution, Hoeffding's
+inequality, Chernoff bounds, Cauchy–Schwarz inequality for nn_integral,
+and some more small lemmas. Some theorems that were stated awkwardly
+before were corrected. Minor INCOMPATIBILITY.
+
+* Session "HOL-Analysis": the complex Arg function has been identified
+with the function "arg" of Complex_Main, renaming arg->Arg also in the
+names of arg_bounded. Minor INCOMPATIBILITY.
 
 * Theorems "antisym" and "eq_iff" in class "order" have been renamed to
 "order.antisym" and "order.eq_iff", to coexist locally with "antisym"
-and "eq_iff" from locale "ordering".  INCOMPATIBILITY: significant
+and "eq_iff" from locale "ordering". INCOMPATIBILITY: significant
 potential for change can be avoided if interpretations of type class
 "order" are replaced or augmented by interpretations of locale
 "ordering".
 
-* Theorem "swap_def" now is always qualified as "Fun.swap_def".  Minor
+* Theorem "swap_def" now is always qualified as "Fun.swap_def". Minor
 INCOMPATIBILITY; note that for most applications less elementary lemmas
 exists.
 
-* Dedicated session HOL-Combinatorics.  INCOMPATIBILITY: theories
+* Theory "HOL-Library.Permutation" has been renamed to the more specific
+"HOL-Library.List_Permutation". Note that most notions from that theory
+are already present in theory "HOL-Combinatorics.Permutations".
+INCOMPATIBILITY.
+
+* Dedicated session "HOL-Combinatorics". INCOMPATIBILITY: theories
 "Permutations", "List_Permutation" (formerly "Permutation"), "Stirling",
-"Multiset_Permutations"  have been
-moved there from session HOL-Library.  See theory "Guide" for an
-overview about existing material on basic combinatorics.
-
-* Theory "Permutation" in HOL-Library has been renamed to the more
-specific "List_Permutation".  Note that most notions from that
-theory are already present in theory "Permutations".  INCOMPATIBILITY.
-
-* Lemma "permutes_induct" has been given stronger
-hypotheses and named premises.  INCOMPATIBILITY.
+"Multiset_Permutations", "Perm" have been moved there from session
+HOL-Library.
+
+* Theory "HOL-Combinatorics.Transposition" provides elementary swap
+operation "transpose".
+
+* Lemma "permutes_induct" has been given stronger hypotheses and named
+premises. INCOMPATIBILITY.
+
+* Combinator "Fun.swap" resolved into a mere input abbreviation in
+separate theory "Transposition" in HOL-Combinatorics. INCOMPATIBILITY.
+
+* Infix syntax for bit operations AND, OR, XOR is now organized in
+bundle bit_operations_syntax. INCOMPATIBILITY.
+
+* Bit operations set_bit, unset_bit and flip_bit are now class
+operations. INCOMPATIBILITY.
+
+* Theory Bit_Operations is now part of HOL-Main. Minor INCOMPATIBILITY.
+
+* Simplified class hierarchy for bit operations: bit operations reside
+in classes (semi)ring_bit_operations, class semiring_bit_shifts is
+gone.
+
+* Expressions of the form "NOT (numeral _)" are not simplified by
+default any longer.  INCOMPATIBILITY, use not_one_eq and not_numeral_eq
+as simp rule explicitly if needed.
+
+* Abbreviation "max_word" has been moved to session Word_Lib in the AFP,
+as also have constants "shiftl1", "shiftr1", "sshiftr1", "bshiftr1",
+"setBit", "clearBit". See there further the changelog in theory Guide.
+INCOMPATIBILITY.
+
+* Reorganized classes and locales for boolean algebras.
+INCOMPATIBILITY.
+
+* New simp rules: less_exp, min.absorb1, min.absorb2, min.absorb3,
+min.absorb4, max.absorb1, max.absorb2, max.absorb3, max.absorb4. Minor
+INCOMPATIBILITY.
+
+* Sledgehammer:
+ - Removed legacy "lam_lifting" (synonym for "lifting") from option
+   "lam_trans". Minor INCOMPATIBILITY.
+ - Renamed "hide_lams" to "opaque_lifting" in option "lam_trans".
+   Minor INCOMPATIBILITY.
+ - Added "opaque_combs" to option "lam_trans": lambda expressions are rewritten
+   using combinators, but the combinators are kept opaque, i.e. without
+   definitions.
+
+* Metis:
+ - Renamed option "hide_lams" to "opaque_lifting". Minor INCOMPATIBILITY.
 
 
 *** ML ***
 
+* ML antiquotations \<^try>\<open>expr\<close> and \<^can>\<open>expr\<close> operate directly on
+the given ML expression, in contrast to functions "try" and "can" that
+modify application of a function.
+
+* ML antiquotations for conditional ML text:
+
+    \<^if_linux>\<open>...\<close>
+    \<^if_macos>\<open>...\<close>
+    \<^if_windows>\<open>...\<close>
+    \<^if_unix>\<open>...\<close>
+
 * External bash processes are always managed by Isabelle/Scala, in
 contrast to Isabelle2021 where this was only done for macOS on Apple
 Silicon.
@@ -143,9 +303,60 @@
 
 *** System ***
 
+* Each Isabelle component may specify a Scala/Java jar module
+declaratively via etc/build.props (file names are relative to the
+component directory). E.g. see $ISABELLE_HOME/etc/build.props with
+further explanations in the "system" manual.
+
+* Command-line tool "isabelle scala_build" allows to invoke the build
+process of all Scala/Java modules explicitly. Normally this is done
+implicitly on demand, e.g. for "isabelle scala" or "isabelle jedit".
+
+* Command-line tool "isabelle scala_project" is has been improved in
+various ways:
+  - sources from all components with etc/build.props are included,
+  - sources of for the jEdit text editor and the Isabelle/jEdit
+    plugins (jedit_base and jedit_main) are included by default,
+  - more sources may be given on the command-line,
+  - options -f and -D make the tool more convenient.
+
+* Isabelle/jEdit is now composed more conventionally from the original
+jEdit text editor in $JEDIT_HOME (with minor patches), plus two Isabelle
+plugins that are produced in $JEDIT_SETTINGS/jars on demand. The main
+isabelle.jedit module is now part of Isabelle/Scala (as one big
+$ISABELLE_SCALA_JAR).
+
+* ML profiling has been updated and reactivated, after some degration in
+Isabelle2021:
+
+  - "isabelle build -o threads=1 -o profiling=..." works properly
+    within the PIDE session context;
+
+  - "isabelle profiling_report" now uses the session build database
+    (like "isabelle log");
+
+  - output uses non-intrusive tracing messages, instead of warnings.
+
+* System option "system_log" specifies an optional log file for internal
+messages produced by Output.system_message in Isabelle/ML; the value
+"true" refers to console progress of the build job. This works for
+"isabelle build" or any derivative of it.
+
+* System options of type string may be set to "true" using the short
+notation of type bool. E.g. "isabelle build -o system_log".
+
+* System option "document=true" is an alias for "document=pdf" and thus
+can be used in the short form. E.g. "isabelle build -o document".
+
 * Command-line tool "isabelle version" supports repository archives
 (without full .hg directory). More options.
 
+* Obsolete settings variable ISABELLE_PLATFORM32 has been discontinued.
+Note that only Windows supports old 32 bit executables, via settings
+variable ISABELLE_WINDOWS_PLATFORM32. Everything else should be
+ISABELLE_PLATFORM64 (generic Posix) or ISABELLE_WINDOWS_PLATFORM64
+(native Windows) or ISABELLE_APPLE_PLATFORM64 (Apple Silicon).
+
 
 
 New in Isabelle2021 (February 2021)
@@ -892,12 +1103,6 @@
 
 *** Document preparation ***
 
-* More predefined symbols: \<interleave> \<sslash> (package "stmaryrd"), \<checkmark> \<crossmark> (package
-"pifont").
-
-* High-quality blackboard-bold symbols from font "txmia" (package
-"pxfonts"): \<bbbA>\<bool>\<complex>\<bbbD>\<bbbE>\<bbbF>\<bbbG>\<bbbH>\<bbbI>\<bbbJ>\<bbbK>\<bbbL>\<bbbM>\<nat>\<bbbO>\<bbbP>\<rat>\<real>\<bbbS>\<bbbT>\<bbbU>\<bbbV>\<bbbW>\<bbbX>\<bbbY>\<int>.
-
 * Document markers are formal comments of the form \<^marker>\<open>marker_body\<close> that
 are stripped from document output: the effect is to modify the semantic
 presentation context or to emit markup to the PIDE document. Some
--- a/README	Wed Mar 31 16:01:31 2021 +0200
+++ b/README	Mon Sep 06 12:08:20 2021 +0200
@@ -1,13 +1,13 @@
 The Isabelle System Distribution
 ================================
 
-Version information
--------------------
+See the NEWS file in the distribution for details on user-relevant
+changes.  The ANNOUNCE file recounts notable changes for the latest
+official release.
 
-This is some repository version of Isabelle.
-
-See the NEWS file in the distribution for details on user-relevant
-changes.
+The core of Isabelle is subject to a 3-clause BSD license, but add-on
+components have their own license schemes (similar to a Linux
+distribution).
 
 
 Installation
--- a/README_REPOSITORY	Wed Mar 31 16:01:31 2021 +0200
+++ b/README_REPOSITORY	Mon Sep 06 12:08:20 2021 +0200
@@ -19,14 +19,17 @@
 
 3. Switch repository to particular version (bash shell commands):
 
-    #remote tip version
+    #latest official release
+    isabelle/Admin/init -R
+
+    #latest version from repository server
     isabelle/Admin/init -u
 
+    #latest version from local history
+    isabelle/Admin/init -u -L
+
     #explicit changeset id or tag (e.g. "Isabelle2021")
-    isabelle/Admin/init -r 7cdcf131699d
-
-    #current official release
-    isabelle/Admin/init -R
+    isabelle/Admin/init -r 479e9b17090e
 
 4. Run application:
 
--- a/bin/isabelle	Wed Mar 31 16:01:31 2021 +0200
+++ b/bin/isabelle	Mon Sep 06 12:08:20 2021 +0200
@@ -4,6 +4,8 @@
 #
 # Isabelle tool wrapper.
 
+unset CDPATH
+
 if [ -L "$0" ]; then
   TARGET="$(LC_ALL=C ls -l "$0" | sed 's/.* -> //')"
   exec "$(cd "$(dirname "$0")"; cd "$(pwd -P)"; cd "$(dirname "$TARGET")"; pwd)/$(basename "$TARGET")" "$@"
@@ -43,7 +45,7 @@
 
 ## internal tool or usage (Scala)
 
-isabelle_admin_build jars || exit $?
+"$ISABELLE_HOME/lib/Tools/scala_build" || exit $?
 
 eval "declare -a JAVA_ARGS=($ISABELLE_TOOL_JAVA_OPTIONS)"
 exec isabelle java "${JAVA_ARGS[@]}" isabelle.Isabelle_Tool "$@"
--- a/bin/isabelle_java	Wed Mar 31 16:01:31 2021 +0200
+++ b/bin/isabelle_java	Mon Sep 06 12:08:20 2021 +0200
@@ -4,6 +4,8 @@
 #
 # Isabelle/Java cold start -- without settings environment
 
+unset CDPATH
+
 if [ -L "$0" ]; then
   TARGET="$(LC_ALL=C ls -l "$0" | sed 's/.* -> //')"
   exec "$(cd "$(dirname "$0")"; cd "$(pwd -P)"; cd "$(dirname "$TARGET")"; pwd)/$(basename "$TARGET")" "$@"
@@ -16,11 +18,8 @@
 
   eval "declare -a JAVA_ARGS=($ISABELLE_JAVA_SYSTEM_OPTIONS $ISABELLE_TOOL_JAVA_OPTIONS)"
 
-  if [ -f "$ISABELLE_HOME/src/Tools/jEdit/dist/jedit.jar" ]; then
-    classpath "$ISABELLE_HOME/src/Tools/jEdit/dist/jedit.jar"
-  fi
-
-  [ -n "$CLASSPATH" ] && classpath "$CLASSPATH"
+  classpath "$ISABELLE_SETUP_CLASSPATH"
+  classpath "$CLASSPATH"
 
   echo "$ISABELLE_ROOT"
   echo "$CYGWIN_ROOT"
--- a/bin/isabelle_scala_script	Wed Mar 31 16:01:31 2021 +0200
+++ b/bin/isabelle_scala_script	Mon Sep 06 12:08:20 2021 +0200
@@ -4,6 +4,8 @@
 #
 # Isabelle/Scala script wrapper.
 
+unset CDPATH
+
 if [ -L "$0" ]; then
   TARGET="$(LC_ALL=C ls -l "$0" | sed 's/.* -> //')"
   exec "$(cd "$(dirname "$0")"; cd "$(pwd -P)"; cd "$(dirname "$TARGET")"; pwd)/$(basename "$TARGET")" "$@"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/etc/build.props	Mon Sep 06 12:08:20 2021 +0200
@@ -0,0 +1,293 @@
+title = Isabelle/Scala
+module = $ISABELLE_HOME/lib/classes/isabelle.jar
+main = isabelle.jedit.Main
+resources = \
+  lib/services/java.nio.charset.spi.CharsetProvider:META-INF/services/ \
+  lib/logo/isabelle_transparent-32.gif:isabelle/ \
+  lib/logo/isabelle_transparent.gif:isabelle/
+sources = \
+  src/HOL/SPARK/Tools/spark.scala \
+  src/HOL/Tools/ATP/system_on_tptp.scala \
+  src/HOL/Tools/Mirabelle/mirabelle.scala \
+  src/HOL/Tools/Nitpick/kodkod.scala \
+  src/Pure/Admin/afp.scala \
+  src/Pure/Admin/build_csdp.scala \
+  src/Pure/Admin/build_cygwin.scala \
+  src/Pure/Admin/build_doc.scala \
+  src/Pure/Admin/build_e.scala \
+  src/Pure/Admin/build_fonts.scala \
+  src/Pure/Admin/build_history.scala \
+  src/Pure/Admin/build_jcef.scala \
+  src/Pure/Admin/build_jdk.scala \
+  src/Pure/Admin/build_jedit.scala \
+  src/Pure/Admin/build_log.scala \
+  src/Pure/Admin/build_polyml.scala \
+  src/Pure/Admin/build_release.scala \
+  src/Pure/Admin/build_spass.scala \
+  src/Pure/Admin/build_sqlite.scala \
+  src/Pure/Admin/build_status.scala \
+  src/Pure/Admin/build_vampire.scala \
+  src/Pure/Admin/build_verit.scala \
+  src/Pure/Admin/build_zipperposition.scala \
+  src/Pure/Admin/check_sources.scala \
+  src/Pure/Admin/ci_profile.scala \
+  src/Pure/Admin/isabelle_cronjob.scala \
+  src/Pure/Admin/isabelle_devel.scala \
+  src/Pure/Admin/jenkins.scala \
+  src/Pure/Admin/other_isabelle.scala \
+  src/Pure/Concurrent/consumer_thread.scala \
+  src/Pure/Concurrent/counter.scala \
+  src/Pure/Concurrent/delay.scala \
+  src/Pure/Concurrent/event_timer.scala \
+  src/Pure/Concurrent/future.scala \
+  src/Pure/Concurrent/isabelle_thread.scala \
+  src/Pure/Concurrent/mailbox.scala \
+  src/Pure/Concurrent/par_list.scala \
+  src/Pure/Concurrent/synchronized.scala \
+  src/Pure/GUI/color_value.scala \
+  src/Pure/GUI/desktop_app.scala \
+  src/Pure/GUI/gui.scala \
+  src/Pure/GUI/gui_thread.scala \
+  src/Pure/GUI/popup.scala \
+  src/Pure/GUI/wrap_panel.scala \
+  src/Pure/General/antiquote.scala \
+  src/Pure/General/bytes.scala \
+  src/Pure/General/cache.scala \
+  src/Pure/General/codepoint.scala \
+  src/Pure/General/comment.scala \
+  src/Pure/General/completion.scala \
+  src/Pure/General/csv.scala \
+  src/Pure/General/date.scala \
+  src/Pure/General/exn.scala \
+  src/Pure/General/file.scala \
+  src/Pure/General/file_watcher.scala \
+  src/Pure/General/graph.scala \
+  src/Pure/General/graph_display.scala \
+  src/Pure/General/graphics_file.scala \
+  src/Pure/General/http.scala \
+  src/Pure/General/json.scala \
+  src/Pure/General/linear_set.scala \
+  src/Pure/General/logger.scala \
+  src/Pure/General/long_name.scala \
+  src/Pure/General/mailman.scala \
+  src/Pure/General/mercurial.scala \
+  src/Pure/General/multi_map.scala \
+  src/Pure/General/output.scala \
+  src/Pure/General/path.scala \
+  src/Pure/General/position.scala \
+  src/Pure/General/pretty.scala \
+  src/Pure/General/properties.scala \
+  src/Pure/General/rdf.scala \
+  src/Pure/General/scan.scala \
+  src/Pure/General/sha1.scala \
+  src/Pure/General/sql.scala \
+  src/Pure/General/ssh.scala \
+  src/Pure/General/symbol.scala \
+  src/Pure/General/time.scala \
+  src/Pure/General/timing.scala \
+  src/Pure/General/untyped.scala \
+  src/Pure/General/url.scala \
+  src/Pure/General/utf8.scala \
+  src/Pure/General/uuid.scala \
+  src/Pure/General/value.scala \
+  src/Pure/General/word.scala \
+  src/Pure/General/xz.scala \
+  src/Pure/Isar/document_structure.scala \
+  src/Pure/Isar/keyword.scala \
+  src/Pure/Isar/line_structure.scala \
+  src/Pure/Isar/outer_syntax.scala \
+  src/Pure/Isar/parse.scala \
+  src/Pure/Isar/token.scala \
+  src/Pure/ML/ml_console.scala \
+  src/Pure/ML/ml_lex.scala \
+  src/Pure/ML/ml_process.scala \
+  src/Pure/ML/ml_profiling.scala \
+  src/Pure/ML/ml_statistics.scala \
+  src/Pure/ML/ml_syntax.scala \
+  src/Pure/PIDE/byte_message.scala \
+  src/Pure/PIDE/command.scala \
+  src/Pure/PIDE/command_span.scala \
+  src/Pure/PIDE/document.scala \
+  src/Pure/PIDE/document_id.scala \
+  src/Pure/PIDE/document_status.scala \
+  src/Pure/PIDE/editor.scala \
+  src/Pure/PIDE/headless.scala \
+  src/Pure/PIDE/line.scala \
+  src/Pure/PIDE/markup.scala \
+  src/Pure/PIDE/markup_tree.scala \
+  src/Pure/PIDE/protocol.scala \
+  src/Pure/PIDE/protocol_handlers.scala \
+  src/Pure/PIDE/protocol_message.scala \
+  src/Pure/PIDE/prover.scala \
+  src/Pure/PIDE/query_operation.scala \
+  src/Pure/PIDE/rendering.scala \
+  src/Pure/PIDE/resources.scala \
+  src/Pure/PIDE/session.scala \
+  src/Pure/PIDE/text.scala \
+  src/Pure/PIDE/xml.scala \
+  src/Pure/PIDE/yxml.scala \
+  src/Pure/ROOT.scala \
+  src/Pure/System/bash.scala \
+  src/Pure/System/command_line.scala \
+  src/Pure/System/components.scala \
+  src/Pure/System/executable.scala \
+  src/Pure/System/getopts.scala \
+  src/Pure/System/isabelle_charset.scala \
+  src/Pure/System/isabelle_fonts.scala \
+  src/Pure/System/isabelle_platform.scala \
+  src/Pure/System/isabelle_process.scala \
+  src/Pure/System/isabelle_system.scala \
+  src/Pure/System/isabelle_tool.scala \
+  src/Pure/System/java_statistics.scala \
+  src/Pure/System/linux.scala \
+  src/Pure/System/mingw.scala \
+  src/Pure/System/numa.scala \
+  src/Pure/System/options.scala \
+  src/Pure/System/platform.scala \
+  src/Pure/System/posix_interrupt.scala \
+  src/Pure/System/process_result.scala \
+  src/Pure/System/progress.scala \
+  src/Pure/System/scala.scala \
+  src/Pure/System/system_channel.scala \
+  src/Pure/System/tty_loop.scala \
+  src/Pure/Thy/bibtex.scala \
+  src/Pure/Thy/document_build.scala \
+  src/Pure/Thy/export.scala \
+  src/Pure/Thy/export_theory.scala \
+  src/Pure/Thy/file_format.scala \
+  src/Pure/Thy/html.scala \
+  src/Pure/Thy/latex.scala \
+  src/Pure/Thy/presentation.scala \
+  src/Pure/Thy/sessions.scala \
+  src/Pure/Thy/thy_element.scala \
+  src/Pure/Thy/thy_header.scala \
+  src/Pure/Thy/thy_syntax.scala \
+  src/Pure/Tools/build.scala \
+  src/Pure/Tools/build_docker.scala \
+  src/Pure/Tools/build_job.scala \
+  src/Pure/Tools/check_keywords.scala \
+  src/Pure/Tools/debugger.scala \
+  src/Pure/Tools/doc.scala \
+  src/Pure/Tools/dump.scala \
+  src/Pure/Tools/fontforge.scala \
+  src/Pure/Tools/java_monitor.scala \
+  src/Pure/Tools/logo.scala \
+  src/Pure/Tools/mkroot.scala \
+  src/Pure/Tools/phabricator.scala \
+  src/Pure/Tools/print_operation.scala \
+  src/Pure/Tools/profiling_report.scala \
+  src/Pure/Tools/scala_build.scala \
+  src/Pure/Tools/scala_project.scala \
+  src/Pure/Tools/server.scala \
+  src/Pure/Tools/server_commands.scala \
+  src/Pure/Tools/simplifier_trace.scala \
+  src/Pure/Tools/spell_checker.scala \
+  src/Pure/Tools/task_statistics.scala \
+  src/Pure/Tools/update.scala \
+  src/Pure/Tools/update_cartouches.scala \
+  src/Pure/Tools/update_comments.scala \
+  src/Pure/Tools/update_header.scala \
+  src/Pure/Tools/update_then.scala \
+  src/Pure/Tools/update_theorems.scala \
+  src/Pure/library.scala \
+  src/Pure/pure_thy.scala \
+  src/Pure/term.scala \
+  src/Pure/term_xml.scala \
+  src/Pure/thm_name.scala \
+  src/Tools/Graphview/graph_file.scala \
+  src/Tools/Graphview/graph_panel.scala \
+  src/Tools/Graphview/graphview.scala \
+  src/Tools/Graphview/layout.scala \
+  src/Tools/Graphview/main_panel.scala \
+  src/Tools/Graphview/metrics.scala \
+  src/Tools/Graphview/model.scala \
+  src/Tools/Graphview/mutator.scala \
+  src/Tools/Graphview/mutator_dialog.scala \
+  src/Tools/Graphview/mutator_event.scala \
+  src/Tools/Graphview/popups.scala \
+  src/Tools/Graphview/shapes.scala \
+  src/Tools/Graphview/tree_panel.scala \
+  src/Tools/VSCode/src/build_vscode.scala \
+  src/Tools/VSCode/src/channel.scala \
+  src/Tools/VSCode/src/dynamic_output.scala \
+  src/Tools/VSCode/src/language_server.scala \
+  src/Tools/VSCode/src/lsp.scala \
+  src/Tools/VSCode/src/preview_panel.scala \
+  src/Tools/VSCode/src/state_panel.scala \
+  src/Tools/VSCode/src/textmate_grammar.scala \
+  src/Tools/VSCode/src/vscode_model.scala \
+  src/Tools/VSCode/src/vscode_rendering.scala \
+  src/Tools/VSCode/src/vscode_resources.scala \
+  src/Tools/VSCode/src/vscode_spell_checker.scala \
+  src/Tools/jEdit/src/active.scala \
+  src/Tools/jEdit/src/base_plugin.scala \
+  src/Tools/jEdit/src/completion_popup.scala \
+  src/Tools/jEdit/src/context_menu.scala \
+  src/Tools/jEdit/src/debugger_dockable.scala \
+  src/Tools/jEdit/src/dockable.scala \
+  src/Tools/jEdit/src/document_model.scala \
+  src/Tools/jEdit/src/document_view.scala \
+  src/Tools/jEdit/src/documentation_dockable.scala \
+  src/Tools/jEdit/src/fold_handling.scala \
+  src/Tools/jEdit/src/font_info.scala \
+  src/Tools/jEdit/src/graphview_dockable.scala \
+  src/Tools/jEdit/src/info_dockable.scala \
+  src/Tools/jEdit/src/isabelle.scala \
+  src/Tools/jEdit/src/isabelle_encoding.scala \
+  src/Tools/jEdit/src/isabelle_export.scala \
+  src/Tools/jEdit/src/isabelle_options.scala \
+  src/Tools/jEdit/src/isabelle_session.scala \
+  src/Tools/jEdit/src/isabelle_vfs.scala \
+  src/Tools/jEdit/src/jedit_bibtex.scala \
+  src/Tools/jEdit/src/jedit_editor.scala \
+  src/Tools/jEdit/src/jedit_lib.scala \
+  src/Tools/jEdit/src/jedit_options.scala \
+  src/Tools/jEdit/src/jedit_rendering.scala \
+  src/Tools/jEdit/src/jedit_resources.scala \
+  src/Tools/jEdit/src/jedit_sessions.scala \
+  src/Tools/jEdit/src/jedit_spell_checker.scala \
+  src/Tools/jEdit/src/keymap_merge.scala \
+  src/Tools/jEdit/src/main.scala \
+  src/Tools/jEdit/src/main_plugin.scala \
+  src/Tools/jEdit/src/monitor_dockable.scala \
+  src/Tools/jEdit/src/output_dockable.scala \
+  src/Tools/jEdit/src/pide_docking_framework.scala \
+  src/Tools/jEdit/src/pretty_text_area.scala \
+  src/Tools/jEdit/src/pretty_tooltip.scala \
+  src/Tools/jEdit/src/process_indicator.scala \
+  src/Tools/jEdit/src/protocol_dockable.scala \
+  src/Tools/jEdit/src/query_dockable.scala \
+  src/Tools/jEdit/src/raw_output_dockable.scala \
+  src/Tools/jEdit/src/rich_text_area.scala \
+  src/Tools/jEdit/src/session_build.scala \
+  src/Tools/jEdit/src/simplifier_trace_dockable.scala \
+  src/Tools/jEdit/src/simplifier_trace_window.scala \
+  src/Tools/jEdit/src/sledgehammer_dockable.scala \
+  src/Tools/jEdit/src/state_dockable.scala \
+  src/Tools/jEdit/src/status_widget.scala \
+  src/Tools/jEdit/src/symbols_dockable.scala \
+  src/Tools/jEdit/src/syntax_style.scala \
+  src/Tools/jEdit/src/syslog_dockable.scala \
+  src/Tools/jEdit/src/text_overview.scala \
+  src/Tools/jEdit/src/text_structure.scala \
+  src/Tools/jEdit/src/theories_dockable.scala \
+  src/Tools/jEdit/src/timing_dockable.scala \
+  src/Tools/jEdit/src/token_markup.scala
+services = \
+  isabelle.Bash$Handler \
+  isabelle.Bibtex$File_Format \
+  isabelle.Document_Build$Build_Engine \
+  isabelle.Document_Build$LuaLaTeX_Engine \
+  isabelle.Document_Build$PDFLaTeX_Engine \
+  isabelle.ML_Statistics$Handler \
+  isabelle.Print_Operation$Handler \
+  isabelle.Scala$Handler \
+  isabelle.Scala_Functions \
+  isabelle.Server_Commands \
+  isabelle.Sessions$File_Format \
+  isabelle.Simplifier_Trace$Handler \
+  isabelle.Tools \
+  isabelle.nitpick.Kodkod$Handler \
+  isabelle.nitpick.Scala_Functions \
+  isabelle.spark.SPARK$Load_Command1 \
+  isabelle.spark.SPARK$Load_Command2
--- a/etc/components	Wed Mar 31 16:01:31 2021 +0200
+++ b/etc/components	Mon Sep 06 12:08:20 2021 +0200
@@ -1,8 +1,9 @@
 #built-in components
 src/Tools/jEdit
+src/Tools/GraphBrowser
 src/Tools/Graphview
+src/Tools/Setup
 src/Tools/VSCode
-src/HOL/Mirabelle
 src/HOL/Mutabelle
 src/HOL/Library/Sum_of_Squares
 src/HOL/SPARK
--- a/etc/options	Wed Mar 31 16:01:31 2021 +0200
+++ b/etc/options	Mon Sep 06 12:08:20 2021 +0200
@@ -6,13 +6,21 @@
   -- "generate theory browser information"
 
 option document : string = ""
-  -- "build document in given format: pdf, dvi, false"
+  -- "build PDF document (enabled for \"pdf\" or \"true\", disabled for \"\" or \"false\")"
 option document_output : string = ""
   -- "document output directory"
 option document_variants : string = "document"
   -- "alternative document variants (separated by colons)"
 option document_tags : string = ""
   -- "default command tags (separated by commas)"
+option document_bibliography : bool = false
+  -- "explicitly enable use of bibtex (default: according to presence of root.bib)"
+option document_preprocessor : string = ""
+  -- "document preprocessor: executable relative to document output directory"
+option document_build : string = "lualatex"
+  -- "document build engine (e.g. lualatex, pdflatex, build)"
+option document_logo : string = ""
+  -- "generate named instance of Isabelle logo (underscore means unnamed variant)"
 
 option thy_output_display : bool = false
   -- "indicate output as multi-line display-style material"
@@ -111,6 +119,9 @@
 option timeout : real = 0
   -- "timeout for session build job (seconds > 0)"
 
+option timeout_build : bool = true
+  -- "observe timeout for session build"
+
 option process_output_limit : int = 100
   -- "build process output limit (in million characters, 0 = unlimited)"
 
@@ -120,6 +131,9 @@
 option profiling : string = ""
   -- "ML profiling (possible values: time, allocations)"
 
+option system_log : string = ""
+  -- "output for system messages (log file or \"true\" for console progress)"
+
 option system_heaps : bool = false
   -- "store session heaps in $ISABELLE_HEAPS_SYSTEM, not $ISABELLE_HEAPS"
 
@@ -291,10 +305,10 @@
 
 section "Phabricator"
 
-option phabricator_version_arcanist : string = "66d1acec70425eb0c70c2d4cbe38b13c66fc34c7"
+option phabricator_version_arcanist : string = "4f70fcffa8a5393e210d64f237ffdaa256256d6a"
   -- "repository version for arcanist"
 
-option phabricator_version_phabricator : string = "36a21adb905d094ca7b1e48879dcfd45a77a7a8a"
+option phabricator_version_phabricator : string = "193798385bd3a7f72dca255e44f8112f4f8fc155"
   -- "repository version for phabricator"
 
 
@@ -359,3 +373,10 @@
 
 option system_channel_address : string = ""
 option system_channel_password : string = ""
+
+
+section "Bash process execution server"
+
+option bash_process_debugging : bool = false
+option bash_process_address : string = ""
+option bash_process_password : string = ""
--- a/etc/settings	Wed Mar 31 16:01:31 2021 +0200
+++ b/etc/settings	Mon Sep 06 12:08:20 2021 +0200
@@ -16,23 +16,10 @@
 
 ISABELLE_TOOL_JAVA_OPTIONS="-Djava.awt.headless=true -Xms512m -Xmx4g -Xss16m"
 
-ISABELLE_SCALAC_OPTIONS="-encoding UTF-8 -Wconf:cat=other-match-analysis:silent -feature -deprecation -target:11 -J-Xms512m -J-Xmx4g -J-Xss16m"
-
-classpath "$ISABELLE_HOME/lib/classes/Pure.jar"
-
-isabelle_scala_service 'isabelle.Tools'
-[ -d "$ISABELLE_HOME/Admin" ] && isabelle_scala_service 'isabelle.Admin_Tools'
-
-isabelle_scala_service 'isabelle.Scala_Functions'
+ISABELLE_JAVAC_OPTIONS="-encoding UTF-8 -Xlint:-options -deprecation -source 11 -target 11"
+ISABELLE_SCALAC_OPTIONS="-encoding UTF-8 -Wconf:cat=other-match-analysis:silent -feature -deprecation -target:11 -Xsource:3 -J-Xms512m -J-Xmx4g -J-Xss16m"
 
-isabelle_scala_service 'isabelle.Sessions$File_Format'
-isabelle_scala_service 'isabelle.Bibtex$File_Format'
-
-isabelle_scala_service 'isabelle.ML_Statistics$Handler'
-isabelle_scala_service 'isabelle.Scala$Handler'
-isabelle_scala_service 'isabelle.Print_Operation$Handler'
-isabelle_scala_service 'isabelle.Simplifier_Trace$Handler'
-isabelle_scala_service 'isabelle.Server_Commands'
+ISABELLE_SCALA_JAR="$ISABELLE_HOME/lib/classes/isabelle.jar"
 
 #paranoia settings -- avoid intrusion of alien options
 unset "_JAVA_OPTIONS"
@@ -57,12 +44,18 @@
 
 
 ###
-### Document preparation (cf. isabelle latex/document)
+### Document preparation (cf. isabelle latex)
 ###
 
-ISABELLE_PDFLATEX="lualatex --file-line-error"
+if [ "$ISABELLE_PLATFORM_FAMILY" = "windows" ]; then
+  ISABELLE_PDFLATEX="pdflatex -interaction=nonstopmode -c-style-errors"
+else
+  ISABELLE_PDFLATEX="pdflatex -interaction=nonstopmode -file-line-error"
+fi
+
+ISABELLE_LUALATEX="lualatex --interaction=nonstopmode --file-line-error"
 ISABELLE_BIBTEX="bibtex"
-ISABELLE_MAKEINDEX="makeindex"
+ISABELLE_MAKEINDEX="makeindex -c -q"
 ISABELLE_EPSTOPDF="epstopdf"
 
 
@@ -152,7 +145,7 @@
 
 ISABELLE_OPAM_ROOT="$USER_HOME/.opam"
 
-ISABELLE_OCAML_VERSION="ocaml-base-compiler.4.07.0"
+ISABELLE_OCAML_VERSION="ocaml-base-compiler.4.12.0"
 
 
 ###
@@ -161,9 +154,9 @@
 
 ISABELLE_STACK_ROOT="$USER_HOME/.stack"
 
-ISABELLE_STACK_RESOLVER="lts-16.31"
+ISABELLE_STACK_RESOLVER="lts-17.10"
 
-ISABELLE_GHC_VERSION="ghc-8.8.4"
+ISABELLE_GHC_VERSION="ghc-8.10.4"
 
 
 ###
--- a/etc/symbols	Wed Mar 31 16:01:31 2021 +0200
+++ b/etc/symbols	Mon Sep 06 12:08:20 2021 +0200
@@ -442,6 +442,7 @@
 \<^action>              code: 0x00261b  group: icon  argument: cartouche  font: Isabelle␣DejaVu␣Sans␣Mono
 \<^assert>
 \<^binding>             argument: cartouche
+\<^can>                 argument: cartouche
 \<^class>               argument: cartouche
 \<^class_syntax>        argument: cartouche
 \<^command_keyword>     argument: cartouche
@@ -480,6 +481,7 @@
 \<^theory>              argument: cartouche
 \<^theory_context>      argument: cartouche
 \<^tool>                argument: cartouche
+\<^try>                 argument: cartouche
 \<^typ>                 argument: cartouche
 \<^type_abbrev>         argument: cartouche
 \<^type_name>           argument: cartouche
@@ -489,3 +491,8 @@
 \<^computation>         argument: cartouche
 \<^computation_conv>    argument: cartouche
 \<^computation_check>   argument: cartouche
+\<^if_linux>            argument: cartouche
+\<^if_macos>            argument: cartouche
+\<^if_windows>          argument: cartouche
+\<^if_unix>             argument: cartouche
+
--- a/lib/Tools/browser	Wed Mar 31 16:01:31 2021 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,110 +0,0 @@
-#!/usr/bin/env bash
-#
-# Author: Markus Wenzel, TU Muenchen
-#
-# DESCRIPTION: Isabelle graph browser
-
-
-PRG="$(basename "$0")"
-
-function usage()
-{
-  echo
-  echo "Usage: isabelle $PRG [OPTIONS] [GRAPHFILE]"
-  echo
-  echo "  Options are:"
-  echo "    -b           Admin/build only"
-  echo "    -c           cleanup -- remove GRAPHFILE after use"
-  echo "    -o FILE      output to FILE (ps, eps, pdf)"
-  echo
-  exit 1
-}
-
-function fail()
-{
-  echo "$1" >&2
-  exit 2
-}
-
-
-## process command line
-
-# options
-
-ADMIN_BUILD=""
-CLEAN=""
-OUTFILE=""
-
-while getopts "bco:" OPT
-do
-  case "$OPT" in
-    b)
-      ADMIN_BUILD=true
-      ;;
-    c)
-      CLEAN=true
-      ;;
-    o)
-      OUTFILE="$OPTARG"
-      ;;
-    \?)
-      usage
-      ;;
-  esac
-done
-
-shift $(($OPTIND - 1))
-
-
-# args
-
-GRAPHFILE=""
-[ "$#" -gt 0 ] && { GRAPHFILE="$1"; shift; }
-[ "$#" -ne 0 ] && usage
-
-
-## main
-
-isabelle_admin_build browser || exit $?
-
-classpath "$ISABELLE_HOME/lib/browser/GraphBrowser.jar"
-
-if [ -n "$GRAPHFILE" ]; then
-  PRIVATE_FILE="${ISABELLE_TMP:-${TMPDIR:-/tmp}}/$$"$(basename "$GRAPHFILE")
-  if [ -n "$CLEAN" ]; then
-    mv -f "$GRAPHFILE" "$PRIVATE_FILE" || fail "Cannot move file: $GRAPHFILE"
-  else
-    cp -f "$GRAPHFILE" "$PRIVATE_FILE" || fail "Cannot copy file: $GRAPHFILE"
-  fi
-
-  PDF=""
-  case "$OUTFILE" in
-    *.pdf)
-      OUTFILE="${OUTFILE%%.pdf}.eps"
-      PDF=true
-      ;;
-  esac
-
-  if [ -z "$OUTFILE" ]; then
-    isabelle java GraphBrowser.GraphBrowser "$(platform_path "$PRIVATE_FILE")"
-  else
-    isabelle java GraphBrowser.Console "$(platform_path "$PRIVATE_FILE")" "$(platform_path "$OUTFILE")"
-  fi
-  RC="$?"
-
-  if [ -n "$PDF" ]; then
-    (
-      cd "$(dirname "$OUTFILE")"
-      "$ISABELLE_EPSTOPDF" "$(basename "$OUTFILE")" || fail "Failed to produce pdf output"
-    )
-  fi
-
-  rm -f "$PRIVATE_FILE"
-elif [ -z "$ADMIN_BUILD" ]; then
-  [ -d "$ISABELLE_BROWSER_INFO" ] && cd "$ISABELLE_BROWSER_INFO"
-  exec isabelle java GraphBrowser.GraphBrowser
-else
-  RC=0
-fi
-
-exit "$RC"
--- a/lib/Tools/components	Wed Mar 31 16:01:31 2021 +0200
+++ b/lib/Tools/components	Mon Sep 06 12:08:20 2021 +0200
@@ -127,7 +127,7 @@
   echo "Missing components:"
   for NAME in "${MISSING_COMPONENTS[@]}"; do echo "  $NAME"; done
 elif [ "${#UPDATE_COMPONENTS[@]}" -ne 0 ]; then
-  isabelle_admin_build jars || exit $?
+  isabelle scala_build || exit $?
   exec isabelle java isabelle.Components "${UPDATE_COMPONENTS[@]}"
 else
   for NAME in "${SELECTED_COMPONENTS[@]}"
--- a/lib/Tools/console	Wed Mar 31 16:01:31 2021 +0200
+++ b/lib/Tools/console	Mon Sep 06 12:08:20 2021 +0200
@@ -4,7 +4,7 @@
 #
 # DESCRIPTION: raw ML process (interactive mode)
 
-isabelle_admin_build jars || exit $?
+isabelle scala_build || exit $?
 
 eval "declare -a JAVA_ARGS=($ISABELLE_TOOL_JAVA_OPTIONS)"
 
--- a/lib/Tools/env	Wed Mar 31 16:01:31 2021 +0200
+++ b/lib/Tools/env	Mon Sep 06 12:08:20 2021 +0200
@@ -25,4 +25,4 @@
 
 [ "$1" = "-?" ] && usage
 
-exec /usr/bin/env "$@"
+/usr/bin/env "$@"
--- a/lib/Tools/getenv	Wed Mar 31 16:01:31 2021 +0200
+++ b/lib/Tools/getenv	Mon Sep 06 12:08:20 2021 +0200
@@ -17,8 +17,7 @@
   echo "  Options are:"
   echo "    -a           display complete environment"
   echo "    -b           print values only (doesn't work for -a)"
-  echo "    -d FILE      dump complete environment to FILE"
-  echo "                 (null terminated entries)"
+  echo "    -d FILE      dump complete environment to file (NUL terminated entries)"
   echo
   echo "  Get value of VARNAMES from the Isabelle settings."
   echo
@@ -78,6 +77,5 @@
 
 if [ -n "$DUMP" ]; then
   export PATH_JVM="$(platform_path "$PATH")"
-  exec perl -w -e 'for $key (keys %ENV) { print $key, "=", $ENV{$key}, "\x00"; }' > "$DUMP"
+  "$ISABELLE_PRINTENV" -0 > "$DUMP"
 fi
-
--- a/lib/Tools/java	Wed Mar 31 16:01:31 2021 +0200
+++ b/lib/Tools/java	Mon Sep 06 12:08:20 2021 +0200
@@ -6,8 +6,8 @@
 
 eval "declare -a JAVA_ARGS=($ISABELLE_JAVA_SYSTEM_OPTIONS)"
 
-[ -n "$CLASSPATH" ] && classpath "$CLASSPATH"
-unset CLASSPATH
+classpath "$ISABELLE_SETUP_CLASSPATH"; unset ISABELLE_SETUP_CLASSPATH
+classpath "$CLASSPATH"; unset CLASSPATH
 
 isabelle_java java "${JAVA_ARGS[@]}" \
   -classpath "$(platform_path "$ISABELLE_CLASSPATH")" "$@"
--- a/lib/Tools/latex	Wed Mar 31 16:01:31 2021 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,117 +0,0 @@
-#!/usr/bin/env bash
-#
-# Author: Markus Wenzel, TU Muenchen
-#
-# DESCRIPTION: run LaTeX (and related tools)
-
-
-PRG="$(basename "$0")"
-
-function usage()
-{
-  echo
-  echo "Usage: isabelle $PRG [OPTIONS] [FILE]"
-  echo
-  echo "  Options are:"
-  echo "    -o FORMAT    specify output format: pdf (default), bbl, idx, sty"
-  echo
-  echo "  Run LaTeX (and related tools) on FILE (default root.tex),"
-  echo "  producing the specified output format."
-  echo
-  exit 1
-}
-
-function fail()
-{
-  echo "$1" >&2
-  exit 2
-}
-
-
-## process command line
-
-# options
-
-OUTFORMAT=pdf
-
-while getopts "o:" OPT
-do
-  case "$OPT" in
-    o)
-      OUTFORMAT="$OPTARG"
-      ;;
-    \?)
-      usage
-      ;;
-  esac
-done
-
-shift $(($OPTIND - 1))
-
-
-# args
-
-FILE="root.tex"
-[ "$#" -ge 1 ] && { FILE="$1"; shift; }
-
-[ "$#" -ne 0 ] && usage
-
-
-## main
-
-# root file
-
-DIR="$(dirname "$FILE")"
-FILEBASE="$(basename "$FILE" .tex)"
-[ "$DIR" = . ] || FILEBASE="$DIR/$FILEBASE"
-
-function check_root () { [ -f "$FILEBASE.tex" ] || fail "Bad file '$FILE'"; }
-
-
-# operations
-
-function run_pdflatex () { $ISABELLE_PDFLATEX "\\nonstopmode\\input{$FILEBASE.tex}"; }
-function run_bibtex () {
-  $ISABELLE_BIBTEX </dev/null "$FILEBASE"
-  RC="$?"
-  if [ "$RC" -gt 0 -a -f "${FILEBASE}.blg" ]; then
-    perl -n -e 'if (m/^I (found no.*$)/) { print "bibtex $1\n"; }' "${FILEBASE}.blg" >&2
-  fi
-  return "$RC"
-}
-function run_makeindex () { $ISABELLE_MAKEINDEX </dev/null "$FILEBASE"; }
-function copy_styles ()
-{
-  for STYLEFILE in "$ISABELLE_HOME/lib/texinputs"/*.sty
-  do
-    TARGET="$DIR"/$(basename "$STYLEFILE")
-    perl -p -e 's/\$[I]d:?(?:\s)*([^\$]*)\$//g' "$STYLEFILE" > "$TARGET"
-  done
-}
-
-case "$OUTFORMAT" in
-  pdf)
-    check_root && \
-    run_pdflatex
-    RC="$?"
-    ;;
-  bbl)
-    check_root && \
-    run_bibtex
-    RC="$?"
-    ;;
-  idx)
-    check_root && \
-    run_makeindex
-    RC="$?"
-    ;;
-  sty)
-    copy_styles
-    RC="$?"
-    ;;
-  *)
-    fail "Bad output format '$OUTFORMAT'"
-    ;;
-esac
-
-exit "$RC"
--- a/lib/Tools/scala	Wed Mar 31 16:01:31 2021 +0200
+++ b/lib/Tools/scala	Mon Sep 06 12:08:20 2021 +0200
@@ -4,7 +4,7 @@
 #
 # DESCRIPTION: invoke Scala within the Isabelle environment
 
-isabelle_admin_build jars || exit $?
+isabelle scala_build || exit $?
 
 eval "declare -a JAVA_ARGS=($ISABELLE_JAVA_SYSTEM_OPTIONS)"
 declare -a SCALA_ARGS=()
@@ -13,8 +13,8 @@
   SCALA_ARGS["${#SCALA_ARGS[@]}"]="-J$ARG"
 done
 
-[ -n "$CLASSPATH" ] && classpath "$CLASSPATH"
-unset CLASSPATH
+classpath "$ISABELLE_SETUP_CLASSPATH"; unset ISABELLE_SETUP_CLASSPATH
+classpath "$CLASSPATH"; unset CLASSPATH
 
 isabelle_scala scala "${SCALA_ARGS[@]}" \
   -classpath "$(platform_path "$ISABELLE_CLASSPATH")" \
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lib/Tools/scala_build	Mon Sep 06 12:08:20 2021 +0200
@@ -0,0 +1,73 @@
+#!/usr/bin/env bash
+#
+# Author: Makarius
+#
+# DESCRIPTION: build Isabelle/Scala/Java components
+
+## diagnostics
+
+PRG="$(basename "$0")"
+
+function usage()
+{
+  echo
+  echo "Usage: isabelle $PRG [OPTIONS]"
+  echo
+  echo "  Options are:"
+  echo "    -f           force fresh build"
+  echo "    -q           quiet mode: suppress stdout/stderr"
+  echo
+  echo "  Build Isabelle/Scala/Java modules of all registered components"
+  echo "  (if required)."
+  echo
+  exit 1
+}
+
+
+## process command line
+
+COMMAND="build"
+QUIET=""
+
+while getopts "fq" OPT
+do
+  case "$OPT" in
+    f)
+      COMMAND="build_fresh"
+      ;;
+    q)
+      QUIET="true"
+      ;;
+    \?)
+      usage
+      ;;
+  esac
+done
+
+shift $(($OPTIND - 1))
+
+[ "$#" -ne 0 ] && usage
+
+
+## main
+
+#remove historic material
+rm -rf \
+  "$ISABELLE_HOME/lib/classes/Pure.jar" \
+  "$ISABELLE_HOME/lib/classes/Pure.shasum" \
+  "$ISABELLE_HOME/src/Tools/jEdit/dist"
+
+classpath "$CLASSPATH"; unset CLASSPATH
+
+eval "declare -a JAVA_ARGS=($ISABELLE_TOOL_JAVA_OPTIONS)"
+
+JAVA_ARGS["${#JAVA_ARGS[@]}"]="-classpath"
+JAVA_ARGS["${#JAVA_ARGS[@]}"]="$(platform_path "$ISABELLE_CLASSPATH")"
+JAVA_ARGS["${#JAVA_ARGS[@]}"]="isabelle.setup.Setup"
+JAVA_ARGS["${#JAVA_ARGS[@]}"]="$COMMAND"
+
+if [ -z "$QUIET" ]; then
+  isabelle_java java "${JAVA_ARGS[@]}"
+else
+  isabelle_java java "${JAVA_ARGS[@]}" > /dev/null 2> /dev/null
+fi
--- a/lib/Tools/scalac	Wed Mar 31 16:01:31 2021 +0200
+++ b/lib/Tools/scalac	Mon Sep 06 12:08:20 2021 +0200
@@ -4,7 +4,10 @@
 #
 # DESCRIPTION: invoke Scala compiler within the Isabelle environment
 
-isabelle_admin_build jars || exit $?
+isabelle scala_build || exit $?
+
+classpath "$ISABELLE_SETUP_CLASSPATH"; unset ISABELLE_SETUP_CLASSPATH
+classpath "$CLASSPATH"; unset CLASSPATH
 
 isabelle_scala scalac -Dfile.encoding=UTF-8 \
   -classpath "$(platform_path "$ISABELLE_CLASSPATH")" "$@"
--- a/lib/Tools/version	Wed Mar 31 16:01:31 2021 +0200
+++ b/lib/Tools/version	Mon Sep 06 12:08:20 2021 +0200
@@ -62,7 +62,7 @@
 ## main
 
 if [ -z "$SHORT_ID" -a -z "$TAGS" ]; then
-  echo 'repository version'    # filled in automatically!
+  echo "$ISABELLE_NAME"
 fi
 
 HG_ARCHIVAL="$ISABELLE_HOME/.hg_archival.txt"
@@ -71,24 +71,39 @@
 export HGPLAIN=
 
 if [ -n "$SHORT_ID" ]; then
-  if [ -d "$ISABELLE_HOME/.hg" ]; then
-    "${HG:-hg}" -R "$ISABELLE_HOME" log -r "p1()" --template="{node|short}\n" 2>/dev/null || exit "$?"
+  if [ -f "$ISABELLE_HOME/etc/ISABELLE_ID" ]; then
+    RESULT="$(cat "$ISABELLE_HOME/etc/ISABELLE_ID")"
+    RC="$?"
+  elif [ -d "$ISABELLE_HOME/.hg" ]; then
+    RESULT=$("${HG:-hg}" -R "$ISABELLE_HOME" log -r "p1()" --template="{node|short}\n" 2>/dev/null)
+    RC="$?"
   elif [ -f "$HG_ARCHIVAL" ]; then
     RESULT="$(grep "^node:" < "$HG_ARCHIVAL" | cut -d " " -f2 | head -c12)"
-    [ -n "$RESULT" ] && echo "$RESULT"
-  elif [ -n "$ISABELLE_ID" ]; then
-    echo "$ISABELLE_ID"
+    RC="$?"
+  else
+    RESULT=""
+    RC="0"
+  fi
+  if [ "$RC" -ne 0 ]; then
+    exit "$RC"
+  elif [ -n "$RESULT" ]; then
+    echo "$RESULT"
   fi
 fi
 
 if [ -n "$TAGS" ]; then
-  RESULT=""
-  if [ -d "$ISABELLE_HOME/.hg" ]; then
+  if [ -f "$ISABELLE_HOME/etc/ISABELLE_TAGS" ]; then
+    RESULT="$(cat "$ISABELLE_HOME/etc/ISABELLE_TAGS")"
+    RC="$?"
+  elif [ -d "$ISABELLE_HOME/.hg" ]; then
     RESULT=$("${HG:-hg}" -R "$ISABELLE_HOME" id -t 2>/dev/null)
     RC="$?"
   elif [ -f "$HG_ARCHIVAL" ]; then
     RESULT="$(grep "^tag:" < "$HG_ARCHIVAL" | cut -d " " -f2)"
     RC="$?"
+  else
+    RESULT=""
+    RC="0"
   fi
   if [ "$RC" -ne 0 ]; then
     exit "$RC"
--- a/lib/browser/GraphBrowser/AWTFontMetrics.java	Wed Mar 31 16:01:31 2021 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,31 +0,0 @@
-/***************************************************************************
-  Title:      GraphBrowser/AWTFontMetrics.java
-  Author:     Gerwin Klein, TU Muenchen
-
-  AbstractFontMetrics from the AWT for graphics mode.
-  
-***************************************************************************/
-
-package GraphBrowser;
-
-import java.awt.FontMetrics;
-
-public class AWTFontMetrics implements AbstractFontMetrics {
-  private FontMetrics fontMetrics;
-
-  public AWTFontMetrics(FontMetrics m) {
-    fontMetrics = m;
-  }
-
-  public int stringWidth(String str) {
-    return fontMetrics.stringWidth(str);
-  }
-
-  public int getAscent() {
-    return fontMetrics.getAscent();
-  }
-
-  public int getDescent() {
-    return fontMetrics.getDescent();
-  }
-}
--- a/lib/browser/GraphBrowser/AbstractFontMetrics.java	Wed Mar 31 16:01:31 2021 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,16 +0,0 @@
-/***************************************************************************
-  Title:      GraphBrowser/AWTFontMetrics.java
-  Author:     Gerwin Klein, TU Muenchen
-
-  AbstractFontMetrics avoids dependency on java.awt.FontMetrics in 
-  batch mode.
-  
-***************************************************************************/
-
-package GraphBrowser;
-
-public interface AbstractFontMetrics {
-  public int stringWidth(String str);
-  public int getAscent();
-  public int getDescent();
-}
--- a/lib/browser/GraphBrowser/Box.java	Wed Mar 31 16:01:31 2021 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,20 +0,0 @@
-/***************************************************************************
-  Title:      GraphBrowser/Box.java
-  Author:     Gerwin Klein, TU Muenchen
-
-  A box with width and height. Used instead of java.awt.Dimension for 
-  batch mode.
-
-***************************************************************************/
-
-package GraphBrowser;
-
-public class Box {
-  public int width;
-  public int height;
-
-  public Box(int w, int h) {
-    this.width = w;
-    this.height = h;
-  }
-}
--- a/lib/browser/GraphBrowser/Console.java	Wed Mar 31 16:01:31 2021 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,89 +0,0 @@
-/***************************************************************************
-  Title:      GraphBrowser/Console.java
-  Author:     Gerwin Klein, TU Muenchen
-  Options:    :tabSize=2:
-
-  This is the graph browser's main class when run as a console application.
-  It duplicates some logic from GraphBrowser and GraphView.
-  It does so to remove dependency on AWT.
-
-***************************************************************************/
-
-package GraphBrowser;
-
-import java.io.*;
-import java.util.*;
-
-public class Console {
-	Graph g;
-	String gfname;  
-
-  public Console(String name) {
-    gfname = name;
-  }
-
-	public void PS(String fname, boolean printable) throws IOException {
-    g.layout(null);
-		g.PS(fname,printable);
-	}
-
-
-	public void collapseNodes(Vector collapsedDir) { 
-		Enumeration e1=collapsedDir.elements();
-		Graph gra=(Graph)(g.clone());
-
-		while (e1.hasMoreElements()) {
-			Directory d=(Directory)(e1.nextElement());
-			Vector v=gra.decode(d.getCollapsed());
-			if (!v.isEmpty())
-				gra.collapse(v,"["+d.getName()+"]",d.getCollapsed());
-		}
-    
-    g = gra;
-	}
-
-
-	public void initBrowser(InputStream is) {
-		try {
-			TreeNode tn = new TreeNode("Root", "", -1, true);
-      g = new Graph(is, tn);
-			Vector v = new Vector(10,10);
-			tn.collapsedDirectories(v);      
-      collapseNodes(v);
-		} catch (IOException exn) {
-			System.err.println("\nI/O error while reading graph file.");
-		} catch (ParseError exn) {
-			System.err.println("\nParse error in graph file:");
-			System.err.println(exn.getMessage());
-			System.err.println("\nSyntax:\n<vertexname> <vertexID> <dirname> [ + ] <path> "+
-                         "[ < | > ] [ <vertexID> [ ... [ <vertexID> ] ... ] ] ;");
-		}
-	}
-
-	public static void main(String[] args) {
-		try {
-      if (args.length <= 1) {
-        System.err.println("Graph and output file expected.");
-        return;
-      }
-
-			Console console=new Console(args[0]);
-      InputStream is=new FileInputStream(args[0]);
-      console.initBrowser(is);
-      is.close();      
-    
-      try {
-        if (args[1].endsWith(".ps"))
-          console.PS(args[1], true);
-        else if (args[1].endsWith(".eps"))
-          console.PS(args[1], false);
-        else
-          System.err.println("Unknown file type: " + args[1]);
-      } catch (IOException exn) {
-        System.err.println("Unable to write file " + args[1]);
-      }
-		} catch (IOException exn) {
-			System.err.println("Can't open graph file "+args[0]);
-		}
-	}
-}
--- a/lib/browser/GraphBrowser/DefaultFontMetrics.java	Wed Mar 31 16:01:31 2021 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,48 +0,0 @@
-/***************************************************************************
-  Title:      GraphBrowser/DefaultFontMetrics.java
-  Author:     Stefan Berghofer, TU Muenchen
-  Options:    :tabSize=2:
-
-  Default font metrics which is used when no graphics context
-  is available (batch mode).
-***************************************************************************/
-
-package GraphBrowser;
-
-public class DefaultFontMetrics implements AbstractFontMetrics {
-
-  private static int[] chars =
-	{13, 13, 17, 27, 27, 43, 32, 11, 16, 16, 19, 28, 13, 28, 13, 13, 27,
-	 27, 27, 27, 27, 27, 27, 27, 27, 27, 13, 13, 28, 28, 28, 27, 49, 32,
-	 32, 35, 35, 32, 29, 37, 35, 13, 24, 32, 27, 40, 35, 37, 32, 37, 35,
-	 32, 29, 35, 32, 45, 32, 32, 29, 13, 13, 13, 22, 27, 11, 27, 27, 24,
-	 27, 27, 13, 27, 27, 11, 11, 24, 11, 40, 27, 27, 27, 27, 16, 24, 13,
-	 27, 24, 35, 24, 24, 24, 16, 12, 16, 28};
-
-  private int size;
-
-  public DefaultFontMetrics(int size)
-  { this.size = size; }
-
-  public int getLeading()
-  { return 1; }
-
-  public int getAscent()
-  { return (int)(Math.round(size * 46.0 / 48.0)); }
-  
-  public int getDescent() 
-  { return (int)(Math.round(size * 10.0 / 48.0)); }
-  
-  public int charWidth(char c) {
-    if (c < 32 || c > 126) { return 0; }
-    else {
-	    return (int)(Math.round(chars[c - 32] * size / 48.0));
-    }
-  }
-  
-  public int stringWidth(String s) {
-    int l=0, i;
-    for (i=0; i < s.length(); i++) { l += charWidth(s.charAt(i)); }
-    return l;
-  }
-}
--- a/lib/browser/GraphBrowser/Directory.java	Wed Mar 31 16:01:31 2021 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,21 +0,0 @@
-package GraphBrowser;
-
-import java.util.Vector;
-
-class Directory {
-	TreeNode node;
-	String name;
-	Vector collapsed;
-
-	public Directory(TreeNode nd,String n,Vector col) {
-		collapsed=col;
-		name=n;
-		node=nd;
-	}
-
-	public TreeNode getNode() { return node; }
-
-	public String getName() { return name; }
-
-	public Vector getCollapsed() { return collapsed; }
-}
--- a/lib/browser/GraphBrowser/DummyVertex.java	Wed Mar 31 16:01:31 2021 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,29 +0,0 @@
-/***************************************************************************
-  Title:      GraphBrowser/DummyVertex.java
-  Author:     Stefan Berghofer, TU Muenchen
-  Options:    :tabSize=4:
-
-  This class represents a dummy vertex, which is used to simplify the
-  layout algorithm.
-***************************************************************************/
-
-package GraphBrowser;
-
-import java.awt.*;
-
-class DummyVertex extends Vertex {
-	public boolean isDummy() {return true;}
-
-	public Object clone() {
-		Vertex ve=new DummyVertex();
-		ve.setX(getX());ve.setY(getY());
-		return ve;
-	}
-
-	public int leftX() { return getX(); }
-
-	public int rightX() { return getX(); }
-
-	public void draw(Graphics g) {}
-}
-
--- a/lib/browser/GraphBrowser/Graph.java	Wed Mar 31 16:01:31 2021 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1062 +0,0 @@
-/***************************************************************************
-  Title:      GraphBrowser/Graph.java
-  Author:     Stefan Berghofer, TU Muenchen
-  Options:    :tabSize=4:
-
-  This class contains the core of the layout algorithm and methods for
-  drawing and PostScript output.
-***************************************************************************/
-
-package GraphBrowser;
-
-import java.util.*;
-import java.awt.*;
-import java.io.*;
-
-public class Graph {
-	/**** parameters for layout ****/
-
-	public int box_height=0;
-	public int box_height2;
-	public Graphics gfx;
-
-	Vector vertices=new Vector(10,10);
-	Vector splines=new Vector(10,10);
-	Vector numEdges=new Vector(10,10);
-	Vertex []vertices2;
-
-	public int min_x=0,min_y=0,max_x=10,max_y=10;
-
-	/********************************************************************/
-	/*                         clone graph object                       */
-	/********************************************************************/
-
-	public Object clone() {
-		Graph gr=new Graph();
-		Enumeration e1;
-		int i;
-
-		gr.splines=(Vector)(splines.clone());
-
-		e1=vertices.elements();
-		while (e1.hasMoreElements())
-			gr.addVertex((Vertex)(((Vertex)(e1.nextElement())).clone()));
-
-		for (i=0;i<vertices.size();i++) {
-			Vertex vx1=(Vertex)(gr.vertices.elementAt(i));
-			e1=((Vertex)(vertices.elementAt(i))).getChildren();
-			while (e1.hasMoreElements()) {
-				Vertex vx2=(Vertex)(gr.vertices.elementAt(vertices.indexOf(e1.nextElement())));
-				vx1.addChild(vx2);
-			}
-		}
-
-		gr.vertices2 = new Vertex[vertices.size()];
-		gr.vertices.copyInto(gr.vertices2);
-
-		gr.min_x=min_x;gr.max_x=max_x;
-		gr.min_y=min_y;gr.max_y=max_y;
-
-		return gr;
-	}
-
-	Graph() {}
-
-	/********************************************************************/
-	/*                      Read graph from stream                      */
-	/********************************************************************/
-
-	public Graph(InputStream s,TreeNode tn) throws IOException, ParseError {
-		StreamTokenizer tok=new StreamTokenizer(new InputStreamReader(s));
-		String name,dir,vertexID;
-		Vertex ve1,ve2;
-		boolean children,unfoldDir;
-		int index=0;
-
-		tok.nextToken();
-		while (tok.ttype!=StreamTokenizer.TT_EOF) {
-			if (tok.ttype!=StreamTokenizer.TT_WORD && tok.ttype!='"')
-				throw new ParseError("expected: vertex name\nfound   : "+tok.toString());
-			name=tok.sval;
-                        tok.nextToken();
-			if (tok.ttype!=StreamTokenizer.TT_WORD && tok.ttype!='"')
-				throw new ParseError("expected: vertex identifier\nfound   : "+tok.toString());
-			vertexID=tok.sval;
-			tok.nextToken();
-			if (tok.ttype!=StreamTokenizer.TT_WORD && tok.ttype!='"')
-				throw new ParseError("expected: directory name\nfound   : "+tok.toString());
-			dir=tok.sval;
-			tok.nextToken();
-			if (tok.ttype=='+') {
-				unfoldDir=true;
-				tok.nextToken();
-			} else
-				unfoldDir=false;
-			if (tok.ttype!=StreamTokenizer.TT_WORD && tok.ttype!='"')
-				throw new ParseError("expected: path name\nfound   : "+tok.toString());
-			ve1=findVertex(vertexID);
-			if (ve1==null) {
-				ve1=new NormalVertex("");
-				ve1.setID(vertexID);
-				ve1.setNumber(index++);
-				addVertex(ve1);
-			}
-			ve1.setPath(tok.sval);
-			ve1.setDir(dir);
-                        ve1.setLabel(name);
-			tn.insertNode(name,dir,tok.sval,ve1.getNumber(),unfoldDir);
-			tok.nextToken();
-			if (tok.ttype=='<') {
-				children=true;
-				tok.nextToken();
-			} else if (tok.ttype=='>') {
-					children=false;
-					tok.nextToken();
-			} else children=true;
-			while (tok.ttype!=';') {
-				if (tok.ttype!=StreamTokenizer.TT_WORD && tok.ttype!='"')
-					throw new ParseError("expected: child vertex identifier or ';'\nfound   : "+tok.toString());				
-				ve2=findVertex(tok.sval);
-				if (ve2==null) {
-					ve2=new NormalVertex("");
-					ve2.setID(tok.sval);
-					ve2.setNumber(index++);
-					addVertex(ve2);
-				}
-				if (children)
-					ve1.addChild(ve2);
-				else
-					ve1.addParent(ve2);
-				tok.nextToken();
-			}
-			tok.nextToken();
-		}
-		vertices2 = new Vertex[vertices.size()];
-		vertices.copyInto(vertices2);
-	}
-	
-	/*** Find vertex with identifier vertexID ***/
-
-	public Vertex findVertex(String vertexID) {
-		Enumeration e1=vertices.elements();
-		Vertex v1;
-
-		while (e1.hasMoreElements()) {
-			v1=(Vertex)(e1.nextElement());
-			if ((v1.getID()).equals(vertexID))
-				return v1;
-		}
-		return null;
-	}
-		 
-	public void addVertex(Vertex v) {
-		vertices.addElement(v);
-		v.setGraph(this);
-	}
-
-	public void removeVertex(Vertex v) {
-		vertices.removeElement(v);
-	}
-
-	public Enumeration getVertices() {
-		return vertices.elements();
-	}
-
-	/********************************************************************/
-	/*                          graph layout                            */
-	/********************************************************************/
-
-	public void layout(Graphics g) {
-		splines.removeAllElements();
-		hasseDiagram();
-		Vector layers=min_crossings(insert_dummies((Vector)(sort().elementAt(0))));
-		setParameters(g);
-		init_coordinates(layers);
-		pendulum(layers);
-		rubberband(layers);
-		calcSplines(layers);
-		calcBoundingBox();
-	}
-
-	/********************************************************************/
-	/*                      set layout parameters                       */
-	/********************************************************************/
-
-	public void setParameters(Graphics g) {
-		Enumeration e1=vertices.elements();
-		int h;
-		h=Integer.MIN_VALUE;
-
-		while (e1.hasMoreElements()) {
-		  Box dim=((Vertex)(e1.nextElement())).getLabelSize(g);
-			h=Math.max(h,dim.height);
-		}
-		box_height=h+4;
-		box_height2=box_height/2;
-		gfx=g;
-	}
-
-	/********************************************************************/
-	/*                       topological sorting                        */
-	/********************************************************************/
-
-	public Vector sort() {
-		Vector todo=(Vector)(vertices.clone());
-		Vector layers=new Vector(10,10);
-		Vector todo2;
-		Enumeration e1,e2;
-		Vertex v,v2;
-
-		e1=vertices.elements();
-		while (e1.hasMoreElements())
-			((Vertex)(e1.nextElement())).setDegree(0);
-
-		e1=vertices.elements();
-		while (e1.hasMoreElements()) {
-			v=(Vertex)(e1.nextElement());
-			e2=v.getChildren();
-			while (e2.hasMoreElements()) {
-				v2=(Vertex)(e2.nextElement());
-				todo.removeElement(v2);
-				v2.setDegree(1+v2.getDegree());
-			}
-		}
-		while (!todo.isEmpty()) {
-			layers.addElement(todo);
-			todo2=new Vector(10,10);
-			e1=todo.elements();
-			while (e1.hasMoreElements()) {
-				e2=((Vertex)(e1.nextElement())).getChildren();
-				while (e2.hasMoreElements()) {
-					v=(Vertex)(e2.nextElement());
-					v.setDegree(v.getDegree()-1);
-					if (v.getDegree()==0) {
-						todo2.addElement(v);
-						v.setDegree(layers.size());
-					}
-				}
-			}
-			todo=todo2;
-		}
-		return layers;
-	}
-
-	/********************************************************************/
-	/*                      compute hasse diagram                       */
-	/********************************************************************/
-
-	public void hasseDiagram() {
-		Enumeration e1,e2;
-		Vertex vx1,vx2;
-
-		/** construct adjacence matrix **/
-
-		int vs=vertices.size();
-		boolean adj[][]=new boolean[vs][vs];
-		boolean adj2[][]=new boolean[vs][vs];
-		int i,j,k;
-
-		e1=getVertices();
-		for (i=0;i<vs;i++) {
-			vx1=(Vertex)(e1.nextElement());
-			e2=vx1.getChildren();
-			while (e2.hasMoreElements()) {
-				vx2=(Vertex)(e2.nextElement());
-				j=vertices.indexOf(vx2);
-				adj[i][j]=true;
-				adj2[i][j]=true;
-			}
-		}
-
-		/** compute transitive closure R+ **/
-
-		for (k=0;k<vs;k++)
-			for (i=0;i<vs;i++)
-				if (adj[i][k])
-					for (j=0;j<vs;j++)
-						adj[i][j] = adj[i][j] || adj[k][j];
-
-		/** compute R \ (R+)^2 **/
-
-		for (i=0;i<vs;i++)
-			for (j=0;j<vs;j++)
-				if (adj2[i][j]) {
-					vx1=(Vertex)(vertices.elementAt(i));
-					vx2=(Vertex)(vertices.elementAt(j));
-					for (k=0;k<vs;k++)
-						if (adj[i][k] && adj[k][j]) {
-							vx1.removeChild(vx2);
-							break;
-						}
-				}
-	}
-				
-	/********************************************************************/
-	/*                      insert dummy vertices                       */
-	/********************************************************************/
-
-	public Vector insert_dummies(Vector v) {
-		Vector layers2=new Vector(10,10);
-		int n_edges;
-
-		do {
-			Enumeration e1=v.elements(),e2;
-			Vector next=new Vector(10,10);
-
-			layers2.addElement(v);
-			n_edges=0;
-			while (e1.hasMoreElements()) {
-				Vertex v1=(Vertex)(e1.nextElement());
-				e2=v1.getChildren();
-				while (e2.hasMoreElements()) {
-					n_edges++;
-					Vertex v2=(Vertex)(e2.nextElement());
-					if (v2.getDegree()!=v1.getDegree()+1) {
-						Vertex v3=new DummyVertex();
-						v3.addChild(v2);
-						v3.setDegree(v1.getDegree()+1);
-						v1.removeChild(v2);
-						v1.addChild(v3);
-						next.addElement(v3);
-						addVertex(v3);
-					} else if (next.indexOf(v2)<0) next.addElement(v2);
-				}
-			}
-			v=next;
-			numEdges.addElement(new Integer(n_edges));
-		} while (!v.isEmpty());
-		return layers2;
-	}
-
-	/********************************************************************/
-	/*                     calculation of crossings                     */
-	/********************************************************************/
-
-	public int count_crossings(Vector layers,int oldcr) {
-		int i,j,y1,y2,cr=0,l;
-		for (l=0;l<layers.size()-1;l++) {
-			Vector v1=(Vector)(layers.elementAt(l));
-			for (i=0;i<v1.size();i++) {
-				Enumeration e2=((Vertex)(v1.elementAt(i))).getChildren();
-				while (e2.hasMoreElements()) {
-					y1=((Vector)(layers.elementAt(l+1))).indexOf(e2.nextElement());
-					for (j=0;j<i;j++) {
-						Enumeration e3=((Vertex)(v1.elementAt(j))).getChildren();
-						while (e3.hasMoreElements()) {
-							y2=((Vector)(layers.elementAt(l+1))).indexOf(e3.nextElement());
-							if (y1<y2) {
-								cr++;
-								if (cr>=oldcr) return cr;
-							}
-						}
-					}
-				}
-			}
-		}
-		return cr;
-	}
-
-	/********************************************************************/
-	/* calculation of crossings where vertices vx1 and vx2 are involved */
-	/* vx1 and vx2 must be in same layer and vx1 is left from vx2       */
-	/********************************************************************/
-
-	public int count_crossings_2(Vector layers,Vertex vx1,Vertex vx2,int oldcr) {
-		int i,cr=0,l=vx1.getDegree();
-		Vertex va,vb;
-		Vector layer;
-		Enumeration e1,e2;
-
-		if (l>0) {
-			layer=(Vector)(layers.elementAt(l-1));
-			e1=vx1.getParents();
-			while (e1.hasMoreElements()) {
-				va=(Vertex)(e1.nextElement());
-				i=layer.indexOf(va);
-				e2=vx2.getParents();
-				while (e2.hasMoreElements()) {
-					vb=(Vertex)(e2.nextElement());
-					if (layer.indexOf(vb)<i) {
-						cr++;
-						if (cr>=oldcr) return cr;
-					}
-				}
-			}
-		}
-		if (l<layers.size()-1) {
-			layer=(Vector)(layers.elementAt(l+1));
-			e1=vx1.getChildren();
-			while (e1.hasMoreElements()) {
-				va=(Vertex)(e1.nextElement());
-				i=layer.indexOf(va);
-				e2=vx2.getChildren();
-				while (e2.hasMoreElements()) {
-					vb=(Vertex)(e2.nextElement());
-					if (layer.indexOf(vb)<i) {
-						cr++;
-						if (cr>=oldcr) return cr;
-					}
-				}
-			}
-		}
-		return cr;
-	}
-
-	/********************************************************************/
-	/*       reduction of crossings by exchanging adjacent vertices     */
-	/********************************************************************/
-
-	public void exchangeVertices(Vector layers,int oldcr) {
-		int i,l,c1,c2;
-		Vertex vx1,vx2;
-		Vector v1;
-
-		for (l=0;l<layers.size();l++) {
-			v1=(Vector)(layers.elementAt(l));
-			for (i=0;i<v1.size()-1;i++) {
-				vx1=(Vertex)(v1.elementAt(i));
-				vx2=(Vertex)(v1.elementAt(i+1));
-				c1=count_crossings_2(layers,vx1,vx2,oldcr);
-				c2=count_crossings_2(layers,vx2,vx1,c1);
-				if (c2<c1) {
-					v1.setElementAt(vx2,i);
-					v1.setElementAt(vx1,i+1);
-				}
-			}
-		}
-	}
-
-	/********************************************************************/
-	/*                    minimization of crossings                     */
-	/********************************************************************/
-
-	public Vector min_crossings(Vector layers) {
-		int n,i,l,k,z=0,cr2,cr=count_crossings(layers,Integer.MAX_VALUE);
-		boolean topdown=true,first=true;
-		Enumeration e1,e2;
-		Vector v1,v2,layers2=null,best=layers;
-		Vertex vx1,vx2;
-		n=0;
-		while (n<3 && cr>0) {
-			if (topdown) {
-				/** top-down-traversal **/
-
-				layers2=new Vector(10,10);
-				for (l=0;l<layers.size();l++) {
-					v1=(Vector)(layers.elementAt(l));
-					if (l==0) layers2.addElement(v1.clone());
-					else {
-						v2=new Vector(10,10);
-						layers2.addElement(v2);
-						e1=v1.elements();
-						while (e1.hasMoreElements()) {
-							vx1=(Vertex)(e1.nextElement());
-							k=0;z=0;
-							e2=vx1.getParents();
-							while (e2.hasMoreElements()) {
-								k+=((Vector)(layers2.elementAt(l-1))).indexOf(e2.nextElement());
-								z++;
-							}
-							if (z>0)
-								vx1.setWeight(((double)(k))/z);
-							else if (first)
-								vx1.setWeight(Double.MAX_VALUE);
-							for (i=0;i<v2.size();i++)
-								if (vx1.getWeight()<((Vertex)(v2.elementAt(i))).getWeight()) break;
-							if (i==v2.size()) v2.addElement(vx1);
-							else v2.insertElementAt(vx1,i);
-						}
-					}
-				}
-			} else {
-				/** bottom-up-traversal **/
-
-				layers2=new Vector(10,10);
-				for (l=layers.size()-1;l>=0;l--) {
-					v1=(Vector)(layers.elementAt(l));
-					if (l==layers.size()-1) layers2.addElement(v1.clone());
-					else {
-						v2=new Vector(10,10);
-						layers2.insertElementAt(v2,0);
-						e1=v1.elements();
-						while (e1.hasMoreElements()) {
-							vx1=(Vertex)(e1.nextElement());
-							k=0;z=0;
-							e2=vx1.getChildren();
-							while (e2.hasMoreElements()) {
-								k+=((Vector)(layers2.elementAt(1))).indexOf(e2.nextElement());
-								z++;
-							}
-							if (z>0)
-								vx1.setWeight(((double)(k))/z);
-							else if (first)
-								vx1.setWeight(Double.MAX_VALUE);
-							for (i=0;i<v2.size();i++)
-								if (vx1.getWeight()<((Vertex)(v2.elementAt(i))).getWeight()) break;
-							if (i==v2.size()) v2.addElement(vx1);
-							else v2.insertElementAt(vx1,i);
-						}
-					}
-				}
-			}
-			//exchangeVertices(layers2,cr);
-			topdown=!topdown;
-			first=false;
-			layers=layers2;
-
-			cr2=count_crossings(layers2,cr);
-			if (cr2<cr) {
-				best=layers2;
-				cr=cr2;					
-			} else n++;
-		}
-
-		while (true) {
-			exchangeVertices(best,cr);
-			cr2=count_crossings(best,cr);
-			if (cr2<cr)
-				cr=cr2;
-			else
-				break;
-		}
-
-		return best;
-	}
-
-	/********************************************************************/
-	/*                   set initial coordinates                        */
-	/********************************************************************/
-
-	public void init_coordinates(Vector layers) {
-		int y=0;
-		Enumeration e1=layers.elements();
-		Enumeration e3=numEdges.elements();
-		while (e1.hasMoreElements()) {
-			Vector v1=(Vector)(e1.nextElement());
-			Enumeration e2=v1.elements();
-			int x=0;
-			while (e2.hasMoreElements()) {
-				Vertex ve=(Vertex)(e2.nextElement());
-				ve.setX(x+ve.box_width2());
-				ve.setY(y);
-				x+=ve.box_width()+20;
-			}
-			y+=box_height+Math.max(35,7*(((Integer)(e3.nextElement())).intValue()));
-		}
-	}
-
-	/********************************************************************/
-	/*                       pendulum method                            */
-	/********************************************************************/
-
-	public void pendulum(Vector layers) {
-		Vector layers2=new Vector(10,10);
-		Enumeration e1=layers.elements(),e2;
-		int i,j,d1,d2,k,offset,dsum;
-		Region r1,r2;
-		boolean change;
-
-		while (e1.hasMoreElements()) {
-			e2=((Vector)(e1.nextElement())).elements();
-			Vector layer=new Vector(10,10);
-			layers2.addElement(layer);
-			while (e2.hasMoreElements()) {
-				Region r=new Region(this);
-				r.addVertex((Vertex)(e2.nextElement()));
-				layer.addElement(r);
-			}
-		}
-		for (k=0;k<10;k++) {
-			dsum=0;
-			for (j=1;j<layers2.size();j++) {
-				Vector l=(Vector)(layers2.elementAt(j));
-				if (l.size()>=2) {
-					do {
-						change=false;
-						d1=((Region)(l.firstElement())).pred_deflection();
-						for (i=0;i<l.size()-1;i++) {
-							r1=(Region)(l.elementAt(i));
-							r2=(Region)(l.elementAt(i+1));
-							d2=r2.pred_deflection();
-							if (r1.touching(r2) && (d1 <= 0 && d2 < d1 ||
-								d2 > 0 && d1 > d2 || d1 > 0 && d2 < 0)) {
-								r1.combine(r2);
-								l.removeElement(r2);
-								change=true;
-								d2=r1.pred_deflection();
-							}
-							d1=d2;
-						}
-					} while (change);
-				}
-				for (i=0;i<l.size();i++) {
-					r1=(Region)(l.elementAt(i));
-					d1=r1.pred_deflection();
-					offset=d1;
-					if (d1<0 && i>0) offset=-Math.min(
-						((Region)(l.elementAt(i-1))).spaceBetween(r1),-d1);
-					if (d1>=0 && i<l.size()-1) offset=Math.min(
-						r1.spaceBetween((Region)(l.elementAt(i+1))),d1);
-					r1.move(offset);
-					dsum+=Math.abs(d1);
-				}		
-			}
-			if (dsum==0) break;
-		}
-	}		
-
-	/********************************************************************/
-	/*                      rubberband method                           */
-	/********************************************************************/
-
-	public void rubberband(Vector layers) {
-		Enumeration e1,e2;
-		int i,n,k,d,d2;
-		Vector v;
-		Vertex vx;
-
-		for (k=0;k<10;k++) {
-			e1=layers.elements();
-			while (e1.hasMoreElements()) {
-				v=(Vector)(e1.nextElement());
-				for (i=0;i<v.size();i++) {
-					n=0;d=0;
-					vx=(Vertex)(v.elementAt(i));
-					e2=vx.getChildren();
-					while (e2.hasMoreElements()) {
-						d+=((Vertex)(e2.nextElement())).getX()-vx.getX();
-						n++;
-					}
-					e2=vx.getParents();
-					while (e2.hasMoreElements()) {
-						d+=((Vertex)(e2.nextElement())).getX()-vx.getX();
-						n++;
-					}
-					d2=(n!=0?d/n:0);
-
-					if (d<0 && (i==0 || ((Vertex)(v.elementAt(i-1))).rightX()+20 < vx.leftX()+d2) ||
-						d>0 && (i==v.size()-1 || ((Vertex)(v.elementAt(i+1))).leftX()-20 > vx.rightX()+d2))
-						vx.setX(vx.getX()+d2);
-				}
-			}
-		}
-	}
-
-	/**** Intersection point of two lines (auxiliary function for calcSplines)   ****/
-	/**** Calculate intersection point of line which is parallel to line (p1,p2) ****/
-	/**** and leads through p5, with line (p3,p4)                                ****/
-
-	Point intersect(Point p1,Point p2,Point p3,Point p4,Point p5) {
-		float x=0,y=0,s1=0,s2=0;
-
-		if (p1.x!=p2.x)
-			s1=((float)(p2.y-p1.y))/(p2.x-p1.x);
-		if (p3.x!=p4.x)
-			s2=((float)(p4.y-p3.y))/(p4.x-p3.x);
-		if (p1.x==p2.x) {
-			x=p5.x;
-			y=s2*(p5.x-p3.x)+p3.y;
-		} else if (p3.x==p4.x) {
-			x=p3.x;
-			y=s1*(p3.x-p5.x)+p5.y;
-		} else {
-			x=(p5.x*s1-p3.x*s2+p3.y-p5.y)/(s1-s2);
-			y=s2*(x-p3.x)+p3.y;
-		}
-		return new Point(Math.round(x),Math.round(y));
-	}
-
-	/**** Calculate control points (auxiliary function for calcSplines) ****/
-
-	Points calcPoint(Point p1,Point p2,Point p3,int lboxx,int rboxx,int boxy) {
-
-		/*** Points p1 , p2 , p3 define a triangle which encloses the spline.  ***/
-		/*** Check if adjacent boxes (specified by lboxx,rboxx and boxy)       ***/
-		/*** collide with the spline. In this case p1 and p3 are shifted by an ***/
-		/*** appropriate offset before they are returned                       ***/
-
-		int xh1,xh2,bx=0,by=0;
-		boolean pt1 = boxy >= p1.y && boxy <= p3.y || boxy >= p3.y && boxy <= p1.y;
-		boolean pt2 = boxy+box_height >= p1.y && boxy+box_height <= p3.y ||
-                              boxy+box_height >= p3.y && boxy+box_height <= p1.y;
-		boolean move = false;
-		Point b;
-
-		xh1 = p1.x+(boxy-p1.y)*(p3.x-p1.x)/(p3.y-p1.y);
-		xh2 = p1.x+(boxy+box_height-p1.y)*(p3.x-p1.x)/(p3.y-p1.y);
-
-		if (xh1 <= lboxx && pt1 && xh2 <= lboxx && pt2) {
-			move = true;
-			bx = lboxx;
-			by = boxy + (xh1 < xh2 ? 0 : box_height ) ;
-		} else if (xh1 >= rboxx && pt1 && xh2 >= rboxx && pt2) {
-			move = true;
-			bx = rboxx;
-			by = boxy + (xh1 > xh2 ? 0 : box_height ) ;
-		} else if ( (xh1 <= lboxx || xh1 >= rboxx) && pt1) {
-			move = true;
-			bx = (xh1 <= lboxx ? lboxx : rboxx ) ;
-			by = boxy;
-		} else if ( (xh2 <= lboxx || xh2 >= rboxx) && pt2) {
-			move = true;
-			bx = (xh2 <= lboxx ? lboxx : rboxx ) ;
-			by = boxy+box_height;
-		}
-		b=new Point(bx,by);
-		if (move) return new Points(intersect(p1,p3,p1,p2,b),intersect(p1,p3,p2,p3,b));
-		else return new Points(p1,p3);
-	}
-
-	/********************************************************************/
-	/*                        calculate splines                         */
-	/********************************************************************/
-
-	public void calcSplines(Vector layers) {
-		Enumeration e2,e1=vertices.elements();
-		Vertex vx1,vx2,vx3;
-		Vector pos,layer;
-		int x1,y1,x2,y2,x3,y3,xh,k,leftx,rightx,spc;
-
-		while (e1.hasMoreElements()) {
-			vx1=(Vertex)(e1.nextElement());
-			if (!vx1.isDummy()) {
-				e2=vx1.getChildren();
-				while (e2.hasMoreElements()) {
-					vx2=(Vertex)(e2.nextElement());
-					if (vx2.isDummy()) {
-						vx3=vx2;
-						/**** convert edge to spline ****/
-						pos=new Vector(10,10);
-						x1=vx1.getX();
-						y1=vx1.getY()+box_height;
-
-						do {
-							/*** calculate position of control points ***/
-							x2=vx2.getX();
-							y2=vx2.getY();
-							layer=(Vector)(layers.elementAt(vx2.getDegree()));
-							k=layer.indexOf(vx2);
-							vx2=(Vertex)((vx2.getChildren()).nextElement());
-							x3=vx2.getX();
-							y3=vx2.getY();
-							spc=0;
-							leftx = k==0 /* || ((Vertex)(layer.elementAt(k-1))).isDummy() */ ?
-								Integer.MIN_VALUE:
-								((Vertex)(layer.elementAt(k-1))).rightX()+spc;
-							rightx = k==layer.size()-1 /* || ((Vertex)(layer.elementAt(k+1))).isDummy() */ ?
-								Integer.MAX_VALUE:
-								((Vertex)(layer.elementAt(k+1))).leftX()-spc;
-							xh=x2+box_height*(x3-x2)/(y3-y2);
-							if (!(x2<=x3 && xh>=rightx || x2>x3 && xh<=leftx)) {
-								/* top control point */
-								pos.addElement(new Integer(1));
-								y1=y2;
-							} else {
-								xh=x1+(y2-y1)*(x2-x1)/(y2+box_height-y1);
-								if (!(x2<=x1 && xh>=rightx || x2>x1 && xh<=leftx))
-									/* bottom control point */
-									pos.addElement(new Integer(2));
-								else
-									/* two control points needed */
-									pos.addElement(new Integer(3));
-								y1=y2+box_height;
-							}
-							x1=x2;
-						} while (vx2.isDummy());
-						pos.addElement(new Integer(1));
-
-						/**** calculate triangles ****/
-						vx2=vx3;
-
-						int pos1,pos2,i=0;
-						Vector pts=new Vector(10,10);
-						int lboxx,rboxx,boxy;
-
-						x1=vx1.getX();
-						y1=vx1.getY()+box_height;
-						pts.addElement(new Point(x1,y1)); /** edge starting point **/
-						do {
-							x2=vx2.getX();
-							y2=vx2.getY();
-							pos1=((Integer)(pos.elementAt(i))).intValue();
-							pos2=((Integer)(pos.elementAt(i+1))).intValue();
-							i++;
-							layer=(Vector)(layers.elementAt(vx2.getDegree()));
-							k=layer.indexOf(vx2);
-							boxy=vx2.getY();
-							vx2=(Vertex)((vx2.getChildren()).nextElement());
-							x3=vx2.getX();
-							y3=vx2.getY();
-							if (pos1==2) y2+=box_height;
-							if (pos2==2) y3+=box_height;
-
-							lboxx = (k==0 /* || ((Vertex)(layer.elementAt(k-1))).isDummy() */ ) ?
-								Integer.MIN_VALUE :
-								((Vertex)(layer.elementAt(k-1))).rightX();
-
-							rboxx = (k==layer.size()-1 /* || ((Vertex)(layer.elementAt(k+1))).isDummy() */ ) ?
-								Integer.MAX_VALUE :
-								((Vertex)(layer.elementAt(k+1))).leftX();
-
-							Point p1,p2,p3;
-							Points ps;
-
-							p1 = new Point((x1+x2)/2,(y1+y2)/2);
-
-							if (pos1<=2) {
-								/** one control point **/
-								p2 = new Point(x2,y2);
-								ps = calcPoint(p1,p2,new Point((x2+x3)/2,(y2+y3)/2),lboxx,rboxx,boxy);
-								pts.addElement(ps.p);
-								pts.addElement(p2);
-								pts.addElement(ps.q);
-							} else {
-								/** two control points **/
-								p2 = new Point(x2,y2-box_height);
-								p3 = new Point(x2,y2+box_height2);
-								ps = calcPoint(p1,p2,p3,lboxx,rboxx,boxy);
-								pts.addElement(ps.p);
-								pts.addElement(p2);
-								pts.addElement(ps.q);
-								p2 = new Point(x2,y2+box_height*2);
-								ps = calcPoint(p3,p2,new Point((p2.x+x3)/2,(p2.y+y3)/2),
-								               lboxx,rboxx,boxy);
-								pts.addElement(ps.p);
-								pts.addElement(p2);
-								pts.addElement(ps.q);
-							}
-							x1=p2.x;
-							y1=p2.y;
-						} while (vx2.isDummy());
-
-						pts.addElement(new Point(vx2.getX(),vx2.getY())); /** edge end point **/
-						splines.addElement(new Spline(pts));
-					}
-				}
-			}
-		}
-	}
-
-	/********************************************************************/
-	/*                      calculate bounding box                      */
-	/********************************************************************/
-
-	public void calcBoundingBox() {
-		min_y=min_x=Integer.MAX_VALUE;
-		max_y=max_x=Integer.MIN_VALUE;
-
-		Enumeration e1=vertices.elements();
-		Vertex v;
-
-		while (e1.hasMoreElements()) {
-			v=(Vertex)(e1.nextElement());
-			min_x=Math.min(min_x,v.leftX());
-			max_x=Math.max(max_x,v.rightX());
-			min_y=Math.min(min_y,v.getY());
-			max_y=Math.max(max_y,v.getY()+box_height);
-		}
-		min_x-=20;
-		min_y-=20;
-		max_x+=20;
-		max_y+=20;
-	}
-
-	/********************************************************************/
-	/*                           draw graph                             */
-	/********************************************************************/
-					 
-	public void draw(Graphics g) {
-		if (box_height==0) layout(g);
-
-		g.translate(-min_x,-min_y);
-
-		Enumeration e1=vertices.elements();
-		while (e1.hasMoreElements())
-			((Vertex)(e1.nextElement())).draw(g);
-
-		e1=splines.elements();
-		while (e1.hasMoreElements())
-			((Spline)(e1.nextElement())).draw(g);
-	}
-
-	/********************************************************************/
-	/*               return vertex at position (x,y)                    */
-	/********************************************************************/
-
-	public Vertex vertexAt(int x,int y) {
-		Enumeration e1=vertices.elements();
-		while (e1.hasMoreElements()) {
-			Vertex v=(Vertex)(e1.nextElement());
-			if (v.contains(x,y)) return v;
-		}
-		return null;
-	}
-
-	/********************************************************************/
-	/*       encode list of vertices (as array of vertice numbers)      */
-	/********************************************************************/
-
-	public Vector encode(Vector v) {
-		Vector code=new Vector(10,10);
-		Enumeration e1=v.elements();
-
-		while (e1.hasMoreElements()) {
-			Vertex vx=(Vertex)(e1.nextElement());
-			if (vx.getNumber()>=0)
-				code.addElement(new Integer(vx.getNumber()));
-		}
-		return code;
-	}
-
-	/********************************************************************/
-	/*                      get vertex with number n                    */
-	/********************************************************************/
-
-	public Vertex getVertexByNum(int x) {
-		Enumeration e1=vertices.elements();
-
-		while (e1.hasMoreElements()) {
-			Vertex vx=(Vertex)(e1.nextElement());
-			if (vx.getNumber()==x) return vx;
-		}
-		return null;
-	}
-
-	/********************************************************************/
-	/*                      decode list of vertices                     */
-	/********************************************************************/
-
-	public Vector decode(Vector code) {
-		Enumeration e1=code.elements();
-		Vector vec=new Vector(10,10);
-
-		while (e1.hasMoreElements()) {
-			int i=((Integer)(e1.nextElement())).intValue();
-			//Vertex vx=getVertexByNum(i);
-			//if (vx!=null) vec.addElement(vx);
-			vec.addElement(vertices2[i]);
-		}
-		return vec;
-	}
-
-	/********************************************************************/
-	/*                       collapse vertices                          */
-	/********************************************************************/
-
-	public void collapse(Vector vs,String name,Vector inflate) {
-		Enumeration e1,e2,e3;
-		boolean nonempty=false;
-		Vertex vx3,vx2,vx1;
-		
-		e1=vertices.elements();
-
-		vx1=new NormalVertex(name);
-		vx1.setInflate(inflate);
-
-		while (e1.hasMoreElements()) {
-			vx2=(Vertex)(e1.nextElement());
-
-			if (vs.indexOf(vx2)<0) {
-				e2=vx2.getParents();
-				while (e2.hasMoreElements()) {
-					vx3=(Vertex)(e2.nextElement());
-					if (vs.indexOf(vx3)>=0) {
-						if (!vx1.isChild(vx2))
-							vx1.addChild(vx2);
-						vx3.removeChild(vx2);
-					}
-				}
-
-				e2=vx2.getChildren();
-				while (e2.hasMoreElements()) {
-					vx3=(Vertex)(e2.nextElement());
-					if (vs.indexOf(vx3)>=0) {
-						if (!vx2.isChild(vx1))
-							vx2.addChild(vx1);
-						vx2.removeChild(vx3);
-					}
-				}
-			} else { nonempty=true; }
-		}
-
-		e1=vs.elements();
-		while (e1.hasMoreElements())
-			try {
-				removeVertex((Vertex)(e1.nextElement()));
-			} catch (NoSuchElementException exn) {}
-
-		if (nonempty) addVertex(vx1);
-	}
-
-	/********************************************************************/
-	/*                      PostScript output                           */
-	/********************************************************************/
-
-	public void PS(String fname,boolean printable) throws IOException {
-		FileOutputStream f = new FileOutputStream(fname);
-		PrintWriter p = new PrintWriter(f, true);
-
-		if (printable)
-			p.println("%!PS-Adobe-2.0\n\n%%BeginProlog");
-		else {
-			p.println("%!PS-Adobe-2.0 EPSF-2.0\n%%Orientation: Portrait");
-			p.println("%%BoundingBox: "+min_x+" "+min_y+" "+max_x+" "+max_y);
-			p.println("%%EndComments\n\n%%BeginProlog");
-		}
-		p.println("/m { moveto } def /l { lineto } def /n { newpath } def");
-		p.println("/s { stroke } def /c { curveto } def");
-		p.println("/b { n 0 0 m dup true charpath pathbbox 1 index 4 index sub");
-		p.println("7 index exch sub 2 div 9 index add 1 index 4 index sub 7 index exch sub");
-		p.println("2 div 9 index add 2 index add m pop pop pop pop");
-		p.println("1 -1 scale show 1 -1 scale n 3 index 3 index m 1 index 0 rlineto");
-		p.println("0 exch rlineto neg 0 rlineto closepath s pop pop } def");
-		p.println("%%EndProlog\n");
-		if (printable) {
-			int hsize=max_x-min_x;
-			int vsize=max_y-min_y;
-			if (hsize>vsize) {
-				// Landscape output
-				double scale=Math.min(1,Math.min(750.0/hsize,500.0/vsize));
-				double trans_x=50+max_y*scale+(500-scale*vsize)/2.0;
-				double trans_y=50+max_x*scale+(750-scale*hsize)/2.0;
-				p.println(trans_x+" "+trans_y+" translate");
-				p.println("-90 rotate");
-				p.println(scale+" "+(-scale)+" scale");
-			} else {
-				// Portrait output
-				double scale=Math.min(1,Math.min(500.0/hsize,750.0/vsize));
-				double trans_x=50-min_x*scale+(500-scale*hsize)/2.0;
-				double trans_y=50+max_y*scale+(750-scale*vsize)/2.0;
-				p.println(trans_x+" "+trans_y+" translate");
-				p.println(scale+" "+(-scale)+" scale");
-			}
-		} else
-			p.println("0 "+(max_y+min_y)+" translate\n1 -1 scale");
-
-		p.println("/Helvetica findfont 12 scalefont setfont");
-		p.println("0.5 setlinewidth");
-
-		Enumeration e1=vertices.elements();
-		while (e1.hasMoreElements())
-			((Vertex)(e1.nextElement())).PS(p);
-
-		e1=splines.elements();
-		while (e1.hasMoreElements())
-			((Spline)(e1.nextElement())).PS(p);
-
-		if (printable) p.println("showpage");
-
-		f.close();
-	}
-}
-
-/**** Return value of function calcPoint ****/
-
-class Points {
-	public Point p,q;
-
-	public Points(Point p1,Point p2) {
-		p=p1;q=p2;
-	}
-}
-
--- a/lib/browser/GraphBrowser/GraphBrowser.java	Wed Mar 31 16:01:31 2021 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,215 +0,0 @@
-/***************************************************************************
-  Title:      GraphBrowser/GraphBrowser.java
-  Author:     Stefan Berghofer, TU Muenchen
-  Options:    :tabSize=4:
-
-  This is the graph browser's main class. It contains the "main(...)"
-  method, which is used for the stand-alone version, as well as
-  "init(...)", "start(...)" and "stop(...)" methods which are used for
-  the applet version.
-  Note: GraphBrowser is designed for the 1.1.x version of the JDK.
-***************************************************************************/
-
-package GraphBrowser;
-
-import java.awt.*;
-import java.applet.*;
-import java.io.*;
-import java.util.*;
-import java.net.*;
-import awtUtilities.*;
-
-public class GraphBrowser extends Applet {
-	GraphView gv;
-	TreeBrowser tb=null;
-	String gfname;
-
-	static boolean isApplet;
-	static Frame f;
-
-	public GraphBrowser(String name) {
-		gfname=name;
-	}
-
-	public GraphBrowser() {}
-
-	public void showWaitMessage() {
-		if (isApplet)
-			getAppletContext().showStatus("calculating layout, please wait ...");
-		else {
-			f.setCursor(new Cursor(Cursor.WAIT_CURSOR));
-		}
-	}
-
-	public void showReadyMessage() {
-		if (isApplet)
-			getAppletContext().showStatus("ready !");
-		else {
-			f.setCursor(new Cursor(Cursor.DEFAULT_CURSOR));
-		}
-	}
-
-	public void viewFile(String fname) {
-		try {
-			if (isApplet)
-				getAppletContext().showDocument(new URL(getDocumentBase(), fname), "_blank");
-			else {
-				String path = gfname.substring(0, gfname.lastIndexOf('/') + 1);
-				Reader rd;
-				BufferedReader br;
-				String line, text = "";
-
-				try {
-					rd = new BufferedReader(new InputStreamReader((new URL(fname)).openConnection().getInputStream()));
-				} catch (Exception exn) {
-					rd = new FileReader(path + fname);
-				}
-				br = new BufferedReader(rd);
-
-				while ((line = br.readLine()) != null)
-					text += line + "\n";
-
-				if (fname.endsWith(".html")) {
-					/**** convert HTML to text (just a quick hack) ****/
-
-					String buf="";
-					char[] text2,text3;
-					int i,j=0;
-					boolean special=false, html=false;
-					char ctrl;
-
-					text2 = text.toCharArray();
-					text3 = new char[text.length()];
-					for (i = 0; i < text.length(); i++) {
-						char c = text2[i];
-						if (c == '&') {
-							special = true;
-							buf = "";
-						} else if (special) {
-							if (c == ';') {
-								special = false;
-								if (buf.equals("lt"))
-									text3[j++] = '<';
-								else if (buf.equals("gt"))
-									text3[j++] = '>';
-								else if (buf.equals("amp"))
-									text3[j++] = '&';
-							} else
-								buf += c;
-						} else if (c == '<') {
-							html = true;
-							ctrl = text2[i+1];
-						} else if (c == '>')
-							html = false;
-						else if (!html)
-							text3[j++] = c;
-					}
-					text = String.valueOf(text3);
-				}
-							
-				Frame f=new TextFrame(fname.substring(fname.lastIndexOf('/')+1),text);
-				f.setSize(500,600);
-				f.show();
-			}
-		} catch (Exception exn) {
-			System.err.println("Can't read file "+fname);
-		}
-	}
-				
-	public void PS(String fname,boolean printable) throws IOException {
-		gv.PS(fname,printable);
-	}
-
-	public boolean isEmpty() {
-		return tb==null;
-	}
-
-	public void initBrowser(InputStream is, boolean noAWT) {
-		try {
-			Font font = noAWT ? null : new Font("Helvetica", Font.PLAIN, 12);
-			TreeNode tn = new TreeNode("Root", "", -1, true);
-			gv = new GraphView(new Graph(is, tn), this, font);
-			tb = new TreeBrowser(tn, gv, font);
-			gv.setTreeBrowser(tb);
-			Vector v = new Vector(10,10);
-			tn.collapsedDirectories(v);
-			gv.collapseDir(v);
-
-			ScrollPane scrollp1 = new ScrollPane();
-			ScrollPane scrollp2 = new ScrollPane();
-			scrollp1.add(gv);
-			scrollp2.add(tb);
-			scrollp1.getHAdjustable().setUnitIncrement(20);
-			scrollp1.getVAdjustable().setUnitIncrement(20);
-			scrollp2.getHAdjustable().setUnitIncrement(20);
-			scrollp2.getVAdjustable().setUnitIncrement(20);
-			Component gv2 = new Border(scrollp1, 3);
-			Component tb2 = new Border(scrollp2, 3);
-			GridBagLayout gridbag = new GridBagLayout();
-			GridBagConstraints cnstr = new GridBagConstraints();
-			setLayout(gridbag);
-			cnstr.fill = GridBagConstraints.BOTH;
-			cnstr.insets = new Insets(5,5,5,5);
-			cnstr.weightx = 1;
-			cnstr.weighty = 1;
-			cnstr.gridwidth = 1;
-			gridbag.setConstraints(tb2,cnstr);
-			add(tb2);
-			cnstr.weightx = 2.5;
-			cnstr.gridwidth = GridBagConstraints.REMAINDER;
-			gridbag.setConstraints(gv2,cnstr);
-			add(gv2);
-		} catch (IOException exn) {
-			System.err.println("\nI/O error while reading graph file.");
-		} catch (ParseError exn) {
-			System.err.println("\nParse error in graph file:");
-			System.err.println(exn.getMessage());
-			System.err.println("\nSyntax:\n<vertexname> <vertexID> <dirname> [ + ] <path> [ < | > ] [ <vertexID> [ ... [ <vertexID> ] ... ] ] ;");
-		}
-	}		
-
-	public void init() {
-		isApplet=true;
-		gfname=getParameter("graphfile");
-		try {
-			InputStream is=(new URL(getDocumentBase(), gfname)).openConnection().getInputStream();
-			initBrowser(is, false);
-			is.close();
-		} catch (MalformedURLException exn) {
-			System.err.println("Invalid URL: "+gfname);
-		} catch (IOException exn) {
-			System.err.println("I/O error while reading "+gfname+".");
-		}
-	}
-
-	public static void main(String[] args) {
-		isApplet=false;
-		try {
-			GraphBrowser gb=new GraphBrowser(args.length > 0 ? args[0] : "");
-			if (args.length > 0) {
-				InputStream is=new FileInputStream(args[0]);
-				gb.initBrowser(is, args.length > 1);
-				is.close();
-			}
-			if (args.length > 1) {
-                            try {
-			      if (args[1].endsWith(".ps"))
-                                gb.gv.PS(args[1], true);
-                              else if (args[1].endsWith(".eps"))
-                                gb.gv.PS(args[1], false);
-                              else
-                                System.err.println("Unknown file type: " + args[1]);
-                            } catch (IOException exn) {
-                              System.err.println("Unable to write file " + args[1]);
-                            }
-                        } else {
-			    f=new GraphBrowserFrame(gb);
-			    f.setSize(700,500);
-			    f.show();
-                        }
-		} catch (IOException exn) {
-			System.err.println("Can't open graph file "+args[0]);
-		}
-	}
-}
-
--- a/lib/browser/GraphBrowser/GraphBrowserFrame.java	Wed Mar 31 16:01:31 2021 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,125 +0,0 @@
-/***************************************************************************
-  Title:      GraphBrowser/GraphBrowserFrame.java
-  Author:     Stefan Berghofer, TU Muenchen
-  Options:    :tabSize=2:
-
-  This class is the frame for the stand-alone application. It contains
-  methods for handling menubar events.
-***************************************************************************/
-
-package GraphBrowser;
-
-import java.awt.*;
-import java.awt.event.*;
-import java.io.*;
-import awtUtilities.*;
-
-public class GraphBrowserFrame extends Frame implements ActionListener {
-	GraphBrowser gb;
-	MenuItem i1, i2;
-	String graphDir, psDir;
-
-	public void checkMenuItems() {
-		if (gb.isEmpty()) {
-			i1.setEnabled(false);
-			i2.setEnabled(false);
-		} else {
-			i1.setEnabled(true);
-			i2.setEnabled(true);
-		}
-	}
-
-	public void actionPerformed(ActionEvent evt) {
-		String label = evt.getActionCommand();
-		if (label.equals("Quit"))
-			System.exit(0);
-		else if (label.equals("Export to PostScript")) {
-			PS(true, label);
-			return;
-		} else if (label.equals("Export to EPS")) {
-			PS(false, label);
-			return;
-		} else if (label.equals("Open ...")) {
-			FileDialog fd = new FileDialog(this, "Open graph file", FileDialog.LOAD);
-			if (graphDir != null)
-				fd.setDirectory(graphDir);
-			fd.setVisible(true);
-			if (fd.getFile() == null) return;
-			graphDir = fd.getDirectory();
-			String fname = graphDir + fd.getFile();
-			GraphBrowser gb2 = new GraphBrowser(fname);
-			try {
-				InputStream is = new FileInputStream(fname);
-				gb2.initBrowser(is, false);
-				is.close();
-			} catch (IOException exn) {
-				String button[] = {"OK"};
-				MessageDialog md = new MessageDialog(this, "Error",
-					"Can't open file " + fname + ".", button);
-				md.setSize(350, 200);
-				md.setVisible(true);
-				return;
-			}
-			remove(gb);
-			add("Center", gb2);
-			gb = gb2;
-			checkMenuItems();
-			validate();
-		}
-	}
-
-	public void PS(boolean printable,String label) {
-		FileDialog fd=new FileDialog(this,label,FileDialog.SAVE);
-		if (psDir!=null)
-			fd.setDirectory(psDir);
-		fd.setVisible(true);
-		if (fd.getFile()==null) return;
-		psDir=fd.getDirectory();
-		String fname=psDir+fd.getFile();
-
-		if ((new File(fname)).exists()) {
-			String buttons[]={"Overwrite","Cancel"};
-			MessageDialog md=new MessageDialog(this,"Warning",
-			      "Warning: File "+fname+" already exists. Overwrite?",
-			      buttons);
-			md.setSize(350,200);
-			md.setVisible(true);
-			if (md.getText().equals("Cancel")) return;
-		}
-
-		try {
-			gb.PS(fname,printable);
-		} catch (IOException exn) {
-			String button[]={"OK"};
-			MessageDialog md=new MessageDialog(this,"Error",
-			      "Unable to write file "+fname+".",button);
-			md.setSize(350,200);
-			md.setVisible(true);
-		}
-	}
-
-	public GraphBrowserFrame(GraphBrowser br) {
-		super("GraphBrowser");
-		MenuItem i3, i4;
-		gb = br;
-		MenuBar mb = new MenuBar();
-		Menu m1 = new Menu("File");
-		m1.add(i3 = new MenuItem("Open ..."));
-		m1.add(i1 = new MenuItem("Export to PostScript"));
-		m1.add(i2 = new MenuItem("Export to EPS"));
-		m1.add(i4 = new MenuItem("Quit"));
-		i1.addActionListener(this);
-		i2.addActionListener(this);
-		i3.addActionListener(this);
-		i4.addActionListener(this);
-		checkMenuItems();
-		mb.add(m1);
-		setMenuBar(mb);
-		add("Center", br);
-    addWindowListener( new WindowAdapter() {
-      public void windowClosing(WindowEvent e) {
-        System.exit(0);
-      }
-    });
-	}
-}
--- a/lib/browser/GraphBrowser/GraphView.java	Wed Mar 31 16:01:31 2021 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,276 +0,0 @@
-/***************************************************************************
-  Title:      GraphBrowser/GraphView.java
-  Author:     Stefan Berghofer, TU Muenchen
-  Options:    :tabSize=4:
-
-  This class defines the window in which the graph is displayed. It
-  contains methods for handling events such as collapsing / uncollapsing
-  nodes of the graph.
-***************************************************************************/
-
-package GraphBrowser;
-
-import java.awt.*;
-import java.awt.event.*;
-import java.io.*;
-import java.util.*;
-
-public class GraphView extends Canvas implements MouseListener, MouseMotionListener {
-	Graph gra, gra2;
-	GraphBrowser browser;
-	Vertex v = null;
-	Vector collapsed = new Vector(10,10);
-	Vector collapsedDirs = new Vector(10,10);
-	TreeBrowser tb;
-	long timestamp;
-	Vertex highlighted = null;
-	Dimension size;
-	boolean parent_needs_layout;
-	Font font;
-
-	public void setTreeBrowser(TreeBrowser br) {
-		tb=br;
-	}
-
-	public GraphBrowser getBrowser() { return browser; }
-
-	public Graph getGraph() { return gra; }
-
-	public Graph getOriginalGraph() { return gra2; }
-
-	public GraphView(Graph gr, GraphBrowser br, Font f) {
-		gra2=gr;
-		browser=br;
-		gra=(Graph)(gra2.clone());
-		parent_needs_layout = true;
-		size = new Dimension(0, 0);
-		font = f;
-		addMouseListener(this);
-		addMouseMotionListener(this);
-	}
-
-	public void PS(String fname,boolean printable) throws IOException {
-	    Graph gra3 = (Graph)gra.clone();
-	    gra3.layout(null);
-	    gra3.PS(fname,printable);
-	}
-
-	public void paint(Graphics g) {
-		g.setFont(font);
-		gra.draw(g);
-		if (highlighted!=null) highlighted.drawBox(g,Color.white);
-		size = new Dimension(gra.max_x-gra.min_x, gra.max_y-gra.min_y);
-		if (parent_needs_layout) {
-			parent_needs_layout = false;
-			getParent().doLayout();
-		}
-	}
-
-	public Dimension getPreferredSize() {
-		return size;
-	}
-
-	public void mouseMoved(MouseEvent evt) {
-		int x = evt.getX() + gra.min_x;
-		int y = evt.getY() + gra.min_y;
-
-		Vertex v2=gra.vertexAt(x,y);
-		Graphics g=getGraphics();
-		g.setFont(font);
-		g.translate(-gra.min_x,-gra.min_y);
-		if (highlighted!=null) {
-			highlighted.drawBox(g,Color.lightGray);
-			highlighted=null;
-		}
-		if (v2!=v) {
-			if (v!=null) v.removeButtons(g);
-			if (v2!=null) v2.drawButtons(g);
-			v=v2;
-		}
-	}
-
-	public void mouseDragged(MouseEvent evt) {}
-
-	/*****************************************************************/
-	/* This method is called if successor / predecessor nodes (whose */
-	/* numbers are stored in Vector c) of a certain node should be   */
-        /* displayed again                                               */
-	/*****************************************************************/
-
-	void uncollapse(Vector c) {
-		collapsed.removeElement(c);
-		collapseNodes();
-	}
-
-	/*****************************************************************/
-	/* This method is called by class TreeBrowser when directories   */
-	/* are collapsed / uncollapsed by the user                       */
-	/*****************************************************************/
-
-	public void collapseDir(Vector v) {
-		collapsedDirs=v;
-
-		collapseNodes();
-	}
-
-	/*****************************************************************/
-	/*                      Inflate node again                       */
-	/*****************************************************************/
-
-	public void inflateNode(Vector c) {
-		Enumeration e1;
-
-		e1=collapsedDirs.elements();
-		while (e1.hasMoreElements()) {
-			Directory d=(Directory)(e1.nextElement());
-			if (d.collapsed==c) {
-				tb.selectNode(d.getNode());
-				return;
-			}
-		}
-
-		collapsed.removeElement(c);
-		e1=gra2.getVertices();
-		while (e1.hasMoreElements()) {
-			Vertex vx=(Vertex)(e1.nextElement());
-			if (vx.getUp()==c) vx.setUp(null);
-			if (vx.getDown()==c) vx.setDown(null);
-		}
-
-		collapseNodes();
-		relayout();
-	}
-
-	public void relayout() {
-		Graphics g = getGraphics();
-		g.setFont(font);
-		browser.showWaitMessage();
-		highlighted=null;
-		gra.layout(g);
-		v=null;
-		parent_needs_layout = true;
-		update(g);
-		browser.showReadyMessage();
-	}
-
-	public void focusToVertex(int n) {
-		Vertex vx=gra.getVertexByNum(n);
-		if (vx!=null) {
-			ScrollPane scrollp = (ScrollPane)(getParent());
-			Dimension vpsize = scrollp.getViewportSize();
-
-                        int x = vx.getX()-gra.min_x;
-                        int y = vx.getY()-gra.min_y;
-			int offset_x = Math.min(scrollp.getHAdjustable().getMaximum(),
-				Math.max(0,x-vpsize.width/2));
-			int offset_y = Math.min(scrollp.getVAdjustable().getMaximum(),
-				Math.max(0,y-vpsize.height/2));
-
-			Graphics g=getGraphics();
-			g.setFont(font);
-			g.translate(-gra.min_x,-gra.min_y);
-			if (highlighted!=null) highlighted.drawBox(g,Color.lightGray);
-			vx.drawBox(g,Color.white);
-			highlighted=vx;
-			scrollp.setScrollPosition(offset_x, offset_y);
-		}
-	}
-
-	/*****************************************************************/
-	/*             Create new graph with collapsed nodes             */
-	/*****************************************************************/
-
-	public void collapseNodes() {
-		Enumeration e1=collapsed.elements();
-		gra=(Graph)(gra2.clone());
-
-		while (e1.hasMoreElements()) {
-			Vector v1=(Vector)(e1.nextElement());
-			Vector v2=gra.decode(v1);
-			if (!v2.isEmpty()) gra.collapse(v2,"[. . . .]",v1);
-		}
-
-		e1=collapsedDirs.elements();
-
-		while (e1.hasMoreElements()) {
-			Directory d=(Directory)(e1.nextElement());
-			Vector v=gra.decode(d.getCollapsed());
-			if (!v.isEmpty())
-				gra.collapse(v,"["+d.getName()+"]",d.getCollapsed());
-		}
-	}
-
-	public void mouseClicked(MouseEvent evt) {
-		Vector code = null;
-		Vertex v2;
-		int x = evt.getX() + gra.min_x;
-		int y = evt.getY() + gra.min_y;
-
-		if (v!=null) {
-			int num=v.getNumber();
-			v2=gra2.getVertexByNum(num);
-			if (v.leftButton(x,y)) {
-				if (v.getUp()!=null) {
-					code=v.getUp();
-					v2.setUp(null);
-					v=null;
-					uncollapse(code);
-					relayout();
-					focusToVertex(num);
-				} else {
-					Vector vs=v2.getPreds();
-					code=gra2.encode(vs);
-					v.setUp(code);v2.setUp(code);
-					v=null;
-					collapsed.insertElementAt(code,0);
-					collapseNodes();
-					relayout();
-					focusToVertex(num);
-				}
-			} else if (v.rightButton(x,y)) {
-				if (v.getDown()!=null) {
-					code=v.getDown();
-					v2.setDown(null);
-					v=null;
-					uncollapse(code);
-					relayout();
-					focusToVertex(num);
-				} else {
-					Vector vs=v2.getSuccs();
-					code=gra2.encode(vs);
-					v.setDown(code);v2.setDown(code);
-					v=null;
-					collapsed.insertElementAt(code,0);
-					collapseNodes();
-					relayout();
-					focusToVertex(num);
-				}
-			} else if (v.getInflate()!=null) {
-				inflateNode(v.getInflate());
-				v=null;
-			} else {
-				if (evt.getWhen()-timestamp < 400 && !(v.getPath().equals("")))
-					browser.viewFile(v.getPath());
-				timestamp=evt.getWhen();
-			}
-		}
-	}
-
-	public void mouseExited(MouseEvent evt) {
-		Graphics g=getGraphics();
-		g.setFont(font);
-		g.translate(-gra.min_x,-gra.min_y);
-		if (highlighted!=null) {
-			highlighted.drawBox(g,Color.lightGray);
-			highlighted=null;
-		}
-		if (v!=null) v.removeButtons(g);
-		v=null;
-	}
-
-	public void mouseEntered(MouseEvent evt) {}
-
-	public void mousePressed(MouseEvent evt) {}
-
-	public void mouseReleased(MouseEvent evt) {}
-}
--- a/lib/browser/GraphBrowser/NormalVertex.java	Wed Mar 31 16:01:31 2021 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,154 +0,0 @@
-/***************************************************************************
-  Title:      GraphBrowser/NormalVertex.java
-  Author:     Stefan Berghofer, TU Muenchen
-  Options:    :tabSize=4:
-
-  This class represents an ordinary vertex. It contains methods for
-  drawing and PostScript output.
-***************************************************************************/
-
-package GraphBrowser;
-
-import java.util.*;
-import java.awt.*;
-import java.io.*;
-
-class NormalVertex extends Vertex {
-	String label="",path="",dir="",ID="";
-	Vector up,down,inflate=null;
-
-	public Object clone() {
-		Vertex ve=new NormalVertex(label);
-                ve.setID(ID);
-		ve.setNumber(getNumber());
-		ve.setUp(getUp());ve.setDown(getDown());
-		ve.setX(getX());ve.setY(getY());
-		ve.setPath(getPath());
-		return ve;
-	}
-
-	/*** Constructor ***/
-
-	public NormalVertex(String s) { label=s; }
-
-	public void setInflate(Vector v) { inflate=v; }
-
-	public Vector getInflate() { return inflate; }
-
-	public Vector getUp() { return up; }
-
-	public void setUp(Vector v) { up=v; }
-
-	public Vector getDown() { return down; }
-
-	public void setDown(Vector v) { down=v; }
-
-	public String getLabel() {return label;}
-
-	public void setLabel(String s) {label=s;}
-
-	public void setID(String s) { ID=s; }
-
-        public String getID() { return ID; }
-
-	public String getPath() { return path;}
-
-	public void setPath(String p) { path=p; }
-
-	public String getDir() { return dir; }
-
-	public void setDir(String d) { dir=d; }
-
-	public int leftX() { return getX()-box_width2(); }
-
-	public int rightX() { return getX()+box_width2(); }
-
-	public void drawBox(Graphics g,Color boxColor) {
-		FontMetrics fm = g.getFontMetrics(g.getFont());
-		int h=fm.getAscent()+fm.getDescent();
-
-		g.setColor(boxColor);
-		g.fillRect(getX()-box_width2(),getY(),box_width(),gra.box_height);
-		g.setColor(Color.black);
-		g.drawRect(getX()-box_width2(),getY(),box_width(),gra.box_height);
-		if (getNumber()<0)
-			g.setColor(Color.red);
-
-		g.drawString(label,
-		             (int)Math.round((box_width()-fm.stringWidth(label))/2.0)+getX()-box_width2(),
-				fm.getAscent()+(int)Math.round((gra.box_height-h)/2.0)+getY());
-	}
-
-	public void removeButtons(Graphics g) {
-		drawBox(g,Color.lightGray);
-	}
-
-	public void draw(Graphics g) {
-		drawBox(g,Color.lightGray);
-		g.setColor(Color.black);
-		Enumeration e1=getChildren();
-		while (e1.hasMoreElements()) {
-			Vertex v=(Vertex)(e1.nextElement());
-			if (!v.isDummy())
-				g.drawLine(getX(),getY()+gra.box_height,v.getX(),v.getY());
-		}
-	}
-
-	public boolean contains(int x,int y) {
-		return (x>=leftX() && x<=rightX() && y>=getY() &&
-                        y<=getY()+gra.box_height);
-	}
-
-	public boolean leftButton(int x,int y) {
-		return contains(x,y) && x<=leftX()+gra.box_height && getParents().hasMoreElements() && getNumber()>=0;
-	}
-
-	public boolean rightButton(int x,int y) {
-		return contains(x,y) && x>=rightX()-gra.box_height && getChildren().hasMoreElements() && getNumber()>=0;
-	}
-
-	public void drawButtons(Graphics g) {
-		if (getNumber()<0) return;
-
-		int l=gra.box_height*2/3,d=gra.box_height/6;
-		int up_x[] = { leftX()+d , leftX()+d+l/2 , leftX()+d+l };
-		int up_y[] = { getY()+d+l , getY()+d , getY()+d+l };
-		int down_x[] = { rightX()-d-l , rightX()-d-l/2 , rightX()-d };
-		int down_y[] = { getY()+d , getY()+d+l , getY()+d };
-
-		if (getParents().hasMoreElements()) {
-			g.setColor(Color.gray);
-			g.fillRect(leftX()+1,getY()+1,gra.box_height-1,gra.box_height-1);
-			g.setColor(getUp()!=null ? Color.red : Color.green);
-			g.fillPolygon(up_x,up_y,3);
-		}
-		if (getChildren().hasMoreElements()) {
-			g.setColor(Color.gray);
-			g.fillRect(rightX()+1-gra.box_height,getY()+1,gra.box_height,gra.box_height-1);
-			g.setColor(getDown()!=null ? Color.red : Color.green);
-			g.fillPolygon(down_x,down_y,3);
-		}
-		g.setColor(Color.black);
-	}
-
-	public void PS(PrintWriter p) {
-		p.print(leftX()+" "+getY()+" "+box_width()+" "+
-		        gra.box_height+" (");
-		for (int i=0;i<label.length();i++)
-		{
-			if (("()\\").indexOf(label.charAt(i))>=0)
-				p.print("\\");
-			p.print(label.charAt(i));
-		}
-		p.println(") b");
-
-		Enumeration e1=getChildren();
-		while (e1.hasMoreElements()) {
-			Vertex v=(Vertex)(e1.nextElement());
-			if (!v.isDummy())
-				p.println("n "+getX()+" "+(getY()+gra.box_height)+
-				" m "+v.getX()+" "+v.getY()+" l s");
-		}
-	}	
-}
-		
--- a/lib/browser/GraphBrowser/ParseError.java	Wed Mar 31 16:01:31 2021 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,5 +0,0 @@
-package GraphBrowser;
-
-class ParseError extends Exception {
-	public ParseError(String s) { super(s); }
-}
--- a/lib/browser/GraphBrowser/Region.java	Wed Mar 31 16:01:31 2021 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,89 +0,0 @@
-/***************************************************************************
-  Title:      GraphBrowser/Region.java
-  Author:     Stefan Berghofer, TU Muenchen
-  Options:    :tabSize=4:
-
-  This is an auxiliary class which is used by the layout algorithm when
-  calculating coordinates with the "pendulum method". A "region" is a
-  group of nodes which "stick together".
-***************************************************************************/
-
-package GraphBrowser;
-
-import java.util.*;
-
-class Region {
-	Vector vertices=new Vector(10,10);
-	Graph gra;
-
-	public Region(Graph g) { gra=g; }
-
-	public void addVertex(Vertex v) {
-		vertices.addElement(v);
-	}
-
-	public Enumeration getVertices() {
-		return vertices.elements();
-	}
-
-	public int pred_deflection() {
-		float d1=0;
-		int n=0;
-		Enumeration e1=vertices.elements();
-		while (e1.hasMoreElements()) {
-			float d2=0;
-			int p=0;
-			n++;
-			Vertex v=(Vertex)(e1.nextElement());
-			Enumeration e2=v.getParents();
-			while (e2.hasMoreElements()) {
-				p++;
-				d2+=((Vertex)(e2.nextElement())).getX()-v.getX();
-			}
-			if (p>0) d1+=d2/p;
-		}
-		return (int)(Math.round(d1/n));
-	}
-
-	public int succ_deflection() {
-		float d1=0;
-		int n=0;
-		Enumeration e1=vertices.elements();
-		while (e1.hasMoreElements()) {
-			float d2=0;
-			int p=0;
-			n++;
-			Vertex v=(Vertex)(e1.nextElement());
-			Enumeration e2=v.getChildren();
-			while (e2.hasMoreElements()) {
-				p++;
-				d2+=((Vertex)(e2.nextElement())).getX()-v.getX();
-			}
-			if (p>0) d1+=d2/p;
-		}
-		return (int)(Math.round(d1/n));
-	}
-
-	public void move(int x) {
-		Enumeration e1=vertices.elements();
-		while (e1.hasMoreElements()) {
-			Vertex v=(Vertex)(e1.nextElement());
-			v.setX(v.getX()+x);
-		}
-	}
-
-	public void combine(Region r2) {
-		Enumeration e1=r2.getVertices();
-		while (e1.hasMoreElements()) addVertex((Vertex)(e1.nextElement()));
-	}
-
-	public int spaceBetween(Region r2) {
-		return ((Vertex)(r2.getVertices().nextElement())).leftX()-
-			((Vertex)(vertices.lastElement())).rightX()-
-			20;
-	}
-
-	public boolean touching(Region r2) {
-		return spaceBetween(r2)==0;
-	}
-}
--- a/lib/browser/GraphBrowser/Spline.java	Wed Mar 31 16:01:31 2021 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,120 +0,0 @@
-/***************************************************************************
-  Title:      GraphBrowser/Spline.java
-  Author:     Stefan Berghofer, TU Muenchen
-  Options:    :tabSize=4:
-
-  This class is used for drawing spline curves (which are not yet
-  supported by the Java AWT).
-***************************************************************************/
-
-package GraphBrowser;
-
-import java.awt.*;
-import java.util.*;
-import java.io.*;
-
-class SplineSection {
-
-	/*** Section of a spline function ***/
-
-	double x_b,x_c,x_d;
-	double y_b,y_c,y_d;
-	int dx,dy;
-
-	public SplineSection(double xb,double xc,double xd,
-		double yb,double yc,double yd,int dx2,int dy2) {
-		x_b=xb;x_c=xc;x_d=xd;
-		y_b=yb;y_c=yc;y_d=yd;
-		dx=dx2;dy=dy2;
-	}
-
-	public Point draw(Graphics g,Point s) {
-		double m;
-		int s_x,s_y,e_x=0,e_y=0;
-		int x,y;
-
-		s_x=s.x;s_y=s.y;
-		if (dx>=dy) {
-			if (dx==0) return s;
-			m=1/((double)dx);
-			for (x=0;x<dx;x++) {
-				e_x=(int)(Math.round((x_b*x*m+x_c)*x*m+x_d));
-				e_y=(int)(Math.round((y_b*x*m+y_c)*x*m+y_d));
-				g.drawLine(s_x,s_y,e_x,e_y);
-				s_x=e_x;s_y=e_y;
-			}
-		} else {
-			m=1/((double)dy);
-			for (y=0;y<dy;y++) {
-				e_x=(int)(Math.round((x_b*y*m+x_c)*y*m+x_d));
-				e_y=(int)(Math.round((y_b*y*m+y_c)*y*m+y_d));
-				g.drawLine(s_x,s_y,e_x,e_y);
-				s_x=e_x;s_y=e_y;
-			}
-		}
-		return new Point(e_x,e_y);
-	}
-}
-
-public class Spline {
-
-	Vector sections;
-	Vector points;
-	Point start,end;
-
-	public Spline(Vector pts) {
-		int i;
-		double d0,d1,d2,d3;
-		Point p0,p1,p2;
-		SplineSection s;
-		
-		start=(Point)(pts.firstElement());
-		end=(Point)(pts.lastElement());
-
-		sections=new Vector(10,10);
-		for (i=1;i<=pts.size()-4;i+=3) {
-			p0=(Point)(pts.elementAt(i));
-			p1=(Point)(pts.elementAt(i+1));
-			p2=(Point)(pts.elementAt(i+2));
-			s=new SplineSection(
-				(double)(p2.x-2*p1.x+p0.x),
-				2.0*(p1.x-p0.x),
-				(double)(p0.x),
-
-				(double)(p2.y-2*p1.y+p0.y),
-				2.0*(p1.y-p0.y),
-				(double)(p0.y),
-
-				Math.abs(p2.x-p0.x),
-				Math.abs(p2.y-p0.y)
-			);
-
-			sections.addElement(s);
-		}
-		points=pts;
-	}
-
-	public void draw(Graphics g) {
-		Enumeration e1=sections.elements();
-		Point p=start;
-
-		while (e1.hasMoreElements())
-			p=((SplineSection)(e1.nextElement())).draw(g,p);
-		g.drawLine(p.x,p.y,end.x,end.y);
-	}
-
-	public void PS(PrintWriter p) {
-		Point p0,p1,p2;
-		int i;
-
-		p.println("n "+start.x+" "+start.y+" m");
-		for (i=1;i<=points.size()-4;i+=3) {
-			p0=(Point)(points.elementAt(i));
-			p1=(Point)(points.elementAt(i+1));
-			p2=(Point)(points.elementAt(i+2));
-			p.println(p0.x+" "+p0.y+" l");
-			p.println(p0.x+" "+p0.y+" "+p1.x+" "+p1.y+" "+p2.x+" "+p2.y+" c");
-		}
-		p.println(end.x+" "+end.y+" l s");
-	}
-}
--- a/lib/browser/GraphBrowser/TreeBrowser.java	Wed Mar 31 16:01:31 2021 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,94 +0,0 @@
-/***************************************************************************
-  Title:      GraphBrowser/TreeBrowser.java
-  Author:     Stefan Berghofer, TU Muenchen
-  Options:    :tabSize=4:
-
-  This class defines the browser window which is used to display directory
-  trees. It contains methods for handling events.
-***************************************************************************/
-
-package GraphBrowser;
-
-import java.awt.*;
-import java.awt.event.*;
-import java.util.*;
-
-
-public class TreeBrowser extends Canvas implements MouseListener
-{
-	TreeNode t;
-	TreeNode selected;
-	GraphView gv;
-	long timestamp;
-	Dimension size;
-	boolean parent_needs_layout;
-	Font font;
-
-	public TreeBrowser(TreeNode tn, GraphView gr, Font f) {
-		t = tn; gv = gr; font = f;
-		size = new Dimension(0, 0);
-		parent_needs_layout = true;
-		addMouseListener(this);
-	}
-
-	public Dimension getPreferredSize() {
-		return size;
-	}
-
-	public void mouseEntered(MouseEvent evt) {}
-
-	public void mouseExited(MouseEvent evt) {}
-
-	public void mouseReleased(MouseEvent evt) {}
-
-	public void mousePressed(MouseEvent evt) {}
-
-	public void mouseClicked(MouseEvent e)
-	{
-		TreeNode l=t.lookup(e.getY());
-
-		if (l!=null)
-		{
-			if (l.select()) {
-				Vector v=new Vector(10,10);
-				t.collapsedDirectories(v);
-				gv.collapseDir(v);
-				gv.relayout();
-			} else {
-				Vertex vx=gv.getGraph().getVertexByNum(l.getNumber());
-				gv.focusToVertex(l.getNumber());
-				vx=gv.getOriginalGraph().getVertexByNum(l.getNumber());
-				if (e.getWhen()-timestamp < 400 && !(vx.getPath().equals("")))
-					gv.getBrowser().viewFile(vx.getPath());
-				timestamp=e.getWhen();
-
-			}
-			selected=l;
-			parent_needs_layout = true;
-			repaint();
-		}
-	}
-
-	public void selectNode(TreeNode nd) {
-		Vector v=new Vector(10,10);
-		nd.select();
-		t.collapsedDirectories(v);
-		gv.collapseDir(v);
-		gv.relayout();
-		selected=nd;
-		parent_needs_layout = true;
-		repaint();
-	}
-
-	public void paint(Graphics g)
-	{
-		g.setFont(font);
-		Dimension d = t.draw(g,5,5,selected);
-		if (parent_needs_layout) {
-			size = new Dimension(5+d.width, 5+d.height);
-			parent_needs_layout = false;
-			getParent().doLayout();
-		}
-	}
-}
-
--- a/lib/browser/GraphBrowser/TreeNode.java	Wed Mar 31 16:01:31 2021 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,168 +0,0 @@
-/***************************************************************************
-  Title:      GraphBrowser/TreeNode.java
-  Author:     Stefan Berghofer, TU Muenchen
-  Options:    :tabSize=4:
-
-  This class contains methods for storing and manipulating directory
-  trees (e.g. collapsing / uncollapsing directory branches).
-***************************************************************************/
-
-package GraphBrowser;
-
-import java.awt.*;
-import java.util.*;
-
-
-public class TreeNode
-{
-	int starty,endy,number;
-	String name,path;
-
-	Vector leaves=new Vector(10,10);
-	boolean unfold=false;
-
-	public void insertNode(String n,String d,String p,int num,boolean u) {
-		if (d.length()==0) {
-			leaves.addElement(new TreeNode(n,p,num));
-			unfold=unfold||u;
-		} else {
-			unfold=unfold||u;
-			String str1,str2;
-			if (d.indexOf('/')<0) {
-				str1=d;str2="";
-			} else {
-				str1=d.substring(0,d.indexOf('/'));
-				str2=d.substring(d.indexOf('/')+1);
-			}
-
-			Enumeration e1=leaves.elements();
-			TreeNode nd=null;
-
-			while (e1.hasMoreElements()) {
-				TreeNode nd2=(TreeNode)(e1.nextElement());
-				if (nd2.name.equals(str1)) {
-					nd=nd2;break;
-				}
-			}
-			if (nd==null) {
-				nd=new TreeNode(str1,"",-1);
-				leaves.addElement(nd);
-			}
-			nd.insertNode(n,str2,p,num,u);
-		}
-	}
-
-	public TreeNode(String n,String p,int num) {
-		name=n;
-		path=p;
-		number=num;
-	}
-
-	public TreeNode(String n,String p,int num,boolean u) {
-		this(n,p,num);
-		unfold=u;
-	}	
-
-	public int getNumber() { return number; }
-
-	public TreeNode lookup(int y)
-	{
-		if (y>=starty && y<endy) return this;
-		else
-		if (unfold)
-			for (int i=0;i<leaves.size();i++)
-			{
-				TreeNode t=((TreeNode)leaves.elementAt(i)).lookup(y);
-				if (t!=null) return t;
-			}
-		return null;
-	}
-
-	public boolean select()
-	{
-		if (!leaves.isEmpty()) {
-			if (unfold) collapse();
-			else unfold=true;
-			return true;
-		}
-		return false; 
-	}
-
-	public void collapse()
-	{
-		unfold=false;
-		/*
-		for(int i=0;i<leaves.size();i++)
-			((Tree)leaves.elementAt(i)).collapse();
-		*/
-	}
-
-	void collapsedNodes(Vector v) {
-		if (number>=0) v.addElement(new Integer(number));
-		Enumeration e1=leaves.elements();
-		while (e1.hasMoreElements())
-			((TreeNode)(e1.nextElement())).collapsedNodes(v);
-	}
-
-	public void collapsedDirectories(Vector v) {
-		if (!unfold) {
-			Vector v2=new Vector(10,10);
-			v.addElement(new Directory(this,name,v2));
-			collapsedNodes(v2);
-		} else {
-			Enumeration e1=leaves.elements();
-			while (e1.hasMoreElements()) {
-				TreeNode tn=(TreeNode)(e1.nextElement());
-				if (!tn.leaves.isEmpty())
-					tn.collapsedDirectories(v);
-			}
-		}
-	}
-
-	public Dimension draw(Graphics g,int x,int y,TreeNode t)
-	{
-		FontMetrics fm=g.getFontMetrics(g.getFont());
-		int h=fm.getHeight();
-		int e=(int) (h / 10) + 1;
-		int down_x[]={x + e, x + h - e, x + (int)(h / 2)};
-		int down_y[]={y + e, y + e, y + (int)(3 * h / 4) - e};
-		int right_x[]={x + e, x + (int)(3 * h / 4) - e, x + e};
-		int right_y[]={y + e, y + (int)(h / 2), y + h - e};
-		int dx=0;
-
-		if (unfold)
-		{
-			g.setColor(Color.green);
-			g.fillPolygon(down_x,down_y,3);
-			g.setColor(Color.black);
-			g.drawString(name,x+h+4,y+fm.getAscent());
-			starty=y;endy=y+h;
-			dx=Math.max(dx,x+h+4+fm.stringWidth(name));
-			y+=h+5;
-			for(int i=0;i<leaves.size();i++)
-			{
-				Dimension d=((TreeNode)leaves.elementAt(i)).draw(g,x+h+4,y,t);
-				y=d.height;
-				dx=Math.max(dx,d.width);
-			}
-		}
-		else
-		{
-			g.setColor(leaves.isEmpty() ? Color.blue : Color.red);
-			g.fillPolygon(right_x,right_y,3);
-			if (this==t && leaves.isEmpty())
-			{
-				g.setColor(Color.white);
-				g.fillRect(x+h+4,y,fm.stringWidth(name),h);
-			}
-			g.setColor(Color.black);
-			g.drawString(name,x+h+4,y+fm.getAscent());
-			starty=y;endy=y+h;
-			dx=Math.max(dx,x+h+4+fm.stringWidth(name));
-			y+=h+5;
-		}
-		return new Dimension(dx,y);
-	}
-}
-
-
--- a/lib/browser/GraphBrowser/Vertex.java	Wed Mar 31 16:01:31 2021 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,213 +0,0 @@
-/***************************************************************************
-  Title:      GraphBrowser/Vertex.java
-  Author:     Stefan Berghofer, TU Muenchen
-  Options:    :tabSize=4:
-
-  This class contains attributes and methods common to all kinds of
-  vertices (e.g. coordinates, successors, predecessors).
-***************************************************************************/
-
-package GraphBrowser;
-
-import java.util.*;
-import java.awt.*;
-import java.io.*;
-
-abstract class Vertex {
-	Vector children=new Vector(10,10);
-	Vector parents=new Vector(10,10);
-	int degree=0;
-	int number=-1;
-	double weight=0;
-	int x,y;
-	Graph gra;
-
-	public abstract Object clone();
-
-	public void setGraph(Graph g) { gra=g; }
-
-	public int countChildren() { return children.size(); }
-
-	/** getInflate returns a vector of vertices which get **/
-	/** inflated again if the user clicks on this vertex  **/
-
-	public void setInflate(Vector v) {}
-
-	public Vector getInflate() { return null; }
-
-	/** getUp returns a vector of vertices which get inflated   **/
-	/** again, if the user clicks on this vertex's upward arrow **/
-
-	public Vector getUp() { return null; }
-
-	public void setUp(Vector v) {}
-
-	/** getUp returns a vector of vertices which get inflated     **/
-	/** again, if the user clicks on this vertex's downward arrow **/
-
-	public Vector getDown() { return null; }
-
-	public void setDown(Vector v) {}
-
-	/** internal number, for decoding / encoding etc. **/
-
-	public int getNumber() { return number; }
-
-	public void setNumber(int n) { number=n; }
-
-	public String getLabel() {return "";}
-
-	public void setLabel(String s) {}
-
-	/** unique identifier **/
-
-	public String getID() {return "";}
-
-	public void setID(String s) {}
-
-	public Box getLabelSize(Graphics g) {
-		AbstractFontMetrics fm = g == null ? 
-      (AbstractFontMetrics) new DefaultFontMetrics(12) : 
-      (AbstractFontMetrics) new AWTFontMetrics(g.getFontMetrics(g.getFont()));
-		
-		return new Box(Math.max(fm.stringWidth("[. . . .]"),
-                            fm.stringWidth(getLabel())),
-                   fm.getAscent()+fm.getDescent());
-	}
-		
-	public String getPath() { return "";}
-
-	public void setPath(String p) {}
-
-	public String getDir() { return ""; }
-
-	public void setDir(String d) {}
-
-	public void setWeight(double w) {weight=w;}
-
-	public double getWeight() {return weight;}
-
-	public void setDegree(int d) { degree=d; }
-
-	public int getDegree() { return degree; }
-
-	public boolean isDummy() { return false; }
-
-	public Enumeration getChildren() {
-		return ((Vector)(children.clone())).elements();
-	}
-
-	public void addChild(Vertex v) {
-		children.addElement(v);
-		v.parents.addElement(this);
-	}
-
-	public void removeChild(Vertex v) {
-		children.removeElement(v);
-		v.parents.removeElement(this);
-	}
-
-	public boolean isChild(Vertex v) {
-		return children.indexOf(v)>=0;
-	}
-
-	public boolean isParent(Vertex v) {
-		return parents.indexOf(v)>=0;
-	}
-
-	public Enumeration getParents() {
-		return ((Vector)(parents.clone())).elements();
-	}
-
-	public void addParent(Vertex v) {
-		parents.addElement(v);
-		v.children.addElement(this);
-	}
-
-	public void removeParent(Vertex v) {
-		parents.removeElement(v);
-		v.children.removeElement(this);
-	}
-
-	/********************************************************************/
-	/*                   get all predecessor vertices                   */
-	/********************************************************************/
-
-	public Vector getPreds() {
-	    Vector preds=new Vector(10,10);
-	    Vector todo=(Vector)(parents.clone());
-	    Vertex vx1,vx2;
-	    Enumeration e;
-
-	    while (!todo.isEmpty()) {
-		vx1=(Vertex)(todo.lastElement());
-		todo.removeElementAt(todo.size()-1);
-		preds.addElement(vx1);
-		e=vx1.parents.elements();
-		while (e.hasMoreElements()) {
-		    vx2=(Vertex)(e.nextElement());
-		    if (preds.indexOf(vx2)<0 && todo.indexOf(vx2)<0)
-			todo.addElement(vx2);
-		}
-	    }
-
-	    return preds;
-	}
-
-	/********************************************************************/
-	/*                     get all successor vertices                   */
-	/********************************************************************/
-
-	public Vector getSuccs() {
-	    Vector succs=new Vector(10,10);
-	    Vector todo=(Vector)(children.clone());
-	    Vertex vx1,vx2;
-	    Enumeration e;
-
-	    while (!todo.isEmpty()) {
-		vx1=(Vertex)(todo.lastElement());
-		todo.removeElementAt(todo.size()-1);
-		succs.addElement(vx1);
-		e=vx1.children.elements();
-		while (e.hasMoreElements()) {
-		    vx2=(Vertex)(e.nextElement());
-		    if (succs.indexOf(vx2)<0 && todo.indexOf(vx2)<0)
-			todo.addElement(vx2);
-		}
-	    }
-
-	    return succs;
-	}
-
-	public int box_width() { return getLabelSize(gra.gfx).width+8; }
-
-	public int box_width2() { return box_width()/2; }
-
-	public void setX(int x) {this.x=x;}
-
-	public void setY(int y) {this.y=y;}
-
-	public int getX() {return x;}
-
-	public int getY() {return y;}
-
-	public abstract int leftX();
-
-	public abstract int rightX();
-
-	public abstract void draw(Graphics g);
-
-	public void drawButtons(Graphics g) {}
-
-	public void drawBox(Graphics g,Color boxColor) {}
-
-	public void removeButtons(Graphics g) {}
-
-	public boolean contains(int x,int y) { return false; }
-
-	public boolean leftButton(int x,int y) { return false; }
-
-	public boolean rightButton(int x,int y) { return false; }
-
-	public void PS(PrintWriter p) {}
-}
--- a/lib/browser/awtUtilities/Border.java	Wed Mar 31 16:01:31 2021 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,39 +0,0 @@
-/***************************************************************************
-  Title:      awtUtilities/Border.java
-  Author:     Stefan Berghofer, TU Muenchen
-
-  This class defines a nice 3D border.
-***************************************************************************/
-
-package awtUtilities;
-
-import java.awt.*;
-
-public class Border extends Panel {
-	int bs;
-
-	public Insets getInsets() {
-		return new Insets(bs*3/2,bs*3/2,bs*3/2,bs*3/2);
-	}
-
-	public Border(Component comp,int s) {
-		setLayout(new GridLayout(1,1));
-		add(comp);
-		bs=s;
-	}
-
-	public void paint(Graphics g) {
-		int w = getSize().width;
-		int h = getSize().height;
-		int x1[]={0,bs,w-bs,w}, y1[]={0,bs,bs,0};
-		int x2[]={w,w-bs,w-bs,w}, y2[]={0,bs,h-bs,h};
-		int y3[]={h,h-bs,h-bs,h};
-
-		g.setColor(new Color(224,224,224));
-		g.fillPolygon(y1,y2,4);
-		g.fillPolygon(x1,y1,4);
-		g.setColor(Color.gray);
-		g.fillPolygon(x2,y2,4);
-		g.fillPolygon(x1,y3,4);
-	}
-}
--- a/lib/browser/awtUtilities/MessageDialog.java	Wed Mar 31 16:01:31 2021 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,53 +0,0 @@
-/***************************************************************************
-  Title:      awtUtilities/MessageDialog.java
-  Author:     Stefan Berghofer, TU Muenchen
-
-  This class defines a dialog window for displaying messages and buttons.
-***************************************************************************/
-
-package awtUtilities;
-
-import java.awt.*;
-import java.awt.event.*;
-
-public class MessageDialog extends Dialog implements ActionListener {
-	String txt;
-
-	public String getText() { return txt; }
-
-	public void actionPerformed(ActionEvent evt) {
-		txt = evt.getActionCommand();
-		setVisible(false);
-	}
-
-	public MessageDialog(Frame parent,String title,String text,String []buttons) {
-		super(parent,title,true);
-		int i;
-		Panel p1=new Panel(),p2=new Panel();
-		p1.setLayout(new FlowLayout(FlowLayout.CENTER,0,0));
-		p2.setLayout(new FlowLayout());
-		setFont(new Font("Helvetica", Font.PLAIN, 14));
-		setLayout(new GridLayout(2,1));
-
-		while (true) {
-			int pos=text.indexOf(' ');
-			if (pos<0) {
-				p1.add(new Label(text));
-				break;
-			} else {
-				p1.add(new Label(text.substring(0,pos)));
-				if (pos+1==text.length())
-					break;
-				else
-					text=text.substring(pos+1);
-			}
-		}
-
-		add(p1);add(p2);
-		for (i=0;i<buttons.length;i++) {
-			Button bt = new Button(buttons[i]);
-			p2.add(bt);
-			bt.addActionListener(this);
-		}
-	}
-}
--- a/lib/browser/awtUtilities/TextFrame.java	Wed Mar 31 16:01:31 2021 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,27 +0,0 @@
-/***************************************************************************
-  Title:      Graph/TextFrame.java
-  Author:     Stefan Berghofer, TU Muenchen
-
-  This class defines a simple text viewer.
-***************************************************************************/
-
-package awtUtilities;
-
-import java.awt.*;
-import java.awt.event.*;
-
-public class TextFrame extends Frame implements ActionListener {
-	public void actionPerformed(ActionEvent evt) {
-		setVisible(false);
-	}
-
-	public TextFrame(String title,String text) {
-		super(title);
-		TextArea ta = new TextArea(text,200,80);
-		Button bt = new Button("Dismiss");
-		bt.addActionListener(this);
-		ta.setEditable(false);
-		add("Center", ta);
-		add("South", bt);
-	}
-}
--- a/lib/browser/build	Wed Mar 31 16:01:31 2021 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,72 +0,0 @@
-#!/usr/bin/env bash
-#
-# Author: Makarius
-#
-# mk - build graph browser
-#
-# Requires proper Isabelle settings environment.
-
-
-## diagnostics
-
-function fail()
-{
-  echo "$1" >&2
-  exit 2
-}
-
-[ -n "$ISABELLE_HOME" ] || fail "Missing Isabelle settings environment"
-
-
-## dependencies
-
-declare -a SOURCES=(
-  GraphBrowser/AWTFontMetrics.java
-  GraphBrowser/AbstractFontMetrics.java
-  GraphBrowser/Box.java
-  GraphBrowser/Console.java
-  GraphBrowser/DefaultFontMetrics.java
-  GraphBrowser/Directory.java
-  GraphBrowser/DummyVertex.java
-  GraphBrowser/Graph.java
-  GraphBrowser/GraphBrowser.java
-  GraphBrowser/GraphBrowserFrame.java
-  GraphBrowser/GraphView.java
-  GraphBrowser/NormalVertex.java
-  GraphBrowser/ParseError.java
-  GraphBrowser/Region.java
-  GraphBrowser/Spline.java
-  GraphBrowser/TreeBrowser.java
-  GraphBrowser/TreeNode.java
-  GraphBrowser/Vertex.java
-  awtUtilities/Border.java
-  awtUtilities/MessageDialog.java
-  awtUtilities/TextFrame.java
-)
-
-TARGET="$ISABELLE_HOME/lib/browser/GraphBrowser.jar"
-
-
-## main
-
-OUTDATED=false
-
-for SOURCE in "${SOURCES[@]}"
-do
-  [ ! -e "$SOURCE" ] && fail "Missing source file: $SOURCE"
-  [ ! -e "$TARGET" -o "$SOURCE" -nt "$TARGET" ] && OUTDATED=true
-done
-
-if [ "$OUTDATED" = true ]
-then
-  echo >&2 "### Building graph browser ..."
-
-  rm -rf classes && mkdir classes
-
-  isabelle_jdk javac -d classes -source 7 "${SOURCES[@]}" || \
-    fail "Failed to compile sources"
-  isabelle_jdk jar cf "$(platform_path "$TARGET")" -C classes . ||
-    fail "Failed to produce $TARGET"
-
-  rm -rf classes
-fi
--- a/lib/html/library_index_content.template	Wed Mar 31 16:01:31 2021 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,54 +0,0 @@
-  <ul>
-    <li>Higher-Order Logic</li>
-
-    <li style="list-style: none">
-      <ul>
-        <li><a href="HOL/index.html">HOL (Higher-Order Logic)</a>
-        is a version of classical higher-order logic resembling
-        that of the <a href="http://www.cl.cam.ac.uk/Research/HVG/HOL/">HOL System</a>.
-        </li>
-      </ul>
-    </li>
-  </ul>
-
-  <ul>
-    <li>First-Order Logic</li>
-
-    <li style="list-style: none">
-      <ul>
-        <li><a href="FOL/index.html">FOL (Many-sorted First-Order Logic)</a>
-        provides basic classical and intuitionistic first-order logic. It is
-        polymorphic.
-        </li>
-
-        <li><a href="ZF/index.html">ZF (Set Theory)</a>
-        offers a formulation of Zermelo-Fraenkel set theory on top of FOL.
-        </li>
-
-        <li><a href="CCL/index.html">CCL (Classical Computational Logic)</a></li>
-
-        <li><a href="LCF/index.html">LCF (Logic of Computable Functions)</a></li>
-
-        <li><a href="FOLP/index.html">FOLP (FOL with Proof Terms)</a></li>
-      </ul>
-    </li>
-  </ul>
-
-  <ul>
-    <li>Miscellaneous</li>
-
-    <li style="list-style: none">
-      <ul>
-        <li><a href="Sequents/index.html">Sequents (first-order, modal and linear logics)</a></li>
-
-        <li><a href="CTT/index.html">CTT (Constructive Type Theory)</a>
-        is an extensional version of Martin-L&ouml;f's Type Theory.</li>
-
-        <li><a href="Cube/index.html">Cube (The Lambda Cube)</a></li>
-
-        <li><a href="Pure/index.html">The Pure logical framework</a></li>
-
-        <li><a href="Doc/index.html">Sources of Documentation</a></li>
-      </ul>
-    </li>
-  </ul>
--- a/lib/html/library_index_footer.template	Wed Mar 31 16:01:31 2021 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,2 +0,0 @@
-</body>
-</html>
--- a/lib/html/library_index_header.template	Wed Mar 31 16:01:31 2021 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,27 +0,0 @@
-<?xml version="1.0" encoding="iso-8859-1"?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
-    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-
-<html xmlns="http://www.w3.org/1999/xhtml">
-<head>
-  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
-  <title>The {ISABELLE} Library</title>
-</head>
-
-<body text="#000000" bgcolor="#FFFFFF" link="#0000FF" vlink="#000099" alink="#404040">
-  <center>
-    <table width="100%" border="0" cellspacing="10" cellpadding="0">
-      <tr>
-        <td width="20%" valign="middle" align="center"><a href="http://isabelle.in.tum.de/"><img align="bottom" src="isabelle.gif" width="100" height="86" alt="[Isabelle]" border="0" /></a></td>
-
-        <td width="80%" valign="middle" align="center">
-          <table width="90%" border="0" cellspacing="0" cellpadding="20">
-            <tr>
-              <td valign="middle" align="center" bgcolor="#AACCCC"><font face="Helvetica,Arial" size="+2">The {ISABELLE} Library</font></td>
-            </tr>
-          </table>
-        </td>
-      </tr>
-    </table>
-  </center>
-  <hr />
--- a/lib/scripts/getfunctions	Wed Mar 31 16:01:31 2021 +0200
+++ b/lib/scripts/getfunctions	Mon Sep 06 12:08:20 2021 +0200
@@ -6,6 +6,8 @@
 # non-interactive bash processess. NB: bash shell functions are not portable
 # and may be dropped by aggressively POSIX-conformant versions of /bin/sh.
 
+unset CDPATH
+
 if type splitarray >/dev/null 2>/dev/null
 then
   :
@@ -21,15 +23,14 @@
 export -f platform_path standard_path
 
 #GNU tar (notably on macOS)
-if type -p gnutar >/dev/null
-then
-  function tar() { gnutar "$@"; }
-  export -f tar
-elif type -p gtar >/dev/null
-then
-  function tar() { gtar "$@"; }
-  export -f tar
-fi
+function tar() {
+  if [ -f "$ISABELLE_TAR" ]; then
+    "$ISABELLE_TAR" "$@"
+  else
+    "$(type -P tar)" "$@"
+  fi
+}
+export -f tar
 
 #OCaml management via OPAM
 function isabelle_opam ()
@@ -105,7 +106,7 @@
   do
     if [ -z "$ISABELLE_CLASSPATH" ]; then
       ISABELLE_CLASSPATH="$X"
-    else
+    elif [ -n "$X" ]; then
       ISABELLE_CLASSPATH="$ISABELLE_CLASSPATH:$X"
     fi
   done
@@ -210,17 +211,6 @@
 }
 export -f isabelle_directory
 
-#administrative build
-if [ -e "$ISABELLE_HOME/Admin/build" ]; then
-  function isabelle_admin_build ()
-  {
-    "$ISABELLE_HOME/Admin/build" "$@"
-  }
-else
-  function isabelle_admin_build () { return 0; }
-fi
-export -f isabelle_admin_build
-
 #arrays
 function splitarray ()
 {
--- a/lib/scripts/getsettings	Wed Mar 31 16:01:31 2021 +0200
+++ b/lib/scripts/getsettings	Mon Sep 06 12:08:20 2021 +0200
@@ -71,9 +71,12 @@
   exit 2
 fi
 
-#Isabelle distribution identifier -- filled in automatically!
-ISABELLE_ID=""
-[ -z "$ISABELLE_IDENTIFIER" ] && ISABELLE_IDENTIFIER=""
+if [ -z "$ISABELLE_IDENTIFIER" -a -f "$ISABELLE_HOME/etc/ISABELLE_IDENTIFIER" ]
+then
+  ISABELLE_IDENTIFIER="$(cat "$ISABELLE_HOME/etc/ISABELLE_IDENTIFIER")"
+fi
+
+ISABELLE_NAME="${ISABELLE_IDENTIFIER:-Isabelle}"
 
 
 # components
@@ -126,6 +129,10 @@
   export JAVA_HOME="$ISABELLE_JDK_HOME"
 fi
 
+if [ -e "$ISABELLE_SETUP_JAR" ]; then
+  ISABELLE_SETUP_CLASSPATH="$(isabelle_java java -jar "$(platform_path "$ISABELLE_SETUP_JAR")" classpath)"
+fi
+
 set +o allexport
 
 fi
--- a/lib/scripts/isabelle-platform	Wed Mar 31 16:01:31 2021 +0200
+++ b/lib/scripts/isabelle-platform	Mon Sep 06 12:08:20 2021 +0200
@@ -4,7 +4,6 @@
 #
 
 ISABELLE_PLATFORM_FAMILY=""
-ISABELLE_PLATFORM32=""
 ISABELLE_PLATFORM64=""
 ISABELLE_APPLE_PLATFORM64=""
 ISABELLE_WINDOWS_PLATFORM32=""
@@ -17,11 +16,7 @@
       aarch64)
         ISABELLE_PLATFORM64=arm64-linux
         ;;
-      arm*)
-        ISABELLE_PLATFORM32=arm32-linux
-        ;;
       *)
-        ISABELLE_PLATFORM32=x86-linux
         ISABELLE_PLATFORM64=x86_64-linux
         ;;
     esac
@@ -30,7 +25,6 @@
     ISABELLE_PLATFORM_FAMILY="macos"
     case $(sw_vers -productVersion) in
       10.10*|10.11*|10.12*|10.13*|10.14*)
-        ISABELLE_PLATFORM32=x86-darwin
         ISABELLE_PLATFORM64=x86_64-darwin
         ;;
       *)
@@ -53,9 +47,6 @@
       x86_64)
         ISABELLE_PLATFORM64=x86_64-cygwin
         ;;
-      i?86)
-        ISABELLE_PLATFORM32=x86-cygwin
-        ;;
     esac
     ;;
 esac
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lib/services/java.nio.charset.spi.CharsetProvider	Mon Sep 06 12:08:20 2021 +0200
@@ -0,0 +1,1 @@
+isabelle.Isabelle_Charset_Provider
--- a/lib/texinputs/isabelle.sty	Wed Mar 31 16:01:31 2021 +0200
+++ b/lib/texinputs/isabelle.sty	Mon Sep 06 12:08:20 2021 +0200
@@ -173,6 +173,12 @@
 \newcommand{\isamarkupcmt}[1]{{\isastylecmt--- #1}}
 
 
+% index entries
+
+\newcommand{\isaindexdef}[1]{\textbf{#1}}
+\newcommand{\isaindexref}[1]{#1}
+
+
 % styles
 
 \def\isabellestyle#1{\csname isabellestyle#1\endcsname}
--- a/lib/texinputs/isabellesym.sty	Wed Mar 31 16:01:31 2021 +0200
+++ b/lib/texinputs/isabellesym.sty	Mon Sep 06 12:08:20 2021 +0200
@@ -234,8 +234,8 @@
 \newcommand{\isasymrbrace}{\isamath{\mathclose{\mid\mkern-4.3mu\rbrace}}}
 \newcommand{\isasymlblot}{\isamath{{\langle}\mkern -3.5mu{|}}}
 \newcommand{\isasymrblot}{\isamath{{|}\mkern -3.5mu{\rangle}}}
-\newcommand{\isasymguillemotleft}{\isatext{\flqq}}  %requires babel
-\newcommand{\isasymguillemotright}{\isatext{\frqq}}  %requires babel
+\newcommand{\isasymguillemotleft}{\isatext{\guillemotleft}}
+\newcommand{\isasymguillemotright}{\isatext{\guillemotright}}
 \newcommand{\isasymbottom}{\isamath{\bot}}
 \newcommand{\isasymtop}{\isamath{\top}}
 \newcommand{\isasymand}{\isamath{\wedge}}
@@ -424,6 +424,8 @@
 \newcommand{\isasymcheckmark}{\isatext{\ding{51}}}  %requires pifont
 \newcommand{\isasymcrossmark}{\isatext{\ding{55}}}  %requires pifont
 \newcommand{\isactrlmarker}{\isatext{\ding{48}}}  %requires pifont
+\newcommand{\isactrltry}{\isakeywordcontrol{try}}
+\newcommand{\isactrlcan}{\isakeywordcontrol{can}}
 \newcommand{\isactrlassert}{\isakeywordcontrol{assert}}
 \newcommand{\isactrlcancel}{\isakeywordcontrol{cancel}}
 \newcommand{\isactrlbinding}{\isakeywordcontrol{binding}}
@@ -477,3 +479,7 @@
 \newcommand{\isactrlcomputation}{\isakeywordcontrol{computation}}
 \newcommand{\isactrlcomputationUNDERSCOREconv}{\isakeywordcontrol{computation{\isacharunderscore}conv}}
 \newcommand{\isactrlcomputationUNDERSCOREcheck}{\isakeywordcontrol{computation{\isacharunderscore}check}}
+\newcommand{\isactrlifUNDERSCORElinux}{\isakeywordcontrol{if{\isacharunderscore}linux}}
+\newcommand{\isactrlifUNDERSCOREmacos}{\isakeywordcontrol{if{\isacharunderscore}macos}}
+\newcommand{\isactrlifUNDERSCOREwindows}{\isakeywordcontrol{if{\isacharunderscore}windows}}
+\newcommand{\isactrlifUNDERSCOREunix}{\isakeywordcontrol{if{\isacharunderscore}unix}}
--- a/src/Doc/Classes/document/build	Wed Mar 31 16:01:31 2021 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,10 +0,0 @@
-#!/usr/bin/env bash
-
-set -e
-
-FORMAT="$1"
-VARIANT="$2"
-
-isabelle logo Isar
-"$ISABELLE_HOME/src/Doc/prepare_document" "$FORMAT"
-
--- a/src/Doc/Classes/document/root.tex	Wed Mar 31 16:01:31 2021 +0200
+++ b/src/Doc/Classes/document/root.tex	Mon Sep 06 12:08:20 2021 +0200
@@ -10,7 +10,7 @@
 \hyphenation{Isar}
 \isadroptag{theory}
 
-\title{\includegraphics[scale=0.5]{isabelle_isar}
+\title{\includegraphics[scale=0.5]{isabelle_logo}
   \\[4ex] Haskell-style type classes with Isabelle/Isar}
 \author{\emph{Florian Haftmann}}
 
--- a/src/Doc/Codegen/document/build	Wed Mar 31 16:01:31 2021 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,15 +0,0 @@
-#!/usr/bin/env bash
-
-set -e
-
-FORMAT="$1"
-VARIANT="$2"
-
-# ad-hoc patching of temporary path from sources
-perl -i -pe 's/\{\\isachardollar\}ISABELLE\{\\isacharunderscore\}TMP\{\\isacharslash\}examples/examples/g' *.tex
-
-isabelle logo Isar
-"$ISABELLE_HOME/src/Doc/prepare_document" "$FORMAT"
-
-# clean up afterwards
-rm -rf "${ISABELLE_TMP}/examples"
--- a/src/Doc/Codegen/document/root.tex	Wed Mar 31 16:01:31 2021 +0200
+++ b/src/Doc/Codegen/document/root.tex	Mon Sep 06 12:08:20 2021 +0200
@@ -13,7 +13,7 @@
 \hyphenation{Isar}
 \isadroptag{theory}
 
-\title{\includegraphics[scale=0.5]{isabelle_isar}
+\title{\includegraphics[scale=0.5]{isabelle_logo}
   \\[4ex] Code generation from Isabelle/HOL theories}
 \author{\emph{Florian Haftmann with contributions from Lukas Bulwahn}}
 
--- a/src/Doc/Corec/document/build	Wed Mar 31 16:01:31 2021 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,9 +0,0 @@
-#!/usr/bin/env bash
-
-set -e
-
-FORMAT="$1"
-VARIANT="$2"
-
-"$ISABELLE_HOME/src/Doc/prepare_document" "$FORMAT"
-
--- a/src/Doc/Corec/document/root.tex	Wed Mar 31 16:01:31 2021 +0200
+++ b/src/Doc/Corec/document/root.tex	Mon Sep 06 12:08:20 2021 +0200
@@ -48,7 +48,7 @@
 
 \isadroptag{theory}
 
-\title{%\includegraphics[scale=0.5]{isabelle_hol} \\[4ex]
+\title{%\includegraphics[scale=0.5]{isabelle_logo} \\[4ex]
 Defining Nonprimitively (Co)recursive Functions in Isabelle/HOL}
 \author{Jasmin Christian Blanchette, Aymeric Bouzy, \\
 Andreas Lochbihler, Andrei Popescu, and \\
--- a/src/Doc/Datatypes/document/build	Wed Mar 31 16:01:31 2021 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,9 +0,0 @@
-#!/usr/bin/env bash
-
-set -e
-
-FORMAT="$1"
-VARIANT="$2"
-
-"$ISABELLE_HOME/src/Doc/prepare_document" "$FORMAT"
-
--- a/src/Doc/Datatypes/document/root.tex	Wed Mar 31 16:01:31 2021 +0200
+++ b/src/Doc/Datatypes/document/root.tex	Mon Sep 06 12:08:20 2021 +0200
@@ -48,7 +48,7 @@
 
 \isadroptag{theory}
 
-\title{%\includegraphics[scale=0.5]{isabelle_hol} \\[4ex]
+\title{%\includegraphics[scale=0.5]{isabelle_logo} \\[4ex]
 Defining (Co)datatypes and Primitively (Co)recursive Functions in Isabelle/HOL}
 \author{Julian Biendarra, Jasmin Blanchette, \\
 Martin Desharnais, Lorenz Panny, \\
--- a/src/Doc/Eisbach/document/build	Wed Mar 31 16:01:31 2021 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,10 +0,0 @@
-#!/usr/bin/env bash
-
-set -e
-
-FORMAT="$1"
-VARIANT="$2"
-
-isabelle logo Eisbach
-"$ISABELLE_HOME/src/Doc/prepare_document" "$FORMAT"
-
--- a/src/Doc/Eisbach/document/root.tex	Wed Mar 31 16:01:31 2021 +0200
+++ b/src/Doc/Eisbach/document/root.tex	Mon Sep 06 12:08:20 2021 +0200
@@ -16,7 +16,7 @@
 \hyphenation{Eisbach}
 
 \isadroptag{theory}
-\title{\includegraphics[scale=0.5]{isabelle_eisbach}
+\title{\includegraphics[scale=0.5]{isabelle_logo}
   \\[4ex] The Eisbach User Manual}
 \author{Daniel Matichuk \\
   Makarius Wenzel \\
--- a/src/Doc/Functions/document/build	Wed Mar 31 16:01:31 2021 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,9 +0,0 @@
-#!/usr/bin/env bash
-
-set -e
-
-FORMAT="$1"
-VARIANT="$2"
-
-"$ISABELLE_HOME/src/Doc/prepare_document" "$FORMAT"
-
--- a/src/Doc/How_to_Prove_it/document/root.tex	Wed Mar 31 16:01:31 2021 +0200
+++ b/src/Doc/How_to_Prove_it/document/root.tex	Mon Sep 06 12:08:20 2021 +0200
@@ -5,7 +5,7 @@
 \begin{document}
 
 \title{How to Prove it in Isabelle/HOL}
-%\subtitle{\includegraphics[scale=.7]{isabelle_hol}}
+%\subtitle{\includegraphics[scale=.7]{isabelle_logo}}
 \author{Tobias Nipkow}
 \maketitle
 
--- a/src/Doc/Implementation/Eq.thy	Wed Mar 31 16:01:31 2021 +0200
+++ b/src/Doc/Implementation/Eq.thy	Mon Sep 06 12:08:20 2021 +0200
@@ -55,13 +55,13 @@
 
 text %mlref \<open>
   \begin{mldecls}
-  @{index_ML Thm.reflexive: "cterm -> thm"} \\
-  @{index_ML Thm.symmetric: "thm -> thm"} \\
-  @{index_ML Thm.transitive: "thm -> thm -> thm"} \\
-  @{index_ML Thm.abstract_rule: "string -> cterm -> thm -> thm"} \\
-  @{index_ML Thm.combination: "thm -> thm -> thm"} \\[0.5ex]
-  @{index_ML Thm.equal_intr: "thm -> thm -> thm"} \\
-  @{index_ML Thm.equal_elim: "thm -> thm -> thm"} \\
+  @{define_ML Thm.reflexive: "cterm -> thm"} \\
+  @{define_ML Thm.symmetric: "thm -> thm"} \\
+  @{define_ML Thm.transitive: "thm -> thm -> thm"} \\
+  @{define_ML Thm.abstract_rule: "string -> cterm -> thm -> thm"} \\
+  @{define_ML Thm.combination: "thm -> thm -> thm"} \\[0.5ex]
+  @{define_ML Thm.equal_intr: "thm -> thm -> thm"} \\
+  @{define_ML Thm.equal_elim: "thm -> thm -> thm"} \\
   \end{mldecls}
 
   See also \<^file>\<open>~~/src/Pure/thm.ML\<close> for further description of these inference
@@ -74,10 +74,27 @@
 section \<open>Conversions \label{sec:conv}\<close>
 
 text \<open>
-  %FIXME
+  The classic article @{cite "paulson:1983"} introduces the concept of
+  conversion for Cambridge LCF. This was historically important to implement
+  all kinds of ``simplifiers'', but the Isabelle Simplifier is done quite
+  differently, see @{cite \<open>\S9.3\<close> "isabelle-isar-ref"}.
+\<close>
 
-  The classic article that introduces the concept of conversion (for Cambridge
-  LCF) is @{cite "paulson:1983"}.
+text %mlref \<open>
+  \begin{mldecls}
+  @{define_ML_structure Conv} \\
+  @{define_ML_type conv} \\
+  @{define_ML Simplifier.asm_full_rewrite : "Proof.context -> conv"} \\
+  \end{mldecls}
+
+  \<^descr> \<^ML_structure>\<open>Conv\<close> is a library of combinators to build conversions,
+  over type \<^ML_type>\<open>conv\<close> (see also \<^file>\<open>~~/src/Pure/conv.ML\<close>). This is one
+  of the few Isabelle/ML modules that are usually used with \<^verbatim>\<open>open\<close>: finding
+  examples works by searching for ``\<^verbatim>\<open>open Conv\<close>'' instead of ``\<^verbatim>\<open>Conv.\<close>''.
+
+  \<^descr> \<^ML>\<open>Simplifier.asm_full_rewrite\<close> invokes the Simplifier as a
+  conversion. There are a few related operations, corresponding to the various
+  modes of simplification.
 \<close>
 
 
@@ -92,11 +109,11 @@
 
 text %mlref \<open>
   \begin{mldecls}
-  @{index_ML rewrite_rule: "Proof.context -> thm list -> thm -> thm"} \\
-  @{index_ML rewrite_goals_rule: "Proof.context -> thm list -> thm -> thm"} \\
-  @{index_ML rewrite_goal_tac: "Proof.context -> thm list -> int -> tactic"} \\
-  @{index_ML rewrite_goals_tac: "Proof.context -> thm list -> tactic"} \\
-  @{index_ML fold_goals_tac: "Proof.context -> thm list -> tactic"} \\
+  @{define_ML rewrite_rule: "Proof.context -> thm list -> thm -> thm"} \\
+  @{define_ML rewrite_goals_rule: "Proof.context -> thm list -> thm -> thm"} \\
+  @{define_ML rewrite_goal_tac: "Proof.context -> thm list -> int -> tactic"} \\
+  @{define_ML rewrite_goals_tac: "Proof.context -> thm list -> tactic"} \\
+  @{define_ML fold_goals_tac: "Proof.context -> thm list -> tactic"} \\
   \end{mldecls}
 
   \<^descr> \<^ML>\<open>rewrite_rule\<close>~\<open>ctxt rules thm\<close> rewrites the whole theorem by the
--- a/src/Doc/Implementation/Integration.thy	Wed Mar 31 16:01:31 2021 +0200
+++ b/src/Doc/Implementation/Integration.thy	Mon Sep 06 12:08:20 2021 +0200
@@ -37,11 +37,11 @@
 
 text %mlref \<open>
   \begin{mldecls}
-  @{index_ML_type Toplevel.state} \\
-  @{index_ML_exception Toplevel.UNDEF} \\
-  @{index_ML Toplevel.is_toplevel: "Toplevel.state -> bool"} \\
-  @{index_ML Toplevel.theory_of: "Toplevel.state -> theory"} \\
-  @{index_ML Toplevel.proof_of: "Toplevel.state -> Proof.state"} \\
+  @{define_ML_type Toplevel.state} \\
+  @{define_ML_exception Toplevel.UNDEF} \\
+  @{define_ML Toplevel.is_toplevel: "Toplevel.state -> bool"} \\
+  @{define_ML Toplevel.theory_of: "Toplevel.state -> theory"} \\
+  @{define_ML Toplevel.proof_of: "Toplevel.state -> Proof.state"} \\
   \end{mldecls}
 
   \<^descr> Type \<^ML_type>\<open>Toplevel.state\<close> represents Isar toplevel states, which are
@@ -95,17 +95,17 @@
 
 text %mlref \<open>
   \begin{mldecls}
-  @{index_ML Toplevel.keep: "(Toplevel.state -> unit) ->
+  @{define_ML Toplevel.keep: "(Toplevel.state -> unit) ->
   Toplevel.transition -> Toplevel.transition"} \\
-  @{index_ML Toplevel.theory: "(theory -> theory) ->
+  @{define_ML Toplevel.theory: "(theory -> theory) ->
   Toplevel.transition -> Toplevel.transition"} \\
-  @{index_ML Toplevel.theory_to_proof: "(theory -> Proof.state) ->
+  @{define_ML Toplevel.theory_to_proof: "(theory -> Proof.state) ->
   Toplevel.transition -> Toplevel.transition"} \\
-  @{index_ML Toplevel.proof: "(Proof.state -> Proof.state) ->
+  @{define_ML Toplevel.proof: "(Proof.state -> Proof.state) ->
   Toplevel.transition -> Toplevel.transition"} \\
-  @{index_ML Toplevel.proofs: "(Proof.state -> Proof.state Seq.result Seq.seq) ->
+  @{define_ML Toplevel.proofs: "(Proof.state -> Proof.state Seq.result Seq.seq) ->
   Toplevel.transition -> Toplevel.transition"} \\
-  @{index_ML Toplevel.end_proof: "(bool -> Proof.state -> Proof.context) ->
+  @{define_ML Toplevel.end_proof: "(bool -> Proof.state -> Proof.context) ->
   Toplevel.transition -> Toplevel.transition"} \\
   \end{mldecls}
 
@@ -150,10 +150,10 @@
 
 text %mlref \<open>
   \begin{mldecls}
-  @{index_ML use_thy: "string -> unit"} \\
-  @{index_ML Thy_Info.get_theory: "string -> theory"} \\
-  @{index_ML Thy_Info.remove_thy: "string -> unit"} \\
-  @{index_ML Thy_Info.register_thy: "theory -> unit"} \\
+  @{define_ML use_thy: "string -> unit"} \\
+  @{define_ML Thy_Info.get_theory: "string -> theory"} \\
+  @{define_ML Thy_Info.remove_thy: "string -> unit"} \\
+  @{define_ML Thy_Info.register_thy: "theory -> unit"} \\
   \end{mldecls}
 
   \<^descr> \<^ML>\<open>use_thy\<close>~\<open>A\<close> ensures that theory \<open>A\<close> is fully up-to-date wrt.\ the
--- a/src/Doc/Implementation/Isar.thy	Wed Mar 31 16:01:31 2021 +0200
+++ b/src/Doc/Implementation/Isar.thy	Mon Sep 06 12:08:20 2021 +0200
@@ -60,16 +60,16 @@
 
 text %mlref \<open>
   \begin{mldecls}
-  @{index_ML_type Proof.state} \\
-  @{index_ML Proof.assert_forward: "Proof.state -> Proof.state"} \\
-  @{index_ML Proof.assert_chain: "Proof.state -> Proof.state"} \\
-  @{index_ML Proof.assert_backward: "Proof.state -> Proof.state"} \\
-  @{index_ML Proof.simple_goal: "Proof.state -> {context: Proof.context, goal: thm}"} \\
-  @{index_ML Proof.goal: "Proof.state ->
+  @{define_ML_type Proof.state} \\
+  @{define_ML Proof.assert_forward: "Proof.state -> Proof.state"} \\
+  @{define_ML Proof.assert_chain: "Proof.state -> Proof.state"} \\
+  @{define_ML Proof.assert_backward: "Proof.state -> Proof.state"} \\
+  @{define_ML Proof.simple_goal: "Proof.state -> {context: Proof.context, goal: thm}"} \\
+  @{define_ML Proof.goal: "Proof.state ->
   {context: Proof.context, facts: thm list, goal: thm}"} \\
-  @{index_ML Proof.raw_goal: "Proof.state ->
+  @{define_ML Proof.raw_goal: "Proof.state ->
   {context: Proof.context, facts: thm list, goal: thm}"} \\
-  @{index_ML Proof.theorem: "Method.text option ->
+  @{define_ML Proof.theorem: "Method.text option ->
   (thm list list -> Proof.context -> Proof.context) ->
   (term * term list) list list -> Proof.context -> Proof.state"} \\
   \end{mldecls}
@@ -272,13 +272,13 @@
 
 text %mlref \<open>
   \begin{mldecls}
-  @{index_ML_type Proof.method} \\
-  @{index_ML CONTEXT_METHOD: "(thm list -> context_tactic) -> Proof.method"} \\
-  @{index_ML METHOD: "(thm list -> tactic) -> Proof.method"} \\
-  @{index_ML SIMPLE_METHOD: "tactic -> Proof.method"} \\
-  @{index_ML SIMPLE_METHOD': "(int -> tactic) -> Proof.method"} \\
-  @{index_ML Method.insert_tac: "Proof.context -> thm list -> int -> tactic"} \\
-  @{index_ML Method.setup: "binding -> (Proof.context -> Proof.method) context_parser ->
+  @{define_ML_type Proof.method} \\
+  @{define_ML CONTEXT_METHOD: "(thm list -> context_tactic) -> Proof.method"} \\
+  @{define_ML METHOD: "(thm list -> tactic) -> Proof.method"} \\
+  @{define_ML SIMPLE_METHOD: "tactic -> Proof.method"} \\
+  @{define_ML SIMPLE_METHOD': "(int -> tactic) -> Proof.method"} \\
+  @{define_ML Method.insert_tac: "Proof.context -> thm list -> int -> tactic"} \\
+  @{define_ML Method.setup: "binding -> (Proof.context -> Proof.method) context_parser ->
   string -> theory -> theory"} \\
   \end{mldecls}
 
@@ -286,7 +286,7 @@
 
   \<^descr> \<^ML>\<open>CONTEXT_METHOD\<close>~\<open>(fn facts => context_tactic)\<close> wraps \<open>context_tactic\<close>
   depending on goal facts as a general proof method that may change the proof
-  context dynamically. A typical operation is \<^ML>\<open>Proof_Context.update_cases\<close>, which is wrapped up as combinator @{index_ML
+  context dynamically. A typical operation is \<^ML>\<open>Proof_Context.update_cases\<close>, which is wrapped up as combinator @{define_ML
   CONTEXT_CASES} for convenience.
 
   \<^descr> \<^ML>\<open>METHOD\<close>~\<open>(fn facts => tactic)\<close> wraps \<open>tactic\<close> depending on goal facts
@@ -495,12 +495,12 @@
 
 text %mlref \<open>
   \begin{mldecls}
-  @{index_ML_type attribute} \\
-  @{index_ML Thm.rule_attribute: "thm list ->
+  @{define_ML_type attribute} \\
+  @{define_ML Thm.rule_attribute: "thm list ->
   (Context.generic -> thm -> thm) -> attribute"} \\
-  @{index_ML Thm.declaration_attribute: "
+  @{define_ML Thm.declaration_attribute: "
   (thm -> Context.generic -> Context.generic) -> attribute"} \\
-  @{index_ML Attrib.setup: "binding -> attribute context_parser ->
+  @{define_ML Attrib.setup: "binding -> attribute context_parser ->
   string -> theory -> theory"} \\
   \end{mldecls}
 
--- a/src/Doc/Implementation/Local_Theory.thy	Wed Mar 31 16:01:31 2021 +0200
+++ b/src/Doc/Implementation/Local_Theory.thy	Mon Sep 06 12:08:20 2021 +0200
@@ -90,11 +90,11 @@
 
 text %mlref \<open>
   \begin{mldecls}
-  @{index_ML_type local_theory: Proof.context} \\
-  @{index_ML Named_Target.init: "string list -> string -> theory -> local_theory"} \\[1ex]
-  @{index_ML Local_Theory.define: "(binding * mixfix) * (Attrib.binding * term) ->
+  @{define_ML_type local_theory = Proof.context} \\
+  @{define_ML Named_Target.init: "string list -> string -> theory -> local_theory"} \\[1ex]
+  @{define_ML Local_Theory.define: "(binding * mixfix) * (Attrib.binding * term) ->
     local_theory -> (term * (string * thm)) * local_theory"} \\
-  @{index_ML Local_Theory.note: "Attrib.binding * thm list ->
+  @{define_ML Local_Theory.note: "Attrib.binding * thm list ->
     local_theory -> (string * thm list) * local_theory"} \\
   \end{mldecls}
 
--- a/src/Doc/Implementation/Logic.thy	Wed Mar 31 16:01:31 2021 +0200
+++ b/src/Doc/Implementation/Logic.thy	Mon Sep 06 12:08:20 2021 +0200
@@ -102,22 +102,22 @@
 
 text %mlref \<open>
   \begin{mldecls}
-  @{index_ML_type class: string} \\
-  @{index_ML_type sort: "class list"} \\
-  @{index_ML_type arity: "string * sort list * sort"} \\
-  @{index_ML_type typ} \\
-  @{index_ML Term.map_atyps: "(typ -> typ) -> typ -> typ"} \\
-  @{index_ML Term.fold_atyps: "(typ -> 'a -> 'a) -> typ -> 'a -> 'a"} \\
+  @{define_ML_type class = string} \\
+  @{define_ML_type sort = "class list"} \\
+  @{define_ML_type arity = "string * sort list * sort"} \\
+  @{define_ML_type typ} \\
+  @{define_ML Term.map_atyps: "(typ -> typ) -> typ -> typ"} \\
+  @{define_ML Term.fold_atyps: "(typ -> 'a -> 'a) -> typ -> 'a -> 'a"} \\
   \end{mldecls}
   \begin{mldecls}
-  @{index_ML Sign.subsort: "theory -> sort * sort -> bool"} \\
-  @{index_ML Sign.of_sort: "theory -> typ * sort -> bool"} \\
-  @{index_ML Sign.add_type: "Proof.context -> binding * int * mixfix -> theory -> theory"} \\
-  @{index_ML Sign.add_type_abbrev: "Proof.context ->
+  @{define_ML Sign.subsort: "theory -> sort * sort -> bool"} \\
+  @{define_ML Sign.of_sort: "theory -> typ * sort -> bool"} \\
+  @{define_ML Sign.add_type: "Proof.context -> binding * int * mixfix -> theory -> theory"} \\
+  @{define_ML Sign.add_type_abbrev: "Proof.context ->
   binding * string list * typ -> theory -> theory"} \\
-  @{index_ML Sign.primitive_class: "binding * class list -> theory -> theory"} \\
-  @{index_ML Sign.primitive_classrel: "class * class -> theory -> theory"} \\
-  @{index_ML Sign.primitive_arity: "arity -> theory -> theory"} \\
+  @{define_ML Sign.primitive_class: "binding * class list -> theory -> theory"} \\
+  @{define_ML Sign.primitive_classrel: "class * class -> theory -> theory"} \\
+  @{define_ML Sign.primitive_arity: "arity -> theory -> theory"} \\
   \end{mldecls}
 
   \<^descr> Type \<^ML_type>\<open>class\<close> represents type classes.
@@ -313,30 +313,30 @@
 
 text %mlref \<open>
   \begin{mldecls}
-  @{index_ML_type term} \\
-  @{index_ML_op "aconv": "term * term -> bool"} \\
-  @{index_ML Term.map_types: "(typ -> typ) -> term -> term"} \\
-  @{index_ML Term.fold_types: "(typ -> 'a -> 'a) -> term -> 'a -> 'a"} \\
-  @{index_ML Term.map_aterms: "(term -> term) -> term -> term"} \\
-  @{index_ML Term.fold_aterms: "(term -> 'a -> 'a) -> term -> 'a -> 'a"} \\
+  @{define_ML_type term} \\
+  @{define_ML_infix "aconv": "term * term -> bool"} \\
+  @{define_ML Term.map_types: "(typ -> typ) -> term -> term"} \\
+  @{define_ML Term.fold_types: "(typ -> 'a -> 'a) -> term -> 'a -> 'a"} \\
+  @{define_ML Term.map_aterms: "(term -> term) -> term -> term"} \\
+  @{define_ML Term.fold_aterms: "(term -> 'a -> 'a) -> term -> 'a -> 'a"} \\
   \end{mldecls}
   \begin{mldecls}
-  @{index_ML fastype_of: "term -> typ"} \\
-  @{index_ML lambda: "term -> term -> term"} \\
-  @{index_ML betapply: "term * term -> term"} \\
-  @{index_ML incr_boundvars: "int -> term -> term"} \\
-  @{index_ML Sign.declare_const: "Proof.context ->
+  @{define_ML fastype_of: "term -> typ"} \\
+  @{define_ML lambda: "term -> term -> term"} \\
+  @{define_ML betapply: "term * term -> term"} \\
+  @{define_ML incr_boundvars: "int -> term -> term"} \\
+  @{define_ML Sign.declare_const: "Proof.context ->
   (binding * typ) * mixfix -> theory -> term * theory"} \\
-  @{index_ML Sign.add_abbrev: "string -> binding * term ->
+  @{define_ML Sign.add_abbrev: "string -> binding * term ->
   theory -> (term * term) * theory"} \\
-  @{index_ML Sign.const_typargs: "theory -> string * typ -> typ list"} \\
-  @{index_ML Sign.const_instance: "theory -> string * typ list -> typ"} \\
+  @{define_ML Sign.const_typargs: "theory -> string * typ -> typ list"} \\
+  @{define_ML Sign.const_instance: "theory -> string * typ list -> typ"} \\
   \end{mldecls}
 
   \<^descr> Type \<^ML_type>\<open>term\<close> represents de-Bruijn terms, with comments in
   abstractions, and explicitly named free variables and constants; this is a
-  datatype with constructors @{index_ML Bound}, @{index_ML Free}, @{index_ML
-  Var}, @{index_ML Const}, @{index_ML Abs}, @{index_ML_op "$"}.
+  datatype with constructors @{define_ML Bound}, @{define_ML Free}, @{define_ML
+  Var}, @{define_ML Const}, @{define_ML Abs}, @{define_ML_infix "$"}.
 
   \<^descr> \<open>t\<close>~\<^ML_text>\<open>aconv\<close>~\<open>u\<close> checks \<open>\<alpha>\<close>-equivalence of two terms. This is the
   basic equality relation on type \<^ML_type>\<open>term\<close>; raw datatype equality
@@ -564,41 +564,41 @@
 
 text %mlref \<open>
   \begin{mldecls}
-  @{index_ML Logic.all: "term -> term -> term"} \\
-  @{index_ML Logic.mk_implies: "term * term -> term"} \\
+  @{define_ML Logic.all: "term -> term -> term"} \\
+  @{define_ML Logic.mk_implies: "term * term -> term"} \\
   \end{mldecls}
   \begin{mldecls}
-  @{index_ML_type ctyp} \\
-  @{index_ML_type cterm} \\
-  @{index_ML Thm.ctyp_of: "Proof.context -> typ -> ctyp"} \\
-  @{index_ML Thm.cterm_of: "Proof.context -> term -> cterm"} \\
-  @{index_ML Thm.apply: "cterm -> cterm -> cterm"} \\
-  @{index_ML Thm.lambda: "cterm -> cterm -> cterm"} \\
-  @{index_ML Thm.all: "Proof.context -> cterm -> cterm -> cterm"} \\
-  @{index_ML Drule.mk_implies: "cterm * cterm -> cterm"} \\
+  @{define_ML_type ctyp} \\
+  @{define_ML_type cterm} \\
+  @{define_ML Thm.ctyp_of: "Proof.context -> typ -> ctyp"} \\
+  @{define_ML Thm.cterm_of: "Proof.context -> term -> cterm"} \\
+  @{define_ML Thm.apply: "cterm -> cterm -> cterm"} \\
+  @{define_ML Thm.lambda: "cterm -> cterm -> cterm"} \\
+  @{define_ML Thm.all: "Proof.context -> cterm -> cterm -> cterm"} \\
+  @{define_ML Drule.mk_implies: "cterm * cterm -> cterm"} \\
   \end{mldecls}
   \begin{mldecls}
-  @{index_ML_type thm} \\
-  @{index_ML Thm.transfer: "theory -> thm -> thm"} \\
-  @{index_ML Thm.assume: "cterm -> thm"} \\
-  @{index_ML Thm.forall_intr: "cterm -> thm -> thm"} \\
-  @{index_ML Thm.forall_elim: "cterm -> thm -> thm"} \\
-  @{index_ML Thm.implies_intr: "cterm -> thm -> thm"} \\
-  @{index_ML Thm.implies_elim: "thm -> thm -> thm"} \\
-  @{index_ML Thm.generalize: "string list * string list -> int -> thm -> thm"} \\
-  @{index_ML Thm.instantiate: "((indexname * sort) * ctyp) list * ((indexname * typ) * cterm) list
+  @{define_ML_type thm} \\
+  @{define_ML Thm.transfer: "theory -> thm -> thm"} \\
+  @{define_ML Thm.assume: "cterm -> thm"} \\
+  @{define_ML Thm.forall_intr: "cterm -> thm -> thm"} \\
+  @{define_ML Thm.forall_elim: "cterm -> thm -> thm"} \\
+  @{define_ML Thm.implies_intr: "cterm -> thm -> thm"} \\
+  @{define_ML Thm.implies_elim: "thm -> thm -> thm"} \\
+  @{define_ML Thm.generalize: "Symtab.set * Symtab.set -> int -> thm -> thm"} \\
+  @{define_ML Thm.instantiate: "((indexname * sort) * ctyp) list * ((indexname * typ) * cterm) list
   -> thm -> thm"} \\
-  @{index_ML Thm.add_axiom: "Proof.context ->
+  @{define_ML Thm.add_axiom: "Proof.context ->
   binding * term -> theory -> (string * thm) * theory"} \\
-  @{index_ML Thm.add_oracle: "binding * ('a -> cterm) -> theory ->
+  @{define_ML Thm.add_oracle: "binding * ('a -> cterm) -> theory ->
   (string * ('a -> thm)) * theory"} \\
-  @{index_ML Thm.add_def: "Defs.context -> bool -> bool ->
+  @{define_ML Thm.add_def: "Defs.context -> bool -> bool ->
   binding * term -> theory -> (string * thm) * theory"} \\
   \end{mldecls}
   \begin{mldecls}
-  @{index_ML Theory.add_deps: "Defs.context -> string ->
+  @{define_ML Theory.add_deps: "Defs.context -> string ->
   Defs.entry -> Defs.entry list -> theory -> theory"} \\
-  @{index_ML Thm_Deps.all_oracles: "thm list -> Proofterm.oracle list"} \\
+  @{define_ML Thm_Deps.all_oracles: "thm list -> Proofterm.oracle list"} \\
   \end{mldecls}
 
   \<^descr> \<^ML>\<open>Logic.all\<close>~\<open>a B\<close> produces a Pure quantification \<open>\<And>a. B\<close>, where
@@ -624,7 +624,7 @@
 
   \<^descr> \<^ML>\<open>Thm.apply\<close>, \<^ML>\<open>Thm.lambda\<close>, \<^ML>\<open>Thm.all\<close>, \<^ML>\<open>Drule.mk_implies\<close>
   etc.\ compose certified terms (or propositions) incrementally. This is
-  equivalent to \<^ML>\<open>Thm.cterm_of\<close> after unchecked \<^ML_op>\<open>$\<close>, \<^ML>\<open>lambda\<close>,
+  equivalent to \<^ML>\<open>Thm.cterm_of\<close> after unchecked \<^ML_infix>\<open>$\<close>, \<^ML>\<open>lambda\<close>,
   \<^ML>\<open>Logic.all\<close>, \<^ML>\<open>Logic.mk_implies\<close> etc., but there can be a big
   difference in performance when large existing entities are composed by a few
   extra constructions on top. There are separate operations to decompose
@@ -646,8 +646,8 @@
 
   \<^descr> \<^ML>\<open>Thm.generalize\<close>~\<open>(\<^vec>\<alpha>, \<^vec>x)\<close> corresponds to the
   \<open>generalize\<close> rules of \figref{fig:subst-rules}. Here collections of type and
-  term variables are generalized simultaneously, specified by the given basic
-  names.
+  term variables are generalized simultaneously, specified by the given sets of
+  basic names.
 
   \<^descr> \<^ML>\<open>Thm.instantiate\<close>~\<open>(\<^vec>\<alpha>\<^sub>s, \<^vec>x\<^sub>\<tau>)\<close> corresponds to the
   \<open>instantiate\<close> rules of \figref{fig:subst-rules}. Type variables are
@@ -796,12 +796,12 @@
 
 text %mlref \<open>
   \begin{mldecls}
-  @{index_ML Conjunction.intr: "thm -> thm -> thm"} \\
-  @{index_ML Conjunction.elim: "thm -> thm * thm"} \\
-  @{index_ML Drule.mk_term: "cterm -> thm"} \\
-  @{index_ML Drule.dest_term: "thm -> cterm"} \\
-  @{index_ML Logic.mk_type: "typ -> term"} \\
-  @{index_ML Logic.dest_type: "term -> typ"} \\
+  @{define_ML Conjunction.intr: "thm -> thm -> thm"} \\
+  @{define_ML Conjunction.elim: "thm -> thm * thm"} \\
+  @{define_ML Drule.mk_term: "cterm -> thm"} \\
+  @{define_ML Drule.dest_term: "thm -> cterm"} \\
+  @{define_ML Logic.mk_type: "typ -> term"} \\
+  @{define_ML Logic.dest_type: "term -> typ"} \\
   \end{mldecls}
 
   \<^descr> \<^ML>\<open>Conjunction.intr\<close> derives \<open>A &&& B\<close> from \<open>A\<close> and \<open>B\<close>.
@@ -846,8 +846,8 @@
 
 text %mlref \<open>
   \begin{mldecls}
-  @{index_ML Thm.extra_shyps: "thm -> sort list"} \\
-  @{index_ML Thm.strip_shyps: "thm -> thm"} \\
+  @{define_ML Thm.extra_shyps: "thm -> sort list"} \\
+  @{define_ML Thm.strip_shyps: "thm -> thm"} \\
   \end{mldecls}
 
   \<^descr> \<^ML>\<open>Thm.extra_shyps\<close>~\<open>thm\<close> determines the extraneous sort hypotheses of
@@ -951,7 +951,7 @@
 
 text %mlref \<open>
   \begin{mldecls}
-  @{index_ML Simplifier.norm_hhf: "Proof.context -> thm -> thm"} \\
+  @{define_ML Simplifier.norm_hhf: "Proof.context -> thm -> thm"} \\
   \end{mldecls}
 
   \<^descr> \<^ML>\<open>Simplifier.norm_hhf\<close>~\<open>ctxt thm\<close> normalizes the given theorem
@@ -1022,14 +1022,14 @@
 
 text %mlref \<open>
   \begin{mldecls}
-  @{index_ML_op "RSN": "thm * (int * thm) -> thm"} \\
-  @{index_ML_op "RS": "thm * thm -> thm"} \\
+  @{define_ML_infix "RSN": "thm * (int * thm) -> thm"} \\
+  @{define_ML_infix "RS": "thm * thm -> thm"} \\
 
-  @{index_ML_op "RLN": "thm list * (int * thm list) -> thm list"} \\
-  @{index_ML_op "RL": "thm list * thm list -> thm list"} \\
+  @{define_ML_infix "RLN": "thm list * (int * thm list) -> thm list"} \\
+  @{define_ML_infix "RL": "thm list * thm list -> thm list"} \\
 
-  @{index_ML_op "MRS": "thm list * thm -> thm"} \\
-  @{index_ML_op "OF": "thm * thm list -> thm"} \\
+  @{define_ML_infix "MRS": "thm list * thm -> thm"} \\
+  @{define_ML_infix "OF": "thm * thm list -> thm"} \\
   \end{mldecls}
 
   \<^descr> \<open>rule\<^sub>1 RSN (i, rule\<^sub>2)\<close> resolves the conclusion of \<open>rule\<^sub>1\<close> with the
@@ -1184,22 +1184,22 @@
 
 text %mlref \<open>
   \begin{mldecls}
-  @{index_ML_type proof} \\
-  @{index_ML_type proof_body} \\
-  @{index_ML Proofterm.proofs: "int Unsynchronized.ref"} \\
-  @{index_ML Proofterm.reconstruct_proof:
+  @{define_ML_type proof} \\
+  @{define_ML_type proof_body} \\
+  @{define_ML Proofterm.proofs: "int Unsynchronized.ref"} \\
+  @{define_ML Proofterm.reconstruct_proof:
   "theory -> term -> proof -> proof"} \\
-  @{index_ML Proofterm.expand_proof: "theory ->
+  @{define_ML Proofterm.expand_proof: "theory ->
   (Proofterm.thm_header -> string option) -> proof -> proof"} \\
-  @{index_ML Proof_Checker.thm_of_proof: "theory -> proof -> thm"} \\
-  @{index_ML Proof_Syntax.read_proof: "theory -> bool -> bool -> string -> proof"} \\
-  @{index_ML Proof_Syntax.pretty_proof: "Proof.context -> proof -> Pretty.T"} \\
+  @{define_ML Proof_Checker.thm_of_proof: "theory -> proof -> thm"} \\
+  @{define_ML Proof_Syntax.read_proof: "theory -> bool -> bool -> string -> proof"} \\
+  @{define_ML Proof_Syntax.pretty_proof: "Proof.context -> proof -> Pretty.T"} \\
   \end{mldecls}
 
   \<^descr> Type \<^ML_type>\<open>proof\<close> represents proof terms; this is a datatype with
-  constructors @{index_ML Abst}, @{index_ML AbsP}, @{index_ML_op "%"},
-  @{index_ML_op "%%"}, @{index_ML PBound}, @{index_ML MinProof}, @{index_ML
-  Hyp}, @{index_ML PAxm}, @{index_ML Oracle}, @{index_ML PThm} as explained
+  constructors @{define_ML Abst}, @{define_ML AbsP}, @{define_ML_infix "%"},
+  @{define_ML_infix "%%"}, @{define_ML PBound}, @{define_ML MinProof}, @{define_ML
+  Hyp}, @{define_ML PAxm}, @{define_ML Oracle}, @{define_ML PThm} as explained
   above. %FIXME PClass (!?)
 
   \<^descr> Type \<^ML_type>\<open>proof_body\<close> represents the nested proof information of a
--- a/src/Doc/Implementation/ML.thy	Wed Mar 31 16:01:31 2021 +0200
+++ b/src/Doc/Implementation/ML.thy	Mon Sep 06 12:08:20 2021 +0200
@@ -611,10 +611,10 @@
 
 text %mlref \<open>
   \begin{mldecls}
-  @{index_ML Context.the_generic_context: "unit -> Context.generic"} \\
-  @{index_ML "Context.>>": "(Context.generic -> Context.generic) -> unit"} \\
-  @{index_ML ML_Thms.bind_thms: "string * thm list -> unit"} \\
-  @{index_ML ML_Thms.bind_thm: "string * thm -> unit"} \\
+  @{define_ML Context.the_generic_context: "unit -> Context.generic"} \\
+  @{define_ML "Context.>>": "(Context.generic -> Context.generic) -> unit"} \\
+  @{define_ML ML_Thms.bind_thms: "string * thm list -> unit"} \\
+  @{define_ML ML_Thms.bind_thm: "string * thm -> unit"} \\
   \end{mldecls}
 
     \<^descr> \<^ML>\<open>Context.the_generic_context ()\<close> refers to the theory context of
@@ -818,10 +818,10 @@
 
 text %mlref \<open>
   \begin{mldecls}
-  @{index_ML_op "|> ": "'a * ('a -> 'b) -> 'b"} \\
-  @{index_ML_op "|-> ": "('c * 'a) * ('c -> 'a -> 'b) -> 'b"} \\
-  @{index_ML_op "#> ": "('a -> 'b) * ('b -> 'c) -> 'a -> 'c"} \\
-  @{index_ML_op "#-> ": "('a -> 'c * 'b) * ('c -> 'b -> 'd) -> 'a -> 'd"} \\
+  @{define_ML_infix "|>" : "'a * ('a -> 'b) -> 'b"} \\
+  @{define_ML_infix "|->" : "('c * 'a) * ('c -> 'a -> 'b) -> 'b"} \\
+  @{define_ML_infix "#>" : "('a -> 'b) * ('b -> 'c) -> 'a -> 'c"} \\
+  @{define_ML_infix "#->" : "('a -> 'c * 'b) * ('c -> 'b -> 'd) -> 'a -> 'd"} \\
   \end{mldecls}
 \<close>
 
@@ -853,9 +853,9 @@
 
 text %mlref \<open>
   \begin{mldecls}
-  @{index_ML fold: "('a -> 'b -> 'b) -> 'a list -> 'b -> 'b"} \\
-  @{index_ML fold_rev: "('a -> 'b -> 'b) -> 'a list -> 'b -> 'b"} \\
-  @{index_ML fold_map: "('a -> 'b -> 'c * 'b) -> 'a list -> 'b -> 'c list * 'b"} \\
+  @{define_ML fold: "('a -> 'b -> 'b) -> 'a list -> 'b -> 'b"} \\
+  @{define_ML fold_rev: "('a -> 'b -> 'b) -> 'a list -> 'b -> 'b"} \\
+  @{define_ML fold_map: "('a -> 'b -> 'c * 'b) -> 'a list -> 'b -> 'c list * 'b"} \\
   \end{mldecls}
 
   \<^descr> \<^ML>\<open>fold\<close>~\<open>f\<close> lifts the parametrized update function \<open>f\<close> to a list of
@@ -969,10 +969,10 @@
 
 text %mlref \<open>
   \begin{mldecls}
-  @{index_ML writeln: "string -> unit"} \\
-  @{index_ML tracing: "string -> unit"} \\
-  @{index_ML warning: "string -> unit"} \\
-  @{index_ML error: "string -> 'a"} % FIXME Output.error_message (!?) \\
+  @{define_ML writeln: "string -> unit"} \\
+  @{define_ML tracing: "string -> unit"} \\
+  @{define_ML warning: "string -> unit"} \\
+  @{define_ML error: "string -> 'a"} % FIXME Output.error_message (!?) \\
   \end{mldecls}
 
   \<^descr> \<^ML>\<open>writeln\<close>~\<open>text\<close> outputs \<open>text\<close> as regular message. This is the
@@ -1140,15 +1140,19 @@
 
 text %mlref \<open>
   \begin{mldecls}
-  @{index_ML try: "('a -> 'b) -> 'a -> 'b option"} \\
-  @{index_ML can: "('a -> 'b) -> 'a -> bool"} \\
-  @{index_ML_exception ERROR: string} \\
-  @{index_ML_exception Fail: string} \\
-  @{index_ML Exn.is_interrupt: "exn -> bool"} \\
-  @{index_ML Exn.reraise: "exn -> 'a"} \\
-  @{index_ML Runtime.exn_trace: "(unit -> 'a) -> 'a"} \\
+  @{define_ML try: "('a -> 'b) -> 'a -> 'b option"} \\
+  @{define_ML can: "('a -> 'b) -> 'a -> bool"} \\
+  @{define_ML_exception ERROR of string} \\
+  @{define_ML_exception Fail of string} \\
+  @{define_ML Exn.is_interrupt: "exn -> bool"} \\
+  @{define_ML Exn.reraise: "exn -> 'a"} \\
+  @{define_ML Runtime.exn_trace: "(unit -> 'a) -> 'a"} \\
   \end{mldecls}
 
+  \<^rail>\<open>
+    (@@{ML_antiquotation try} | @@{ML_antiquotation can}) embedded
+  \<close>
+
   \<^descr> \<^ML>\<open>try\<close>~\<open>f x\<close> makes the partiality of evaluating \<open>f x\<close> explicit via the
   option datatype. Interrupts are \<^emph>\<open>not\<close> handled here, i.e.\ this form serves
   as safe replacement for the \<^emph>\<open>unsafe\<close> version \<^ML_text>\<open>(SOME\<close>~\<open>f
@@ -1180,18 +1184,38 @@
 
 text %mlantiq \<open>
   \begin{matharray}{rcl}
+  @{ML_antiquotation_def "try"} & : & \<open>ML_antiquotation\<close> \\
+  @{ML_antiquotation_def "can"} & : & \<open>ML_antiquotation\<close> \\
   @{ML_antiquotation_def "assert"} & : & \<open>ML_antiquotation\<close> \\
   @{ML_antiquotation_def "undefined"} & : & \<open>ML_antiquotation\<close> \\
   \end{matharray}
 
-  \<^descr> \<open>@{assert}\<close> inlines a function \<^ML_type>\<open>bool -> unit\<close> that raises \<^ML>\<open>Fail\<close> if the argument is \<^ML>\<open>false\<close>. Due to inlining the source position of
-  failed assertions is included in the error output.
+  \<^descr> \<open>@{try}\<close> and \<open>{can}\<close> are similar to the corresponding functions, but the
+  argument is taken directly as ML expression: functional abstraction and
+  application is done implicitly.
+
+  \<^descr> \<open>@{assert}\<close> inlines a function \<^ML_type>\<open>bool -> unit\<close> that raises
+  \<^ML>\<open>Fail\<close> if the argument is \<^ML>\<open>false\<close>. Due to inlining the source
+  position of failed assertions is included in the error output.
 
   \<^descr> \<open>@{undefined}\<close> inlines \<^verbatim>\<open>raise\<close>~\<^ML>\<open>Match\<close>, i.e.\ the ML program
   behaves as in some function application of an undefined case.
 \<close>
 
 text %mlex \<open>
+  We define a total version of division: any failures are swept under the
+  carpet and mapped to a default value. Thus division-by-zero becomes 0, but
+  there could be other exceptions like overflow that produce the same result
+  (for unbounded integers this does not happen).
+\<close>
+
+ML \<open>
+  fun div_total x y = \<^try>\<open>x div y\<close> |> the_default 0;
+
+  \<^assert> (div_total 1 0 = 0);
+\<close>
+
+text \<open>
   The ML function \<^ML>\<open>undefined\<close> is defined in \<^file>\<open>~~/src/Pure/library.ML\<close>
   as follows:
 \<close>
@@ -1215,7 +1239,7 @@
 ML \<open>fun undefined _ = \<^undefined>\<close>
 
 text \<open>
-  \medskip Semantically, all forms are equivalent to a function definition
+  \<^medskip> Semantically, all forms are equivalent to a function definition
   without any clauses, but that is syntactically not allowed in ML.
 \<close>
 
@@ -1260,16 +1284,16 @@
 
 text %mlref \<open>
   \begin{mldecls}
-  @{index_ML_type "Symbol.symbol": string} \\
-  @{index_ML Symbol.explode: "string -> Symbol.symbol list"} \\
-  @{index_ML Symbol.is_letter: "Symbol.symbol -> bool"} \\
-  @{index_ML Symbol.is_digit: "Symbol.symbol -> bool"} \\
-  @{index_ML Symbol.is_quasi: "Symbol.symbol -> bool"} \\
-  @{index_ML Symbol.is_blank: "Symbol.symbol -> bool"} \\
+  @{define_ML_type Symbol.symbol = string} \\
+  @{define_ML Symbol.explode: "string -> Symbol.symbol list"} \\
+  @{define_ML Symbol.is_letter: "Symbol.symbol -> bool"} \\
+  @{define_ML Symbol.is_digit: "Symbol.symbol -> bool"} \\
+  @{define_ML Symbol.is_quasi: "Symbol.symbol -> bool"} \\
+  @{define_ML Symbol.is_blank: "Symbol.symbol -> bool"} \\
   \end{mldecls}
   \begin{mldecls}
-  @{index_ML_type "Symbol.sym"} \\
-  @{index_ML Symbol.decode: "Symbol.symbol -> Symbol.sym"} \\
+  @{define_ML_type "Symbol.sym"} \\
+  @{define_ML Symbol.decode: "Symbol.symbol -> Symbol.sym"} \\
   \end{mldecls}
 
   \<^descr> Type \<^ML_type>\<open>Symbol.symbol\<close> represents individual Isabelle symbols.
@@ -1323,7 +1347,7 @@
 
 text %mlref \<open>
   \begin{mldecls}
-  @{index_ML_type char} \\
+  @{define_ML_type char} \\
   \end{mldecls}
 
   \<^descr> Type \<^ML_type>\<open>char\<close> is \<^emph>\<open>not\<close> used. The smallest textual unit in Isabelle
@@ -1335,7 +1359,7 @@
 
 text %mlref \<open>
   \begin{mldecls}
-  @{index_ML_type string} \\
+  @{define_ML_type string} \\
   \end{mldecls}
 
   \<^descr> Type \<^ML_type>\<open>string\<close> represents immutable vectors of 8-bit characters.
@@ -1383,7 +1407,7 @@
 
 text %mlref \<open>
   \begin{mldecls}
-  @{index_ML_type int} \\
+  @{define_ML_type int} \\
   \end{mldecls}
 
   \<^descr> Type \<^ML_type>\<open>int\<close> represents regular mathematical integers, which are
@@ -1401,7 +1425,7 @@
 
 text %mlref \<open>
   \begin{mldecls}
-  @{index_ML_type Rat.rat} \\
+  @{define_ML_type Rat.rat} \\
   \end{mldecls}
 
   \<^descr> Type \<^ML_type>\<open>Rat.rat\<close> represents rational numbers, based on the
@@ -1420,8 +1444,8 @@
 
 text %mlref \<open>
   \begin{mldecls}
-  @{index_ML_type Time.time} \\
-  @{index_ML seconds: "real -> Time.time"} \\
+  @{define_ML_type Time.time} \\
+  @{define_ML seconds: "real -> Time.time"} \\
   \end{mldecls}
 
   \<^descr> Type \<^ML_type>\<open>Time.time\<close> represents time abstractly according to the
@@ -1439,13 +1463,13 @@
 
 text %mlref \<open>
   \begin{mldecls}
-  @{index_ML Option.map: "('a -> 'b) -> 'a option -> 'b option"} \\
-  @{index_ML is_some: "'a option -> bool"} \\
-  @{index_ML is_none: "'a option -> bool"} \\
-  @{index_ML the: "'a option -> 'a"} \\
-  @{index_ML these: "'a list option -> 'a list"} \\
-  @{index_ML the_list: "'a option -> 'a list"} \\
-  @{index_ML the_default: "'a -> 'a option -> 'a"} \\
+  @{define_ML Option.map: "('a -> 'b) -> 'a option -> 'b option"} \\
+  @{define_ML is_some: "'a option -> bool"} \\
+  @{define_ML is_none: "'a option -> bool"} \\
+  @{define_ML the: "'a option -> 'a"} \\
+  @{define_ML these: "'a list option -> 'a list"} \\
+  @{define_ML the_list: "'a option -> 'a list"} \\
+  @{define_ML the_default: "'a -> 'a option -> 'a"} \\
   \end{mldecls}
 \<close>
 
@@ -1466,11 +1490,11 @@
 
 text %mlref \<open>
   \begin{mldecls}
-  @{index_ML cons: "'a -> 'a list -> 'a list"} \\
-  @{index_ML member: "('b * 'a -> bool) -> 'a list -> 'b -> bool"} \\
-  @{index_ML insert: "('a * 'a -> bool) -> 'a -> 'a list -> 'a list"} \\
-  @{index_ML remove: "('b * 'a -> bool) -> 'b -> 'a list -> 'a list"} \\
-  @{index_ML update: "('a * 'a -> bool) -> 'a -> 'a list -> 'a list"} \\
+  @{define_ML cons: "'a -> 'a list -> 'a list"} \\
+  @{define_ML member: "('b * 'a -> bool) -> 'a list -> 'b -> bool"} \\
+  @{define_ML insert: "('a * 'a -> bool) -> 'a -> 'a list -> 'a list"} \\
+  @{define_ML remove: "('b * 'a -> bool) -> 'b -> 'a list -> 'a list"} \\
+  @{define_ML update: "('a * 'a -> bool) -> 'a -> 'a list -> 'a list"} \\
   \end{mldecls}
 
   \<^descr> \<^ML>\<open>cons\<close>~\<open>x xs\<close> evaluates to \<open>x :: xs\<close>.
@@ -1539,9 +1563,9 @@
 
 text \<open>
   \begin{mldecls}
-  @{index_ML AList.lookup: "('a * 'b -> bool) -> ('b * 'c) list -> 'a -> 'c option"} \\
-  @{index_ML AList.defined: "('a * 'b -> bool) -> ('b * 'c) list -> 'a -> bool"} \\
-  @{index_ML AList.update: "('a * 'a -> bool) -> 'a * 'b -> ('a * 'b) list -> ('a * 'b) list"} \\
+  @{define_ML AList.lookup: "('a * 'b -> bool) -> ('b * 'c) list -> 'a -> 'c option"} \\
+  @{define_ML AList.defined: "('a * 'b -> bool) -> ('b * 'c) list -> 'a -> bool"} \\
+  @{define_ML AList.update: "('a * 'a -> bool) -> 'a * 'b -> ('a * 'b) list -> ('a * 'b) list"} \\
   \end{mldecls}
 
   \<^descr> \<^ML>\<open>AList.lookup\<close>, \<^ML>\<open>AList.defined\<close>, \<^ML>\<open>AList.update\<close> implement the
@@ -1569,10 +1593,10 @@
 
 text %mlref \<open>
   \begin{mldecls}
-  @{index_ML_type "'a Unsynchronized.ref"} \\
-  @{index_ML Unsynchronized.ref: "'a -> 'a Unsynchronized.ref"} \\
-  @{index_ML "!": "'a Unsynchronized.ref -> 'a"} \\
-  @{index_ML_op ":=": "'a Unsynchronized.ref * 'a -> unit"} \\
+  @{define_ML_type 'a "Unsynchronized.ref"} \\
+  @{define_ML Unsynchronized.ref: "'a -> 'a Unsynchronized.ref"} \\
+  @{define_ML "!": "'a Unsynchronized.ref -> 'a"} \\
+  @{define_ML_infix ":=" : "'a Unsynchronized.ref * 'a -> unit"} \\
   \end{mldecls}
 \<close>
 
@@ -1584,7 +1608,7 @@
 
   The unwieldy name of \<^ML>\<open>Unsynchronized.ref\<close> for the constructor for
   references in Isabelle/ML emphasizes the inconveniences caused by
-  mutability. Existing operations \<^ML>\<open>!\<close> and \<^ML_op>\<open>:=\<close> are unchanged,
+  mutability. Existing operations \<^ML>\<open>!\<close> and \<^ML_infix>\<open>:=\<close> are unchanged,
   but should be used with special precautions, say in a strictly local
   situation that is guaranteed to be restricted to sequential evaluation ---
   now and in the future.
@@ -1724,8 +1748,8 @@
 
 text %mlref \<open>
   \begin{mldecls}
-  @{index_ML File.tmp_path: "Path.T -> Path.T"} \\
-  @{index_ML serial_string: "unit -> string"} \\
+  @{define_ML File.tmp_path: "Path.T -> Path.T"} \\
+  @{define_ML serial_string: "unit -> string"} \\
   \end{mldecls}
 
   \<^descr> \<^ML>\<open>File.tmp_path\<close>~\<open>path\<close> relocates the base component of \<open>path\<close> into the
@@ -1766,9 +1790,9 @@
 
 text %mlref \<open>
   \begin{mldecls}
-  @{index_ML_type "'a Synchronized.var"} \\
-  @{index_ML Synchronized.var: "string -> 'a -> 'a Synchronized.var"} \\
-  @{index_ML Synchronized.guarded_access: "'a Synchronized.var ->
+  @{define_ML_type 'a "Synchronized.var"} \\
+  @{define_ML Synchronized.var: "string -> 'a -> 'a Synchronized.var"} \\
+  @{define_ML Synchronized.guarded_access: "'a Synchronized.var ->
   ('a -> ('b * 'a) option) -> 'b"} \\
   \end{mldecls}
 
@@ -1866,12 +1890,12 @@
 
 text %mlref \<open>
   \begin{mldecls}
-  @{index_ML_type "'a Exn.result"} \\
-  @{index_ML Exn.capture: "('a -> 'b) -> 'a -> 'b Exn.result"} \\
-  @{index_ML Exn.interruptible_capture: "('a -> 'b) -> 'a -> 'b Exn.result"} \\
-  @{index_ML Exn.release: "'a Exn.result -> 'a"} \\
-  @{index_ML Par_Exn.release_all: "'a Exn.result list -> 'a list"} \\
-  @{index_ML Par_Exn.release_first: "'a Exn.result list -> 'a list"} \\
+  @{define_ML_type 'a "Exn.result"} \\
+  @{define_ML Exn.capture: "('a -> 'b) -> 'a -> 'b Exn.result"} \\
+  @{define_ML Exn.interruptible_capture: "('a -> 'b) -> 'a -> 'b Exn.result"} \\
+  @{define_ML Exn.release: "'a Exn.result -> 'a"} \\
+  @{define_ML Par_Exn.release_all: "'a Exn.result list -> 'a list"} \\
+  @{define_ML Par_Exn.release_first: "'a Exn.result list -> 'a list"} \\
   \end{mldecls}
 
   \<^descr> Type \<^ML_type>\<open>'a Exn.result\<close> represents the disjoint sum of ML results
@@ -1921,8 +1945,8 @@
 
 text %mlref \<open>
   \begin{mldecls}
-  @{index_ML Par_List.map: "('a -> 'b) -> 'a list -> 'b list"} \\
-  @{index_ML Par_List.get_some: "('a -> 'b option) -> 'a list -> 'b option"} \\
+  @{define_ML Par_List.map: "('a -> 'b) -> 'a list -> 'b list"} \\
+  @{define_ML Par_List.get_some: "('a -> 'b option) -> 'a list -> 'b option"} \\
   \end{mldecls}
 
   \<^descr> \<^ML>\<open>Par_List.map\<close>~\<open>f [x\<^sub>1, \<dots>, x\<^sub>n]\<close> is like \<^ML>\<open>map\<close>~\<open>f [x\<^sub>1, \<dots>,
@@ -1985,10 +2009,10 @@
 
 text %mlref \<open>
   \begin{mldecls}
-  @{index_ML_type "'a lazy"} \\
-  @{index_ML Lazy.lazy: "(unit -> 'a) -> 'a lazy"} \\
-  @{index_ML Lazy.value: "'a -> 'a lazy"} \\
-  @{index_ML Lazy.force: "'a lazy -> 'a"} \\
+  @{define_ML_type 'a "lazy"} \\
+  @{define_ML Lazy.lazy: "(unit -> 'a) -> 'a lazy"} \\
+  @{define_ML Lazy.value: "'a -> 'a lazy"} \\
+  @{define_ML Lazy.force: "'a lazy -> 'a"} \\
   \end{mldecls}
 
   \<^descr> Type \<^ML_type>\<open>'a lazy\<close> represents lazy values over type \<^verbatim>\<open>'a\<close>.
@@ -2066,17 +2090,17 @@
 
 text %mlref \<open>
   \begin{mldecls}
-  @{index_ML_type "'a future"} \\
-  @{index_ML Future.fork: "(unit -> 'a) -> 'a future"} \\
-  @{index_ML Future.forks: "Future.params -> (unit -> 'a) list -> 'a future list"} \\
-  @{index_ML Future.join: "'a future -> 'a"} \\
-  @{index_ML Future.joins: "'a future list -> 'a list"} \\
-  @{index_ML Future.value: "'a -> 'a future"} \\
-  @{index_ML Future.map: "('a -> 'b) -> 'a future -> 'b future"} \\
-  @{index_ML Future.cancel: "'a future -> unit"} \\
-  @{index_ML Future.cancel_group: "Future.group -> unit"} \\[0.5ex]
-  @{index_ML Future.promise: "(unit -> unit) -> 'a future"} \\
-  @{index_ML Future.fulfill: "'a future -> 'a -> unit"} \\
+  @{define_ML_type 'a "future"} \\
+  @{define_ML Future.fork: "(unit -> 'a) -> 'a future"} \\
+  @{define_ML Future.forks: "Future.params -> (unit -> 'a) list -> 'a future list"} \\
+  @{define_ML Future.join: "'a future -> 'a"} \\
+  @{define_ML Future.joins: "'a future list -> 'a list"} \\
+  @{define_ML Future.value: "'a -> 'a future"} \\
+  @{define_ML Future.map: "('a -> 'b) -> 'a future -> 'b future"} \\
+  @{define_ML Future.cancel: "'a future -> unit"} \\
+  @{define_ML Future.cancel_group: "Future.group -> unit"} \\[0.5ex]
+  @{define_ML Future.promise: "(unit -> unit) -> 'a future"} \\
+  @{define_ML Future.fulfill: "'a future -> 'a -> unit"} \\
   \end{mldecls}
 
   \<^descr> Type \<^ML_type>\<open>'a future\<close> represents future values over type \<^verbatim>\<open>'a\<close>.
--- a/src/Doc/Implementation/Prelim.thy	Wed Mar 31 16:01:31 2021 +0200
+++ b/src/Doc/Implementation/Prelim.thy	Mon Sep 06 12:08:20 2021 +0200
@@ -108,12 +108,12 @@
 
 text %mlref \<open>
   \begin{mldecls}
-  @{index_ML_type theory} \\
-  @{index_ML Context.eq_thy: "theory * theory -> bool"} \\
-  @{index_ML Context.subthy: "theory * theory -> bool"} \\
-  @{index_ML Theory.begin_theory: "string * Position.T -> theory list -> theory"} \\
-  @{index_ML Theory.parents_of: "theory -> theory list"} \\
-  @{index_ML Theory.ancestors_of: "theory -> theory list"} \\
+  @{define_ML_type theory} \\
+  @{define_ML Context.eq_thy: "theory * theory -> bool"} \\
+  @{define_ML Context.subthy: "theory * theory -> bool"} \\
+  @{define_ML Theory.begin_theory: "string * Position.T -> theory list -> theory"} \\
+  @{define_ML Theory.parents_of: "theory -> theory list"} \\
+  @{define_ML Theory.ancestors_of: "theory -> theory list"} \\
   \end{mldecls}
 
   \<^descr> Type \<^ML_type>\<open>theory\<close> represents theory contexts.
@@ -187,10 +187,10 @@
 
 text %mlref \<open>
   \begin{mldecls}
-  @{index_ML_type Proof.context} \\
-  @{index_ML Proof_Context.init_global: "theory -> Proof.context"} \\
-  @{index_ML Proof_Context.theory_of: "Proof.context -> theory"} \\
-  @{index_ML Proof_Context.transfer: "theory -> Proof.context -> Proof.context"} \\
+  @{define_ML_type Proof.context} \\
+  @{define_ML Proof_Context.init_global: "theory -> Proof.context"} \\
+  @{define_ML Proof_Context.theory_of: "Proof.context -> theory"} \\
+  @{define_ML Proof_Context.transfer: "theory -> Proof.context -> Proof.context"} \\
   \end{mldecls}
 
   \<^descr> Type \<^ML_type>\<open>Proof.context\<close> represents proof contexts.
@@ -236,9 +236,9 @@
 
 text %mlref \<open>
   \begin{mldecls}
-  @{index_ML_type Context.generic} \\
-  @{index_ML Context.theory_of: "Context.generic -> theory"} \\
-  @{index_ML Context.proof_of: "Context.generic -> Proof.context"} \\
+  @{define_ML_type Context.generic} \\
+  @{define_ML Context.theory_of: "Context.generic -> theory"} \\
+  @{define_ML Context.proof_of: "Context.generic -> Proof.context"} \\
   \end{mldecls}
 
   \<^descr> Type \<^ML_type>\<open>Context.generic\<close> is the direct sum of \<^ML_type>\<open>theory\<close>
@@ -339,9 +339,9 @@
 
 text %mlref \<open>
   \begin{mldecls}
-  @{index_ML_functor Theory_Data} \\
-  @{index_ML_functor Proof_Data} \\
-  @{index_ML_functor Generic_Data} \\
+  @{define_ML_functor Theory_Data} \\
+  @{define_ML_functor Proof_Data} \\
+  @{define_ML_functor Generic_Data} \\
   \end{mldecls}
 
   \<^descr> \<^ML_functor>\<open>Theory_Data\<close>\<open>(spec)\<close> declares data for type \<^ML_type>\<open>theory\<close>
@@ -482,15 +482,15 @@
 
 text %mlref \<open>
   \begin{mldecls}
-  @{index_ML Config.get: "Proof.context -> 'a Config.T -> 'a"} \\
-  @{index_ML Config.map: "'a Config.T -> ('a -> 'a) -> Proof.context -> Proof.context"} \\
-  @{index_ML Attrib.setup_config_bool: "binding -> (Context.generic -> bool) ->
+  @{define_ML Config.get: "Proof.context -> 'a Config.T -> 'a"} \\
+  @{define_ML Config.map: "'a Config.T -> ('a -> 'a) -> Proof.context -> Proof.context"} \\
+  @{define_ML Attrib.setup_config_bool: "binding -> (Context.generic -> bool) ->
   bool Config.T"} \\
-  @{index_ML Attrib.setup_config_int: "binding -> (Context.generic -> int) ->
+  @{define_ML Attrib.setup_config_int: "binding -> (Context.generic -> int) ->
   int Config.T"} \\
-  @{index_ML Attrib.setup_config_real: "binding -> (Context.generic -> real) ->
+  @{define_ML Attrib.setup_config_real: "binding -> (Context.generic -> real) ->
   real Config.T"} \\
-  @{index_ML Attrib.setup_config_string: "binding -> (Context.generic -> string) ->
+  @{define_ML Attrib.setup_config_string: "binding -> (Context.generic -> string) ->
   string Config.T"} \\
   \end{mldecls}
 
@@ -613,18 +613,18 @@
 
 text %mlref \<open>
   \begin{mldecls}
-  @{index_ML Name.internal: "string -> string"} \\
-  @{index_ML Name.skolem: "string -> string"} \\
+  @{define_ML Name.internal: "string -> string"} \\
+  @{define_ML Name.skolem: "string -> string"} \\
   \end{mldecls}
   \begin{mldecls}
-  @{index_ML_type Name.context} \\
-  @{index_ML Name.context: Name.context} \\
-  @{index_ML Name.declare: "string -> Name.context -> Name.context"} \\
-  @{index_ML Name.invent: "Name.context -> string -> int -> string list"} \\
-  @{index_ML Name.variant: "string -> Name.context -> string * Name.context"} \\
+  @{define_ML_type Name.context} \\
+  @{define_ML Name.context: Name.context} \\
+  @{define_ML Name.declare: "string -> Name.context -> Name.context"} \\
+  @{define_ML Name.invent: "Name.context -> string -> int -> string list"} \\
+  @{define_ML Name.variant: "string -> Name.context -> string * Name.context"} \\
   \end{mldecls}
   \begin{mldecls}
-  @{index_ML Variable.names_of: "Proof.context -> Name.context"} \\
+  @{define_ML Variable.names_of: "Proof.context -> Name.context"} \\
   \end{mldecls}
 
   \<^descr> \<^ML>\<open>Name.internal\<close>~\<open>name\<close> produces an internal name by adding one
@@ -720,7 +720,7 @@
 
 text %mlref \<open>
   \begin{mldecls}
-  @{index_ML_type indexname: "string * int"} \\
+  @{define_ML_type indexname = "string * int"} \\
   \end{mldecls}
 
   \<^descr> Type \<^ML_type>\<open>indexname\<close> represents indexed names. This is an
@@ -755,11 +755,11 @@
 
 text %mlref \<open>
   \begin{mldecls}
-  @{index_ML Long_Name.base_name: "string -> string"} \\
-  @{index_ML Long_Name.qualifier: "string -> string"} \\
-  @{index_ML Long_Name.append: "string -> string -> string"} \\
-  @{index_ML Long_Name.implode: "string list -> string"} \\
-  @{index_ML Long_Name.explode: "string -> string list"} \\
+  @{define_ML Long_Name.base_name: "string -> string"} \\
+  @{define_ML Long_Name.qualifier: "string -> string"} \\
+  @{define_ML Long_Name.append: "string -> string -> string"} \\
+  @{define_ML Long_Name.implode: "string list -> string"} \\
+  @{define_ML Long_Name.explode: "string -> string list"} \\
   \end{mldecls}
 
   \<^descr> \<^ML>\<open>Long_Name.base_name\<close>~\<open>name\<close> returns the base name of a long name.
@@ -832,29 +832,29 @@
 
 text %mlref \<open>
   \begin{mldecls}
-  @{index_ML_type binding} \\
-  @{index_ML Binding.empty: binding} \\
-  @{index_ML Binding.name: "string -> binding"} \\
-  @{index_ML Binding.qualify: "bool -> string -> binding -> binding"} \\
-  @{index_ML Binding.prefix: "bool -> string -> binding -> binding"} \\
-  @{index_ML Binding.concealed: "binding -> binding"} \\
-  @{index_ML Binding.print: "binding -> string"} \\
+  @{define_ML_type binding} \\
+  @{define_ML Binding.empty: binding} \\
+  @{define_ML Binding.name: "string -> binding"} \\
+  @{define_ML Binding.qualify: "bool -> string -> binding -> binding"} \\
+  @{define_ML Binding.prefix: "bool -> string -> binding -> binding"} \\
+  @{define_ML Binding.concealed: "binding -> binding"} \\
+  @{define_ML Binding.print: "binding -> string"} \\
   \end{mldecls}
   \begin{mldecls}
-  @{index_ML_type Name_Space.naming} \\
-  @{index_ML Name_Space.global_naming: Name_Space.naming} \\
-  @{index_ML Name_Space.add_path: "string -> Name_Space.naming -> Name_Space.naming"} \\
-  @{index_ML Name_Space.full_name: "Name_Space.naming -> binding -> string"} \\
+  @{define_ML_type Name_Space.naming} \\
+  @{define_ML Name_Space.global_naming: Name_Space.naming} \\
+  @{define_ML Name_Space.add_path: "string -> Name_Space.naming -> Name_Space.naming"} \\
+  @{define_ML Name_Space.full_name: "Name_Space.naming -> binding -> string"} \\
   \end{mldecls}
   \begin{mldecls}
-  @{index_ML_type Name_Space.T} \\
-  @{index_ML Name_Space.empty: "string -> Name_Space.T"} \\
-  @{index_ML Name_Space.merge: "Name_Space.T * Name_Space.T -> Name_Space.T"} \\
-  @{index_ML Name_Space.declare: "Context.generic -> bool ->
+  @{define_ML_type Name_Space.T} \\
+  @{define_ML Name_Space.empty: "string -> Name_Space.T"} \\
+  @{define_ML Name_Space.merge: "Name_Space.T * Name_Space.T -> Name_Space.T"} \\
+  @{define_ML Name_Space.declare: "Context.generic -> bool ->
   binding -> Name_Space.T -> string * Name_Space.T"} \\
-  @{index_ML Name_Space.intern: "Name_Space.T -> string -> string"} \\
-  @{index_ML Name_Space.extern: "Proof.context -> Name_Space.T -> string -> string"} \\
-  @{index_ML Name_Space.is_concealed: "Name_Space.T -> string -> bool"}
+  @{define_ML Name_Space.intern: "Name_Space.T -> string -> string"} \\
+  @{define_ML Name_Space.extern: "Proof.context -> Name_Space.T -> string -> string"} \\
+  @{define_ML Name_Space.is_concealed: "Name_Space.T -> string -> bool"}
   \end{mldecls}
 
   \<^descr> Type \<^ML_type>\<open>binding\<close> represents the abstract concept of name bindings.
--- a/src/Doc/Implementation/Proof.thy	Wed Mar 31 16:01:31 2021 +0200
+++ b/src/Doc/Implementation/Proof.thy	Mon Sep 06 12:08:20 2021 +0200
@@ -92,18 +92,18 @@
 
 text %mlref \<open>
   \begin{mldecls}
-  @{index_ML Variable.add_fixes: "
+  @{define_ML Variable.add_fixes: "
   string list -> Proof.context -> string list * Proof.context"} \\
-  @{index_ML Variable.variant_fixes: "
+  @{define_ML Variable.variant_fixes: "
   string list -> Proof.context -> string list * Proof.context"} \\
-  @{index_ML Variable.declare_term: "term -> Proof.context -> Proof.context"} \\
-  @{index_ML Variable.declare_constraints: "term -> Proof.context -> Proof.context"} \\
-  @{index_ML Variable.export: "Proof.context -> Proof.context -> thm list -> thm list"} \\
-  @{index_ML Variable.polymorphic: "Proof.context -> term list -> term list"} \\
-  @{index_ML Variable.import: "bool -> thm list -> Proof.context ->
+  @{define_ML Variable.declare_term: "term -> Proof.context -> Proof.context"} \\
+  @{define_ML Variable.declare_constraints: "term -> Proof.context -> Proof.context"} \\
+  @{define_ML Variable.export: "Proof.context -> Proof.context -> thm list -> thm list"} \\
+  @{define_ML Variable.polymorphic: "Proof.context -> term list -> term list"} \\
+  @{define_ML Variable.import: "bool -> thm list -> Proof.context ->
   ((((indexname * sort) * ctyp) list * ((indexname * typ) * cterm) list) * thm list)
     * Proof.context"} \\
-  @{index_ML Variable.focus: "binding list option -> term -> Proof.context ->
+  @{define_ML Variable.focus: "binding list option -> term -> Proof.context ->
   ((string * (string * typ)) list * term) * Proof.context"} \\
   \end{mldecls}
 
@@ -263,14 +263,14 @@
 
 text %mlref \<open>
   \begin{mldecls}
-  @{index_ML_type Assumption.export} \\
-  @{index_ML Assumption.assume: "Proof.context -> cterm -> thm"} \\
-  @{index_ML Assumption.add_assms:
+  @{define_ML_type Assumption.export} \\
+  @{define_ML Assumption.assume: "Proof.context -> cterm -> thm"} \\
+  @{define_ML Assumption.add_assms:
     "Assumption.export ->
   cterm list -> Proof.context -> thm list * Proof.context"} \\
-  @{index_ML Assumption.add_assumes: "
+  @{define_ML Assumption.add_assumes: "
   cterm list -> Proof.context -> thm list * Proof.context"} \\
-  @{index_ML Assumption.export: "bool -> Proof.context -> Proof.context -> thm -> thm"} \\
+  @{define_ML Assumption.export: "bool -> Proof.context -> Proof.context -> thm -> thm"} \\
   \end{mldecls}
 
   \<^descr> Type \<^ML_type>\<open>Assumption.export\<close> represents arbitrary export rules, which
@@ -359,31 +359,31 @@
 
 text %mlref \<open>
   \begin{mldecls}
-  @{index_ML SUBPROOF: "(Subgoal.focus -> tactic) ->
+  @{define_ML SUBPROOF: "(Subgoal.focus -> tactic) ->
   Proof.context -> int -> tactic"} \\
-  @{index_ML Subgoal.FOCUS: "(Subgoal.focus -> tactic) ->
+  @{define_ML Subgoal.FOCUS: "(Subgoal.focus -> tactic) ->
   Proof.context -> int -> tactic"} \\
-  @{index_ML Subgoal.FOCUS_PREMS: "(Subgoal.focus -> tactic) ->
+  @{define_ML Subgoal.FOCUS_PREMS: "(Subgoal.focus -> tactic) ->
   Proof.context -> int -> tactic"} \\
-  @{index_ML Subgoal.FOCUS_PARAMS: "(Subgoal.focus -> tactic) ->
+  @{define_ML Subgoal.FOCUS_PARAMS: "(Subgoal.focus -> tactic) ->
   Proof.context -> int -> tactic"} \\
-  @{index_ML Subgoal.focus: "Proof.context -> int -> binding list option ->
+  @{define_ML Subgoal.focus: "Proof.context -> int -> binding list option ->
   thm -> Subgoal.focus * thm"} \\
-  @{index_ML Subgoal.focus_prems: "Proof.context -> int -> binding list option ->
+  @{define_ML Subgoal.focus_prems: "Proof.context -> int -> binding list option ->
   thm -> Subgoal.focus * thm"} \\
-  @{index_ML Subgoal.focus_params: "Proof.context -> int -> binding list option ->
+  @{define_ML Subgoal.focus_params: "Proof.context -> int -> binding list option ->
   thm -> Subgoal.focus * thm"} \\
   \end{mldecls}
 
   \begin{mldecls}
-  @{index_ML Goal.prove: "Proof.context -> string list -> term list -> term ->
+  @{define_ML Goal.prove: "Proof.context -> string list -> term list -> term ->
   ({prems: thm list, context: Proof.context} -> tactic) -> thm"} \\
-  @{index_ML Goal.prove_common: "Proof.context -> int option ->
+  @{define_ML Goal.prove_common: "Proof.context -> int option ->
   string list -> term list -> term list ->
   ({prems: thm list, context: Proof.context} -> tactic) -> thm list"} \\
   \end{mldecls}
   \begin{mldecls}
-  @{index_ML Obtain.result: "(Proof.context -> tactic) -> thm list ->
+  @{define_ML Obtain.result: "(Proof.context -> tactic) -> thm list ->
   Proof.context -> ((string * cterm) list * thm list) * Proof.context"} \\
   \end{mldecls}
 
--- a/src/Doc/Implementation/Syntax.thy	Wed Mar 31 16:01:31 2021 +0200
+++ b/src/Doc/Implementation/Syntax.thy	Mon Sep 06 12:08:20 2021 +0200
@@ -69,16 +69,16 @@
 
 text %mlref \<open>
   \begin{mldecls}
-  @{index_ML Syntax.read_typs: "Proof.context -> string list -> typ list"} \\
-  @{index_ML Syntax.read_terms: "Proof.context -> string list -> term list"} \\
-  @{index_ML Syntax.read_props: "Proof.context -> string list -> term list"} \\[0.5ex]
-  @{index_ML Syntax.read_typ: "Proof.context -> string -> typ"} \\
-  @{index_ML Syntax.read_term: "Proof.context -> string -> term"} \\
-  @{index_ML Syntax.read_prop: "Proof.context -> string -> term"} \\[0.5ex]
-  @{index_ML Syntax.pretty_typ: "Proof.context -> typ -> Pretty.T"} \\
-  @{index_ML Syntax.pretty_term: "Proof.context -> term -> Pretty.T"} \\
-  @{index_ML Syntax.string_of_typ: "Proof.context -> typ -> string"} \\
-  @{index_ML Syntax.string_of_term: "Proof.context -> term -> string"} \\
+  @{define_ML Syntax.read_typs: "Proof.context -> string list -> typ list"} \\
+  @{define_ML Syntax.read_terms: "Proof.context -> string list -> term list"} \\
+  @{define_ML Syntax.read_props: "Proof.context -> string list -> term list"} \\[0.5ex]
+  @{define_ML Syntax.read_typ: "Proof.context -> string -> typ"} \\
+  @{define_ML Syntax.read_term: "Proof.context -> string -> term"} \\
+  @{define_ML Syntax.read_prop: "Proof.context -> string -> term"} \\[0.5ex]
+  @{define_ML Syntax.pretty_typ: "Proof.context -> typ -> Pretty.T"} \\
+  @{define_ML Syntax.pretty_term: "Proof.context -> term -> Pretty.T"} \\
+  @{define_ML Syntax.string_of_typ: "Proof.context -> typ -> string"} \\
+  @{define_ML Syntax.string_of_term: "Proof.context -> term -> string"} \\
   \end{mldecls}
 
   \<^descr> \<^ML>\<open>Syntax.read_typs\<close>~\<open>ctxt strs\<close> parses and checks a simultaneous list
@@ -158,11 +158,11 @@
 
 text %mlref \<open>
   \begin{mldecls}
-  @{index_ML Syntax.parse_typ: "Proof.context -> string -> typ"} \\
-  @{index_ML Syntax.parse_term: "Proof.context -> string -> term"} \\
-  @{index_ML Syntax.parse_prop: "Proof.context -> string -> term"} \\[0.5ex]
-  @{index_ML Syntax.unparse_typ: "Proof.context -> typ -> Pretty.T"} \\
-  @{index_ML Syntax.unparse_term: "Proof.context -> term -> Pretty.T"} \\
+  @{define_ML Syntax.parse_typ: "Proof.context -> string -> typ"} \\
+  @{define_ML Syntax.parse_term: "Proof.context -> string -> term"} \\
+  @{define_ML Syntax.parse_prop: "Proof.context -> string -> term"} \\[0.5ex]
+  @{define_ML Syntax.unparse_typ: "Proof.context -> typ -> Pretty.T"} \\
+  @{define_ML Syntax.unparse_term: "Proof.context -> term -> Pretty.T"} \\
   \end{mldecls}
 
   \<^descr> \<^ML>\<open>Syntax.parse_typ\<close>~\<open>ctxt str\<close> parses a source string as pre-type that
@@ -219,11 +219,11 @@
 
 text %mlref \<open>
   \begin{mldecls}
-  @{index_ML Syntax.check_typs: "Proof.context -> typ list -> typ list"} \\
-  @{index_ML Syntax.check_terms: "Proof.context -> term list -> term list"} \\
-  @{index_ML Syntax.check_props: "Proof.context -> term list -> term list"} \\[0.5ex]
-  @{index_ML Syntax.uncheck_typs: "Proof.context -> typ list -> typ list"} \\
-  @{index_ML Syntax.uncheck_terms: "Proof.context -> term list -> term list"} \\
+  @{define_ML Syntax.check_typs: "Proof.context -> typ list -> typ list"} \\
+  @{define_ML Syntax.check_terms: "Proof.context -> term list -> term list"} \\
+  @{define_ML Syntax.check_props: "Proof.context -> term list -> term list"} \\[0.5ex]
+  @{define_ML Syntax.uncheck_typs: "Proof.context -> typ list -> typ list"} \\
+  @{define_ML Syntax.uncheck_terms: "Proof.context -> term list -> term list"} \\
   \end{mldecls}
 
   \<^descr> \<^ML>\<open>Syntax.check_typs\<close>~\<open>ctxt Ts\<close> checks a simultaneous list of pre-types
--- a/src/Doc/Implementation/Tactic.thy	Wed Mar 31 16:01:31 2021 +0200
+++ b/src/Doc/Implementation/Tactic.thy	Mon Sep 06 12:08:20 2021 +0200
@@ -61,10 +61,10 @@
 
 text %mlref \<open>
   \begin{mldecls}
-  @{index_ML Goal.init: "cterm -> thm"} \\
-  @{index_ML Goal.finish: "Proof.context -> thm -> thm"} \\
-  @{index_ML Goal.protect: "int -> thm -> thm"} \\
-  @{index_ML Goal.conclude: "thm -> thm"} \\
+  @{define_ML Goal.init: "cterm -> thm"} \\
+  @{define_ML Goal.finish: "Proof.context -> thm -> thm"} \\
+  @{define_ML Goal.protect: "int -> thm -> thm"} \\
+  @{define_ML Goal.conclude: "thm -> thm"} \\
   \end{mldecls}
 
   \<^descr> \<^ML>\<open>Goal.init\<close>~\<open>C\<close> initializes a tactical goal from the well-formed
@@ -156,15 +156,15 @@
 
 text %mlref \<open>
   \begin{mldecls}
-  @{index_ML_type tactic: "thm -> thm Seq.seq"} \\
-  @{index_ML no_tac: tactic} \\
-  @{index_ML all_tac: tactic} \\
-  @{index_ML print_tac: "Proof.context -> string -> tactic"} \\[1ex]
-  @{index_ML PRIMITIVE: "(thm -> thm) -> tactic"} \\[1ex]
-  @{index_ML SUBGOAL: "(term * int -> tactic) -> int -> tactic"} \\
-  @{index_ML CSUBGOAL: "(cterm * int -> tactic) -> int -> tactic"} \\
-  @{index_ML SELECT_GOAL: "tactic -> int -> tactic"} \\
-  @{index_ML PREFER_GOAL: "tactic -> int -> tactic"} \\
+  @{define_ML_type tactic = "thm -> thm Seq.seq"} \\
+  @{define_ML no_tac: tactic} \\
+  @{define_ML all_tac: tactic} \\
+  @{define_ML print_tac: "Proof.context -> string -> tactic"} \\[1ex]
+  @{define_ML PRIMITIVE: "(thm -> thm) -> tactic"} \\[1ex]
+  @{define_ML SUBGOAL: "(term * int -> tactic) -> int -> tactic"} \\
+  @{define_ML CSUBGOAL: "(cterm * int -> tactic) -> int -> tactic"} \\
+  @{define_ML SELECT_GOAL: "tactic -> int -> tactic"} \\
+  @{define_ML PREFER_GOAL: "tactic -> int -> tactic"} \\
   \end{mldecls}
 
   \<^descr> Type \<^ML_type>\<open>tactic\<close> represents tactics. The well-formedness conditions
@@ -243,17 +243,17 @@
 
 text %mlref \<open>
   \begin{mldecls}
-  @{index_ML resolve_tac: "Proof.context -> thm list -> int -> tactic"} \\
-  @{index_ML eresolve_tac: "Proof.context -> thm list -> int -> tactic"} \\
-  @{index_ML dresolve_tac: "Proof.context -> thm list -> int -> tactic"} \\
-  @{index_ML forward_tac: "Proof.context -> thm list -> int -> tactic"} \\
-  @{index_ML biresolve_tac: "Proof.context -> (bool * thm) list -> int -> tactic"} \\[1ex]
-  @{index_ML assume_tac: "Proof.context -> int -> tactic"} \\
-  @{index_ML eq_assume_tac: "int -> tactic"} \\[1ex]
-  @{index_ML match_tac: "Proof.context -> thm list -> int -> tactic"} \\
-  @{index_ML ematch_tac: "Proof.context -> thm list -> int -> tactic"} \\
-  @{index_ML dmatch_tac: "Proof.context -> thm list -> int -> tactic"} \\
-  @{index_ML bimatch_tac: "Proof.context -> (bool * thm) list -> int -> tactic"} \\
+  @{define_ML resolve_tac: "Proof.context -> thm list -> int -> tactic"} \\
+  @{define_ML eresolve_tac: "Proof.context -> thm list -> int -> tactic"} \\
+  @{define_ML dresolve_tac: "Proof.context -> thm list -> int -> tactic"} \\
+  @{define_ML forward_tac: "Proof.context -> thm list -> int -> tactic"} \\
+  @{define_ML biresolve_tac: "Proof.context -> (bool * thm) list -> int -> tactic"} \\[1ex]
+  @{define_ML assume_tac: "Proof.context -> int -> tactic"} \\
+  @{define_ML eq_assume_tac: "int -> tactic"} \\[1ex]
+  @{define_ML match_tac: "Proof.context -> thm list -> int -> tactic"} \\
+  @{define_ML ematch_tac: "Proof.context -> thm list -> int -> tactic"} \\
+  @{define_ML dmatch_tac: "Proof.context -> thm list -> int -> tactic"} \\
+  @{define_ML bimatch_tac: "Proof.context -> (bool * thm) list -> int -> tactic"} \\
   \end{mldecls}
 
   \<^descr> \<^ML>\<open>resolve_tac\<close>~\<open>ctxt thms i\<close> refines the goal state using the given
@@ -351,23 +351,23 @@
 
 text %mlref \<open>
   \begin{mldecls}
-  @{index_ML Rule_Insts.res_inst_tac: "Proof.context ->
+  @{define_ML Rule_Insts.res_inst_tac: "Proof.context ->
     ((indexname * Position.T) * string) list -> (binding * string option * mixfix) list ->
     thm -> int -> tactic"} \\
-  @{index_ML Rule_Insts.eres_inst_tac: "Proof.context ->
+  @{define_ML Rule_Insts.eres_inst_tac: "Proof.context ->
     ((indexname * Position.T) * string) list -> (binding * string option * mixfix) list ->
     thm -> int -> tactic"} \\
-  @{index_ML Rule_Insts.dres_inst_tac: "Proof.context ->
+  @{define_ML Rule_Insts.dres_inst_tac: "Proof.context ->
     ((indexname * Position.T) * string) list -> (binding * string option * mixfix) list ->
     thm -> int -> tactic"} \\
-  @{index_ML Rule_Insts.forw_inst_tac: "Proof.context ->
+  @{define_ML Rule_Insts.forw_inst_tac: "Proof.context ->
     ((indexname * Position.T) * string) list -> (binding * string option * mixfix) list ->
     thm -> int -> tactic"} \\
-  @{index_ML Rule_Insts.subgoal_tac: "Proof.context -> string ->
+  @{define_ML Rule_Insts.subgoal_tac: "Proof.context -> string ->
     (binding * string option * mixfix) list -> int -> tactic"} \\
-  @{index_ML Rule_Insts.thin_tac: "Proof.context -> string ->
+  @{define_ML Rule_Insts.thin_tac: "Proof.context -> string ->
     (binding * string option * mixfix) list -> int -> tactic"} \\
-  @{index_ML rename_tac: "string list -> int -> tactic"} \\
+  @{define_ML rename_tac: "string list -> int -> tactic"} \\
   \end{mldecls}
 
   \<^descr> \<^ML>\<open>Rule_Insts.res_inst_tac\<close>~\<open>ctxt insts thm i\<close> instantiates the rule
@@ -415,9 +415,9 @@
 
 text %mlref \<open>
   \begin{mldecls}
-  @{index_ML rotate_tac: "int -> int -> tactic"} \\
-  @{index_ML distinct_subgoals_tac: tactic} \\
-  @{index_ML flexflex_tac: "Proof.context -> tactic"} \\
+  @{define_ML rotate_tac: "int -> int -> tactic"} \\
+  @{define_ML distinct_subgoals_tac: tactic} \\
+  @{define_ML flexflex_tac: "Proof.context -> tactic"} \\
   \end{mldecls}
 
   \<^descr> \<^ML>\<open>rotate_tac\<close>~\<open>n i\<close> rotates the premises of subgoal \<open>i\<close> by \<open>n\<close>
@@ -450,9 +450,9 @@
 
 text %mlref \<open>
   \begin{mldecls}
-  @{index_ML compose_tac: "Proof.context -> (bool * thm * int) -> int -> tactic"} \\
-  @{index_ML Drule.compose: "thm * int * thm -> thm"} \\
-  @{index_ML_op COMP: "thm * thm -> thm"} \\
+  @{define_ML compose_tac: "Proof.context -> (bool * thm * int) -> int -> tactic"} \\
+  @{define_ML Drule.compose: "thm * int * thm -> thm"} \\
+  @{define_ML_infix COMP: "thm * thm -> thm"} \\
   \end{mldecls}
 
   \<^descr> \<^ML>\<open>compose_tac\<close>~\<open>ctxt (flag, rule, m) i\<close> refines subgoal \<open>i\<close> using
@@ -494,53 +494,53 @@
 text \<open>
   Sequential composition and alternative choices are the most basic ways to
   combine tactics, similarly to ``\<^verbatim>\<open>,\<close>'' and ``\<^verbatim>\<open>|\<close>'' in Isar method notation.
-  This corresponds to \<^ML_op>\<open>THEN\<close> and \<^ML_op>\<open>ORELSE\<close> in ML, but there
+  This corresponds to \<^ML_infix>\<open>THEN\<close> and \<^ML_infix>\<open>ORELSE\<close> in ML, but there
   are further possibilities for fine-tuning alternation of tactics such as
-  \<^ML_op>\<open>APPEND\<close>. Further details become visible in ML due to explicit
+  \<^ML_infix>\<open>APPEND\<close>. Further details become visible in ML due to explicit
   subgoal addressing.
 \<close>
 
 text %mlref \<open>
   \begin{mldecls}
-  @{index_ML_op "THEN": "tactic * tactic -> tactic"} \\
-  @{index_ML_op "ORELSE": "tactic * tactic -> tactic"} \\
-  @{index_ML_op "APPEND": "tactic * tactic -> tactic"} \\
-  @{index_ML "EVERY": "tactic list -> tactic"} \\
-  @{index_ML "FIRST": "tactic list -> tactic"} \\[0.5ex]
+  @{define_ML_infix "THEN": "tactic * tactic -> tactic"} \\
+  @{define_ML_infix "ORELSE": "tactic * tactic -> tactic"} \\
+  @{define_ML_infix "APPEND": "tactic * tactic -> tactic"} \\
+  @{define_ML "EVERY": "tactic list -> tactic"} \\
+  @{define_ML "FIRST": "tactic list -> tactic"} \\[0.5ex]
 
-  @{index_ML_op "THEN'": "('a -> tactic) * ('a -> tactic) -> 'a -> tactic"} \\
-  @{index_ML_op "ORELSE'": "('a -> tactic) * ('a -> tactic) -> 'a -> tactic"} \\
-  @{index_ML_op "APPEND'": "('a -> tactic) * ('a -> tactic) -> 'a -> tactic"} \\
-  @{index_ML "EVERY'": "('a -> tactic) list -> 'a -> tactic"} \\
-  @{index_ML "FIRST'": "('a -> tactic) list -> 'a -> tactic"} \\
+  @{define_ML_infix "THEN'": "('a -> tactic) * ('a -> tactic) -> 'a -> tactic"} \\
+  @{define_ML_infix "ORELSE'": "('a -> tactic) * ('a -> tactic) -> 'a -> tactic"} \\
+  @{define_ML_infix "APPEND'": "('a -> tactic) * ('a -> tactic) -> 'a -> tactic"} \\
+  @{define_ML "EVERY'": "('a -> tactic) list -> 'a -> tactic"} \\
+  @{define_ML "FIRST'": "('a -> tactic) list -> 'a -> tactic"} \\
   \end{mldecls}
 
-  \<^descr> \<open>tac\<^sub>1\<close>~\<^ML_op>\<open>THEN\<close>~\<open>tac\<^sub>2\<close> is the sequential composition of \<open>tac\<^sub>1\<close> and
+  \<^descr> \<open>tac\<^sub>1\<close>~\<^ML_infix>\<open>THEN\<close>~\<open>tac\<^sub>2\<close> is the sequential composition of \<open>tac\<^sub>1\<close> and
   \<open>tac\<^sub>2\<close>. Applied to a goal state, it returns all states reachable in two
   steps by applying \<open>tac\<^sub>1\<close> followed by \<open>tac\<^sub>2\<close>. First, it applies \<open>tac\<^sub>1\<close> to
   the goal state, getting a sequence of possible next states; then, it applies
   \<open>tac\<^sub>2\<close> to each of these and concatenates the results to produce again one
   flat sequence of states.
 
-  \<^descr> \<open>tac\<^sub>1\<close>~\<^ML_op>\<open>ORELSE\<close>~\<open>tac\<^sub>2\<close> makes a choice between \<open>tac\<^sub>1\<close> and
+  \<^descr> \<open>tac\<^sub>1\<close>~\<^ML_infix>\<open>ORELSE\<close>~\<open>tac\<^sub>2\<close> makes a choice between \<open>tac\<^sub>1\<close> and
   \<open>tac\<^sub>2\<close>. Applied to a state, it tries \<open>tac\<^sub>1\<close> and returns the result if
   non-empty; if \<open>tac\<^sub>1\<close> fails then it uses \<open>tac\<^sub>2\<close>. This is a deterministic
   choice: if \<open>tac\<^sub>1\<close> succeeds then \<open>tac\<^sub>2\<close> is excluded from the result.
 
-  \<^descr> \<open>tac\<^sub>1\<close>~\<^ML_op>\<open>APPEND\<close>~\<open>tac\<^sub>2\<close> concatenates the possible results of
-  \<open>tac\<^sub>1\<close> and \<open>tac\<^sub>2\<close>. Unlike \<^ML_op>\<open>ORELSE\<close> there is \<^emph>\<open>no commitment\<close> to
-  either tactic, so \<^ML_op>\<open>APPEND\<close> helps to avoid incompleteness during
+  \<^descr> \<open>tac\<^sub>1\<close>~\<^ML_infix>\<open>APPEND\<close>~\<open>tac\<^sub>2\<close> concatenates the possible results of
+  \<open>tac\<^sub>1\<close> and \<open>tac\<^sub>2\<close>. Unlike \<^ML_infix>\<open>ORELSE\<close> there is \<^emph>\<open>no commitment\<close> to
+  either tactic, so \<^ML_infix>\<open>APPEND\<close> helps to avoid incompleteness during
   search, at the cost of potential inefficiencies.
 
-  \<^descr> \<^ML>\<open>EVERY\<close>~\<open>[tac\<^sub>1, \<dots>, tac\<^sub>n]\<close> abbreviates \<open>tac\<^sub>1\<close>~\<^ML_op>\<open>THEN\<close>~\<open>\<dots>\<close>~\<^ML_op>\<open>THEN\<close>~\<open>tac\<^sub>n\<close>. Note that \<^ML>\<open>EVERY []\<close> is the same as
+  \<^descr> \<^ML>\<open>EVERY\<close>~\<open>[tac\<^sub>1, \<dots>, tac\<^sub>n]\<close> abbreviates \<open>tac\<^sub>1\<close>~\<^ML_infix>\<open>THEN\<close>~\<open>\<dots>\<close>~\<^ML_infix>\<open>THEN\<close>~\<open>tac\<^sub>n\<close>. Note that \<^ML>\<open>EVERY []\<close> is the same as
   \<^ML>\<open>all_tac\<close>: it always succeeds.
 
-  \<^descr> \<^ML>\<open>FIRST\<close>~\<open>[tac\<^sub>1, \<dots>, tac\<^sub>n]\<close> abbreviates \<open>tac\<^sub>1\<close>~\<^ML_op>\<open>ORELSE\<close>~\<open>\<dots>\<close>~\<^ML_op>\<open>ORELSE\<close>~\<open>tac\<^sub>n\<close>. Note that \<^ML>\<open>FIRST []\<close> is the
+  \<^descr> \<^ML>\<open>FIRST\<close>~\<open>[tac\<^sub>1, \<dots>, tac\<^sub>n]\<close> abbreviates \<open>tac\<^sub>1\<close>~\<^ML_infix>\<open>ORELSE\<close>~\<open>\<dots>\<close>~\<^ML_infix>\<open>ORELSE\<close>~\<open>tac\<^sub>n\<close>. Note that \<^ML>\<open>FIRST []\<close> is the
   same as \<^ML>\<open>no_tac\<close>: it always fails.
 
-  \<^descr> \<^ML_op>\<open>THEN'\<close> is the lifted version of \<^ML_op>\<open>THEN\<close>, for tactics
-  with explicit subgoal addressing. So \<open>(tac\<^sub>1\<close>~\<^ML_op>\<open>THEN'\<close>~\<open>tac\<^sub>2) i\<close> is
-  the same as \<open>(tac\<^sub>1 i\<close>~\<^ML_op>\<open>THEN\<close>~\<open>tac\<^sub>2 i)\<close>.
+  \<^descr> \<^ML_infix>\<open>THEN'\<close> is the lifted version of \<^ML_infix>\<open>THEN\<close>, for tactics
+  with explicit subgoal addressing. So \<open>(tac\<^sub>1\<close>~\<^ML_infix>\<open>THEN'\<close>~\<open>tac\<^sub>2) i\<close> is
+  the same as \<open>(tac\<^sub>1 i\<close>~\<^ML_infix>\<open>THEN\<close>~\<open>tac\<^sub>2 i)\<close>.
 
   The other primed tacticals work analogously.
 \<close>
@@ -555,11 +555,11 @@
 
 text %mlref \<open>
   \begin{mldecls}
-  @{index_ML "TRY": "tactic -> tactic"} \\
-  @{index_ML "REPEAT": "tactic -> tactic"} \\
-  @{index_ML "REPEAT1": "tactic -> tactic"} \\
-  @{index_ML "REPEAT_DETERM": "tactic -> tactic"} \\
-  @{index_ML "REPEAT_DETERM_N": "int -> tactic -> tactic"} \\
+  @{define_ML "TRY": "tactic -> tactic"} \\
+  @{define_ML "REPEAT": "tactic -> tactic"} \\
+  @{define_ML "REPEAT1": "tactic -> tactic"} \\
+  @{define_ML "REPEAT_DETERM": "tactic -> tactic"} \\
+  @{define_ML "REPEAT_DETERM_N": "int -> tactic -> tactic"} \\
   \end{mldecls}
 
   \<^descr> \<^ML>\<open>TRY\<close>~\<open>tac\<close> applies \<open>tac\<close> to the goal state and returns the resulting
@@ -567,7 +567,7 @@
   applies \<open>tac\<close> at most once.
 
   Note that for tactics with subgoal addressing, the combinator can be applied
-  via functional composition: \<^ML>\<open>TRY\<close>~\<^ML_op>\<open>o\<close>~\<open>tac\<close>. There is no need
+  via functional composition: \<^ML>\<open>TRY\<close>~\<^ML_infix>\<open>o\<close>~\<open>tac\<close>. There is no need
   for \<^verbatim>\<open>TRY'\<close>.
 
   \<^descr> \<^ML>\<open>REPEAT\<close>~\<open>tac\<close> applies \<open>tac\<close> to the goal state and, recursively, to
@@ -592,10 +592,10 @@
 text %mlex \<open>
   The basic tactics and tacticals considered above follow some algebraic laws:
 
-  \<^item> \<^ML>\<open>all_tac\<close> is the identity element of the tactical \<^ML_op>\<open>THEN\<close>.
+  \<^item> \<^ML>\<open>all_tac\<close> is the identity element of the tactical \<^ML_infix>\<open>THEN\<close>.
 
-  \<^item> \<^ML>\<open>no_tac\<close> is the identity element of \<^ML_op>\<open>ORELSE\<close> and \<^ML_op>\<open>APPEND\<close>. Also, it is a zero element for \<^ML_op>\<open>THEN\<close>, which means that
-  \<open>tac\<close>~\<^ML_op>\<open>THEN\<close>~\<^ML>\<open>no_tac\<close> is equivalent to \<^ML>\<open>no_tac\<close>.
+  \<^item> \<^ML>\<open>no_tac\<close> is the identity element of \<^ML_infix>\<open>ORELSE\<close> and \<^ML_infix>\<open>APPEND\<close>. Also, it is a zero element for \<^ML_infix>\<open>THEN\<close>, which means that
+  \<open>tac\<close>~\<^ML_infix>\<open>THEN\<close>~\<^ML>\<open>no_tac\<close> is equivalent to \<^ML>\<open>no_tac\<close>.
 
   \<^item> \<^ML>\<open>TRY\<close> and \<^ML>\<open>REPEAT\<close> can be expressed as (recursive) functions over
   more basic combinators (ignoring some internal implementation tricks):
@@ -607,7 +607,7 @@
 \<close>
 
 text \<open>
-  If \<open>tac\<close> can return multiple outcomes then so can \<^ML>\<open>REPEAT\<close>~\<open>tac\<close>. \<^ML>\<open>REPEAT\<close> uses \<^ML_op>\<open>ORELSE\<close> and not \<^ML_op>\<open>APPEND\<close>, it applies \<open>tac\<close>
+  If \<open>tac\<close> can return multiple outcomes then so can \<^ML>\<open>REPEAT\<close>~\<open>tac\<close>. \<^ML>\<open>REPEAT\<close> uses \<^ML_infix>\<open>ORELSE\<close> and not \<^ML_infix>\<open>APPEND\<close>, it applies \<open>tac\<close>
   as many times as possible in each outcome.
 
   \begin{warn}
@@ -641,20 +641,20 @@
 
 text %mlref \<open>
   \begin{mldecls}
-  @{index_ML ALLGOALS: "(int -> tactic) -> tactic"} \\
-  @{index_ML SOMEGOAL: "(int -> tactic) -> tactic"} \\
-  @{index_ML FIRSTGOAL: "(int -> tactic) -> tactic"} \\
-  @{index_ML HEADGOAL: "(int -> tactic) -> tactic"} \\
-  @{index_ML REPEAT_SOME: "(int -> tactic) -> tactic"} \\
-  @{index_ML REPEAT_FIRST: "(int -> tactic) -> tactic"} \\
-  @{index_ML RANGE: "(int -> tactic) list -> int -> tactic"} \\
+  @{define_ML ALLGOALS: "(int -> tactic) -> tactic"} \\
+  @{define_ML SOMEGOAL: "(int -> tactic) -> tactic"} \\
+  @{define_ML FIRSTGOAL: "(int -> tactic) -> tactic"} \\
+  @{define_ML HEADGOAL: "(int -> tactic) -> tactic"} \\
+  @{define_ML REPEAT_SOME: "(int -> tactic) -> tactic"} \\
+  @{define_ML REPEAT_FIRST: "(int -> tactic) -> tactic"} \\
+  @{define_ML RANGE: "(int -> tactic) list -> int -> tactic"} \\
   \end{mldecls}
 
-  \<^descr> \<^ML>\<open>ALLGOALS\<close>~\<open>tac\<close> is equivalent to \<open>tac n\<close>~\<^ML_op>\<open>THEN\<close>~\<open>\<dots>\<close>~\<^ML_op>\<open>THEN\<close>~\<open>tac 1\<close>. It applies the \<open>tac\<close> to all the subgoals, counting downwards.
+  \<^descr> \<^ML>\<open>ALLGOALS\<close>~\<open>tac\<close> is equivalent to \<open>tac n\<close>~\<^ML_infix>\<open>THEN\<close>~\<open>\<dots>\<close>~\<^ML_infix>\<open>THEN\<close>~\<open>tac 1\<close>. It applies the \<open>tac\<close> to all the subgoals, counting downwards.
 
-  \<^descr> \<^ML>\<open>SOMEGOAL\<close>~\<open>tac\<close> is equivalent to \<open>tac n\<close>~\<^ML_op>\<open>ORELSE\<close>~\<open>\<dots>\<close>~\<^ML_op>\<open>ORELSE\<close>~\<open>tac 1\<close>. It applies \<open>tac\<close> to one subgoal, counting downwards.
+  \<^descr> \<^ML>\<open>SOMEGOAL\<close>~\<open>tac\<close> is equivalent to \<open>tac n\<close>~\<^ML_infix>\<open>ORELSE\<close>~\<open>\<dots>\<close>~\<^ML_infix>\<open>ORELSE\<close>~\<open>tac 1\<close>. It applies \<open>tac\<close> to one subgoal, counting downwards.
 
-  \<^descr> \<^ML>\<open>FIRSTGOAL\<close>~\<open>tac\<close> is equivalent to \<open>tac 1\<close>~\<^ML_op>\<open>ORELSE\<close>~\<open>\<dots>\<close>~\<^ML_op>\<open>ORELSE\<close>~\<open>tac n\<close>. It applies \<open>tac\<close> to one subgoal, counting upwards.
+  \<^descr> \<^ML>\<open>FIRSTGOAL\<close>~\<open>tac\<close> is equivalent to \<open>tac 1\<close>~\<^ML_infix>\<open>ORELSE\<close>~\<open>\<dots>\<close>~\<^ML_infix>\<open>ORELSE\<close>~\<open>tac n\<close>. It applies \<open>tac\<close> to one subgoal, counting upwards.
 
   \<^descr> \<^ML>\<open>HEADGOAL\<close>~\<open>tac\<close> is equivalent to \<open>tac 1\<close>. It applies \<open>tac\<close>
   unconditionally to the first subgoal.
@@ -666,7 +666,7 @@
   upwards.
 
   \<^descr> \<^ML>\<open>RANGE\<close>~\<open>[tac\<^sub>1, \<dots>, tac\<^sub>k] i\<close> is equivalent to \<open>tac\<^sub>k (i + k -
-  1)\<close>~\<^ML_op>\<open>THEN\<close>~\<open>\<dots>\<close>~\<^ML_op>\<open>THEN\<close>~\<open>tac\<^sub>1 i\<close>. It applies the given list of
+  1)\<close>~\<^ML_infix>\<open>THEN\<close>~\<open>\<dots>\<close>~\<^ML_infix>\<open>THEN\<close>~\<open>tac\<^sub>1 i\<close>. It applies the given list of
   tactics to the corresponding range of subgoals, counting downwards.
 \<close>
 
@@ -689,8 +689,8 @@
 
 text \<open>
   \begin{mldecls}
-  @{index_ML FILTER: "(thm -> bool) -> tactic -> tactic"} \\
-  @{index_ML CHANGED: "tactic -> tactic"} \\
+  @{define_ML FILTER: "(thm -> bool) -> tactic -> tactic"} \\
+  @{define_ML CHANGED: "tactic -> tactic"} \\
   \end{mldecls}
 
   \<^descr> \<^ML>\<open>FILTER\<close>~\<open>sat tac\<close> applies \<open>tac\<close> to the goal state and returns a
@@ -706,15 +706,15 @@
 
 text \<open>
   \begin{mldecls}
-  @{index_ML DEPTH_FIRST: "(thm -> bool) -> tactic -> tactic"} \\
-  @{index_ML DEPTH_SOLVE: "tactic -> tactic"} \\
-  @{index_ML DEPTH_SOLVE_1: "tactic -> tactic"} \\
+  @{define_ML DEPTH_FIRST: "(thm -> bool) -> tactic -> tactic"} \\
+  @{define_ML DEPTH_SOLVE: "tactic -> tactic"} \\
+  @{define_ML DEPTH_SOLVE_1: "tactic -> tactic"} \\
   \end{mldecls}
 
   \<^descr> \<^ML>\<open>DEPTH_FIRST\<close>~\<open>sat tac\<close> returns the goal state if \<open>sat\<close> returns true.
   Otherwise it applies \<open>tac\<close>, then recursively searches from each element of
   the resulting sequence. The code uses a stack for efficiency, in effect
-  applying \<open>tac\<close>~\<^ML_op>\<open>THEN\<close>~\<^ML>\<open>DEPTH_FIRST\<close>~\<open>sat tac\<close> to the state.
+  applying \<open>tac\<close>~\<^ML_infix>\<open>THEN\<close>~\<^ML>\<open>DEPTH_FIRST\<close>~\<open>sat tac\<close> to the state.
 
   \<^descr> \<^ML>\<open>DEPTH_SOLVE\<close>\<open>tac\<close> uses \<^ML>\<open>DEPTH_FIRST\<close> to search for states having
   no subgoals.
@@ -729,9 +729,9 @@
 
 text \<open>
   \begin{mldecls}
-  @{index_ML BREADTH_FIRST: "(thm -> bool) -> tactic -> tactic"} \\
-  @{index_ML BEST_FIRST: "(thm -> bool) * (thm -> int) -> tactic -> tactic"} \\
-  @{index_ML THEN_BEST_FIRST: "tactic -> (thm -> bool) * (thm -> int) -> tactic -> tactic"} \\
+  @{define_ML BREADTH_FIRST: "(thm -> bool) -> tactic -> tactic"} \\
+  @{define_ML BEST_FIRST: "(thm -> bool) * (thm -> int) -> tactic -> tactic"} \\
+  @{define_ML THEN_BEST_FIRST: "tactic -> (thm -> bool) * (thm -> int) -> tactic -> tactic"} \\
   \end{mldecls}
 
   These search strategies will find a solution if one exists. However, they do
@@ -763,10 +763,10 @@
 
 text \<open>
   \begin{mldecls}
-  @{index_ML COND: "(thm -> bool) -> tactic -> tactic -> tactic"} \\
-  @{index_ML IF_UNSOLVED: "tactic -> tactic"} \\
-  @{index_ML SOLVE: "tactic -> tactic"} \\
-  @{index_ML DETERM: "tactic -> tactic"} \\
+  @{define_ML COND: "(thm -> bool) -> tactic -> tactic -> tactic"} \\
+  @{define_ML IF_UNSOLVED: "tactic -> tactic"} \\
+  @{define_ML SOLVE: "tactic -> tactic"} \\
+  @{define_ML DETERM: "tactic -> tactic"} \\
   \end{mldecls}
 
   \<^descr> \<^ML>\<open>COND\<close>~\<open>sat tac\<^sub>1 tac\<^sub>2\<close> applies \<open>tac\<^sub>1\<close> to the goal state if it
@@ -792,10 +792,10 @@
 
 text \<open>
   \begin{mldecls}
-  @{index_ML has_fewer_prems: "int -> thm -> bool"} \\
-  @{index_ML Thm.eq_thm: "thm * thm -> bool"} \\
-  @{index_ML Thm.eq_thm_prop: "thm * thm -> bool"} \\
-  @{index_ML size_of_thm: "thm -> int"} \\
+  @{define_ML has_fewer_prems: "int -> thm -> bool"} \\
+  @{define_ML Thm.eq_thm: "thm * thm -> bool"} \\
+  @{define_ML Thm.eq_thm_prop: "thm * thm -> bool"} \\
+  @{define_ML size_of_thm: "thm -> int"} \\
   \end{mldecls}
 
   \<^descr> \<^ML>\<open>has_fewer_prems\<close>~\<open>n thm\<close> reports whether \<open>thm\<close> has fewer than \<open>n\<close>
--- a/src/Doc/Implementation/document/build	Wed Mar 31 16:01:31 2021 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,10 +0,0 @@
-#!/usr/bin/env bash
-
-set -e
-
-FORMAT="$1"
-VARIANT="$2"
-
-isabelle logo Isar
-"$ISABELLE_HOME/src/Doc/prepare_document" "$FORMAT"
-
--- a/src/Doc/Implementation/document/root.tex	Wed Mar 31 16:01:31 2021 +0200
+++ b/src/Doc/Implementation/document/root.tex	Mon Sep 06 12:08:20 2021 +0200
@@ -16,7 +16,7 @@
 \hyphenation{Isar}
 
 \isadroptag{theory}
-\title{\includegraphics[scale=0.5]{isabelle_isar}
+\title{\includegraphics[scale=0.5]{isabelle_logo}
   \\[4ex] The Isabelle/Isar Implementation}
 \author{\emph{Makarius Wenzel}  \\[3ex]
   With Contributions by
--- a/src/Doc/Intro/document/build	Wed Mar 31 16:01:31 2021 +0200
+++ b/src/Doc/Intro/document/build	Mon Sep 06 12:08:20 2021 +0200
@@ -2,9 +2,18 @@
 
 set -e
 
-FORMAT="$1"
-VARIANT="$2"
+$ISABELLE_LUALATEX root
+
+if [ -f manual.bib -o -f root.bib ]
+then
+  $ISABELLE_BIBTEX root
+  $ISABELLE_LUALATEX root
+fi
 
-isabelle logo
-"$ISABELLE_HOME/src/Doc/prepare_document" "$FORMAT"
+$ISABELLE_LUALATEX root
 
+if [ -f root.idx ]
+then
+  "$ISABELLE_HOME/src/Doc/sedindex" root
+  $ISABELLE_LUALATEX root
+fi
--- a/src/Doc/Intro/document/root.tex	Wed Mar 31 16:01:31 2021 +0200
+++ b/src/Doc/Intro/document/root.tex	Mon Sep 06 12:08:20 2021 +0200
@@ -6,7 +6,7 @@
 %prth *(\(.*\));          \1;      
 %{\\out \(.*\)}          {\\out val it = "\1" : thm}
 
-\title{\includegraphics[scale=0.5]{isabelle} \\[4ex] Old Introduction to Isabelle}   
+\title{\includegraphics[scale=0.5]{isabelle_logo} \\[4ex] Old Introduction to Isabelle}   
 \author{{\em Lawrence C. Paulson}\\
         Computer Laboratory \\ University of Cambridge \\
         \texttt{lcp@cl.cam.ac.uk}\\[3ex] 
--- a/src/Doc/Isar_Ref/Document_Preparation.thy	Wed Mar 31 16:01:31 2021 +0200
+++ b/src/Doc/Isar_Ref/Document_Preparation.thy	Mon Sep 06 12:08:20 2021 +0200
@@ -95,16 +95,28 @@
     @{antiquotation_def type} & : & \<open>antiquotation\<close> \\
     @{antiquotation_def class} & : & \<open>antiquotation\<close> \\
     @{antiquotation_def locale} & : & \<open>antiquotation\<close> \\
+    @{antiquotation_def bundle} & : & \<open>antiquotation\<close> \\
     @{antiquotation_def "text"} & : & \<open>antiquotation\<close> \\
     @{antiquotation_def goals} & : & \<open>antiquotation\<close> \\
     @{antiquotation_def subgoals} & : & \<open>antiquotation\<close> \\
     @{antiquotation_def prf} & : & \<open>antiquotation\<close> \\
     @{antiquotation_def full_prf} & : & \<open>antiquotation\<close> \\
+    @{antiquotation_def ML_text} & : & \<open>antiquotation\<close> \\
     @{antiquotation_def ML} & : & \<open>antiquotation\<close> \\
-    @{antiquotation_def ML_op} & : & \<open>antiquotation\<close> \\
+    @{antiquotation_def ML_def} & : & \<open>antiquotation\<close> \\
+    @{antiquotation_def ML_ref} & : & \<open>antiquotation\<close> \\
+    @{antiquotation_def ML_infix} & : & \<open>antiquotation\<close> \\
+    @{antiquotation_def ML_infix_def} & : & \<open>antiquotation\<close> \\
+    @{antiquotation_def ML_infix_ref} & : & \<open>antiquotation\<close> \\
     @{antiquotation_def ML_type} & : & \<open>antiquotation\<close> \\
+    @{antiquotation_def ML_type_def} & : & \<open>antiquotation\<close> \\
+    @{antiquotation_def ML_type_ref} & : & \<open>antiquotation\<close> \\
     @{antiquotation_def ML_structure} & : & \<open>antiquotation\<close> \\
+    @{antiquotation_def ML_structure_def} & : & \<open>antiquotation\<close> \\
+    @{antiquotation_def ML_structure_ref} & : & \<open>antiquotation\<close> \\
     @{antiquotation_def ML_functor} & : & \<open>antiquotation\<close> \\
+    @{antiquotation_def ML_functor_def} & : & \<open>antiquotation\<close> \\
+    @{antiquotation_def ML_functor_ref} & : & \<open>antiquotation\<close> \\
     @{antiquotation_def emph} & : & \<open>antiquotation\<close> \\
     @{antiquotation_def bold} & : & \<open>antiquotation\<close> \\
     @{antiquotation_def verbatim} & : & \<open>antiquotation\<close> \\
@@ -184,6 +196,7 @@
       @@{antiquotation type} options @{syntax embedded} |
       @@{antiquotation class} options @{syntax embedded} |
       @@{antiquotation locale} options @{syntax embedded} |
+      @@{antiquotation bundle} options @{syntax embedded} |
       (@@{antiquotation command} | @@{antiquotation method} | @@{antiquotation attribute})
         options @{syntax name}
     ;
@@ -192,9 +205,10 @@
       @@{antiquotation subgoals} options |
       @@{antiquotation prf} options @{syntax thms} |
       @@{antiquotation full_prf} options @{syntax thms} |
+      @@{antiquotation ML_text} options @{syntax text} |
       @@{antiquotation ML} options @{syntax text} |
-      @@{antiquotation ML_op} options @{syntax text} |
-      @@{antiquotation ML_type} options @{syntax text} |
+      @@{antiquotation ML_infix} options @{syntax text} |
+      @@{antiquotation ML_type} options @{syntax typeargs} @{syntax text} |
       @@{antiquotation ML_structure} options @{syntax text} |
       @@{antiquotation ML_functor} options @{syntax text} |
       @@{antiquotation emph} options @{syntax text} |
@@ -260,6 +274,8 @@
 
   \<^descr> \<open>@{locale c}\<close> prints a locale \<open>c\<close>.
 
+  \<^descr> \<open>@{bundle c}\<close> prints a bundle \<open>c\<close>.
+
   \<^descr> \<open>@{command name}\<close>, \<open>@{method name}\<close>, \<open>@{attribute name}\<close> print checked
   entities of the Isar language.
 
@@ -280,10 +296,22 @@
   \<^descr> \<open>@{full_prf a\<^sub>1 \<dots> a\<^sub>n}\<close> is like \<open>@{prf a\<^sub>1 \<dots> a\<^sub>n}\<close>, but prints the full
   proof terms, i.e.\ also displays information omitted in the compact proof
   term, which is denoted by ``\<open>_\<close>'' placeholders there.
-  
-  \<^descr> \<open>@{ML s}\<close>, \<open>@{ML_op s}\<close>, \<open>@{ML_type s}\<close>, \<open>@{ML_structure s}\<close>, and
+
+  \<^descr> \<open>@{ML_text s}\<close> prints ML text verbatim: only the token language is
+  checked.
+
+  \<^descr> \<open>@{ML s}\<close>, \<open>@{ML_infix s}\<close>, \<open>@{ML_type s}\<close>, \<open>@{ML_structure s}\<close>, and
   \<open>@{ML_functor s}\<close> check text \<open>s\<close> as ML value, infix operator, type,
-  structure, and functor respectively. The source is printed verbatim.
+  exception, structure, and functor respectively. The source is printed
+  verbatim. The variants \<open>@{ML_def s}\<close> and \<open>@{ML_ref s}\<close> etc. maintain the
+  document index: ``def'' means to make a bold entry, ``ref'' means to make a
+  regular entry.
+
+  There are two forms for type constructors, with or without separate type
+  arguments: this impacts only the index entry. For example, \<open>@{ML_type_ref
+  \<open>'a list\<close>}\<close> makes an entry literally for ``\<open>'a list\<close>'' (sorted under the
+  letter ``a''), but \<open>@{ML_type_ref 'a \<open>list\<close>}\<close> makes an entry for the
+  constructor name ``\<open>list\<close>''.
 
   \<^descr> \<open>@{emph s}\<close> prints document source recursively, with {\LaTeX} markup
   \<^verbatim>\<open>\emph{\<close>\<open>\<dots>\<close>\<^verbatim>\<open>}\<close>.
--- a/src/Doc/Isar_Ref/Generic.thy	Wed Mar 31 16:01:31 2021 +0200
+++ b/src/Doc/Isar_Ref/Generic.thy	Mon Sep 06 12:08:20 2021 +0200
@@ -153,7 +153,7 @@
 
   \<^descr> @{attribute THEN}~\<open>a\<close> composes rules by resolution; it resolves with the
   first premise of \<open>a\<close> (an alternative position may be also specified). See
-  also \<^ML_op>\<open>RS\<close> in @{cite "isabelle-implementation"}.
+  also \<^ML_infix>\<open>RS\<close> in @{cite "isabelle-implementation"}.
   
   \<^descr> @{attribute unfolded}~\<open>a\<^sub>1 \<dots> a\<^sub>n\<close> and @{attribute folded}~\<open>a\<^sub>1 \<dots> a\<^sub>n\<close>
   expand and fold back again the given definitions throughout a rule.
@@ -638,7 +638,7 @@
   of the term ordering.
 
   The default is lexicographic ordering of term structure, but this could be
-  also changed locally for special applications via @{index_ML
+  also changed locally for special applications via @{define_ML
   Simplifier.set_term_ord} in Isabelle/ML.
 
   \<^medskip>
@@ -866,9 +866,9 @@
 
 text \<open>
   \begin{mldecls}
-  @{index_ML Simplifier.set_subgoaler: "(Proof.context -> int -> tactic) ->
+  @{define_ML Simplifier.set_subgoaler: "(Proof.context -> int -> tactic) ->
   Proof.context -> Proof.context"} \\
-  @{index_ML Simplifier.prems_of: "Proof.context -> thm list"} \\
+  @{define_ML Simplifier.prems_of: "Proof.context -> thm list"} \\
   \end{mldecls}
 
   The subgoaler is the tactic used to solve subgoals arising out of
@@ -906,13 +906,13 @@
 
 text \<open>
   \begin{mldecls}
-  @{index_ML_type solver} \\
-  @{index_ML Simplifier.mk_solver: "string ->
+  @{define_ML_type solver} \\
+  @{define_ML Simplifier.mk_solver: "string ->
   (Proof.context -> int -> tactic) -> solver"} \\
-  @{index_ML_op setSolver: "Proof.context * solver -> Proof.context"} \\
-  @{index_ML_op addSolver: "Proof.context * solver -> Proof.context"} \\
-  @{index_ML_op setSSolver: "Proof.context * solver -> Proof.context"} \\
-  @{index_ML_op addSSolver: "Proof.context * solver -> Proof.context"} \\
+  @{define_ML_infix setSolver: "Proof.context * solver -> Proof.context"} \\
+  @{define_ML_infix addSolver: "Proof.context * solver -> Proof.context"} \\
+  @{define_ML_infix setSSolver: "Proof.context * solver -> Proof.context"} \\
+  @{define_ML_infix addSSolver: "Proof.context * solver -> Proof.context"} \\
   \end{mldecls}
 
   A solver is a tactic that attempts to solve a subgoal after simplification.
@@ -992,17 +992,17 @@
 
 text \<open>
   \begin{mldecls}
-  @{index_ML_op setloop: "Proof.context *
+  @{define_ML_infix setloop: "Proof.context *
   (Proof.context -> int -> tactic) -> Proof.context"} \\
-  @{index_ML_op addloop: "Proof.context *
+  @{define_ML_infix addloop: "Proof.context *
   (string * (Proof.context -> int -> tactic))
   -> Proof.context"} \\
-  @{index_ML_op delloop: "Proof.context * string -> Proof.context"} \\
-  @{index_ML Splitter.add_split: "thm -> Proof.context -> Proof.context"} \\
-  @{index_ML Splitter.add_split: "thm -> Proof.context -> Proof.context"} \\
-  @{index_ML Splitter.add_split_bang: "
+  @{define_ML_infix delloop: "Proof.context * string -> Proof.context"} \\
+  @{define_ML Splitter.add_split: "thm -> Proof.context -> Proof.context"} \\
+  @{define_ML Splitter.add_split: "thm -> Proof.context -> Proof.context"} \\
+  @{define_ML Splitter.add_split_bang: "
   thm -> Proof.context -> Proof.context"} \\
-  @{index_ML Splitter.del_split: "thm -> Proof.context -> Proof.context"} \\
+  @{define_ML Splitter.del_split: "thm -> Proof.context -> Proof.context"} \\
   \end{mldecls}
 
   The looper is a list of tactics that are applied after simplification, in
@@ -1624,23 +1624,23 @@
 
 text \<open>
   \begin{mldecls}
-    @{index_ML_type wrapper: "(int -> tactic) -> (int -> tactic)"} \\[0.5ex]
-    @{index_ML_op addSWrapper: "Proof.context *
+    @{define_ML_type wrapper = "(int -> tactic) -> (int -> tactic)"} \\[0.5ex]
+    @{define_ML_infix addSWrapper: "Proof.context *
   (string * (Proof.context -> wrapper)) -> Proof.context"} \\
-    @{index_ML_op addSbefore: "Proof.context *
+    @{define_ML_infix addSbefore: "Proof.context *
   (string * (Proof.context -> int -> tactic)) -> Proof.context"} \\
-    @{index_ML_op addSafter: "Proof.context *
+    @{define_ML_infix addSafter: "Proof.context *
   (string * (Proof.context -> int -> tactic)) -> Proof.context"} \\
-    @{index_ML_op delSWrapper: "Proof.context * string -> Proof.context"} \\[0.5ex]
-    @{index_ML_op addWrapper: "Proof.context *
+    @{define_ML_infix delSWrapper: "Proof.context * string -> Proof.context"} \\[0.5ex]
+    @{define_ML_infix addWrapper: "Proof.context *
   (string * (Proof.context -> wrapper)) -> Proof.context"} \\
-    @{index_ML_op addbefore: "Proof.context *
+    @{define_ML_infix addbefore: "Proof.context *
   (string * (Proof.context -> int -> tactic)) -> Proof.context"} \\
-    @{index_ML_op addafter: "Proof.context *
+    @{define_ML_infix addafter: "Proof.context *
   (string * (Proof.context -> int -> tactic)) -> Proof.context"} \\
-    @{index_ML_op delWrapper: "Proof.context * string -> Proof.context"} \\[0.5ex]
-    @{index_ML addSss: "Proof.context -> Proof.context"} \\
-    @{index_ML addss: "Proof.context -> Proof.context"} \\
+    @{define_ML_infix delWrapper: "Proof.context * string -> Proof.context"} \\[0.5ex]
+    @{define_ML addSss: "Proof.context -> Proof.context"} \\
+    @{define_ML addss: "Proof.context -> Proof.context"} \\
   \end{mldecls}
 
   The proof strategy of the Classical Reasoner is simple.  Perform as
--- a/src/Doc/Isar_Ref/Inner_Syntax.thy	Wed Mar 31 16:01:31 2021 +0200
+++ b/src/Doc/Isar_Ref/Inner_Syntax.thy	Mon Sep 06 12:08:20 2021 +0200
@@ -220,8 +220,8 @@
 
 text \<open>
   \begin{mldecls}
-    @{index_ML print_mode_value: "unit -> string list"} \\
-    @{index_ML Print_Mode.with_modes: "string list -> ('a -> 'b) -> 'a -> 'b"} \\
+    @{define_ML print_mode_value: "unit -> string list"} \\
+    @{define_ML Print_Mode.with_modes: "string list -> ('a -> 'b) -> 'a -> 'b"} \\
   \end{mldecls}
 
   The \<^emph>\<open>print mode\<close> facility allows to modify various operations for printing.
--- a/src/Doc/Isar_Ref/Outer_Syntax.thy	Wed Mar 31 16:01:31 2021 +0200
+++ b/src/Doc/Isar_Ref/Outer_Syntax.thy	Mon Sep 06 12:08:20 2021 +0200
@@ -146,7 +146,7 @@
   is no way to escape ``\<^verbatim>\<open>*}\<close>''. Cartouches do not have this limitation.
 
   A @{syntax_ref cartouche} consists of arbitrary text, with properly balanced
-  blocks of ``\<^verbatim>\<open>\<open>\<close>~\<open>\<dots>\<close>~\<^verbatim>\<open>\<close>\<close>''. Note that the rendering
+  blocks of ``@{verbatim "\<open>"}~\<open>\<dots>\<close>~@{verbatim "\<close>"}''. Note that the rendering
   of cartouche delimiters is usually like this: ``\<open>\<open> \<dots> \<close>\<close>''.
 
   Source comments take the form \<^verbatim>\<open>(*\<close>~\<open>\<dots>\<close>~\<^verbatim>\<open>*)\<close> and may be nested: the text is
@@ -343,12 +343,16 @@
   no infixes.
 
   \<^rail>\<open>
-    @{syntax_def typespec}:
-      (() | @{syntax type_ident} | '(' ( @{syntax type_ident} + ',' ) ')') @{syntax name}
+    @{syntax_def typeargs}:
+      (() | @{syntax type_ident} | '(' ( @{syntax type_ident} + ',' ) ')')
     ;
-    @{syntax_def typespec_sorts}:
+    @{syntax_def typeargs_sorts}:
       (() | (@{syntax type_ident} ('::' @{syntax sort})?) |
-        '(' ( (@{syntax type_ident} ('::' @{syntax sort})?) + ',' ) ')') @{syntax name}
+        '(' ( (@{syntax type_ident} ('::' @{syntax sort})?) + ',' ) ')')
+    ;
+    @{syntax_def typespec}: @{syntax typeargs} @{syntax name}
+    ;
+    @{syntax_def typespec_sorts}: @{syntax typeargs_sorts} @{syntax name}
   \<close>
 \<close>
 
--- a/src/Doc/Isar_Ref/Proof.thy	Wed Mar 31 16:01:31 2021 +0200
+++ b/src/Doc/Isar_Ref/Proof.thy	Mon Sep 06 12:08:20 2021 +0200
@@ -626,7 +626,7 @@
   Structural composition ``\<open>m\<^sub>1\<close>\<^verbatim>\<open>;\<close>~\<open>m\<^sub>2\<close>'' means that method \<open>m\<^sub>1\<close> is
   applied with restriction to the first subgoal, then \<open>m\<^sub>2\<close> is applied
   consecutively with restriction to each subgoal that has newly emerged due to
-  \<open>m\<^sub>1\<close>. This is analogous to the tactic combinator \<^ML_op>\<open>THEN_ALL_NEW\<close> in
+  \<open>m\<^sub>1\<close>. This is analogous to the tactic combinator \<^ML_infix>\<open>THEN_ALL_NEW\<close> in
   Isabelle/ML, see also @{cite "isabelle-implementation"}. For example, \<open>(rule
   r; blast)\<close> applies rule \<open>r\<close> and then solves all new subgoals by \<open>blast\<close>.
 
@@ -1095,11 +1095,10 @@
   This accommodates compact proof texts even when reasoning about large
   specifications.
 
-  The @{method induct} method also provides some additional infrastructure in
-  order to be applicable to structure statements (either using explicit
-  meta-level connectives, or including facts and parameters separately). This
-  avoids cumbersome encoding of ``strengthened'' inductive statements within
-  the object-logic.
+  The @{method induct} method also provides some infrastructure to work with
+  structured statements (either using explicit meta-level connectives, or
+  including facts and parameters separately). This avoids cumbersome encoding
+  of ``strengthened'' inductive statements within the object-logic.
 
   Method @{method induction} differs from @{method induct} only in the names
   of the facts in the local context invoked by the @{command "case"} command.
@@ -1157,10 +1156,10 @@
 
   \<^medskip>
   \begin{tabular}{llll}
-    facts           &                  & arguments            & rule \\\hline
-                    & @{method induct} & \<open>P x\<close>        & datatype induction (type of \<open>x\<close>) \\
+    facts   &                  & arguments     & rule \\\hline
+            & @{method induct} & \<open>P x\<close>         & datatype induction (type of \<open>x\<close>) \\
     \<open>\<turnstile> A x\<close> & @{method induct} & \<open>\<dots>\<close>          & predicate/set induction (of \<open>A\<close>) \\
-    \<open>\<dots>\<close>     & @{method induct} & \<open>\<dots> rule: R\<close> & explicit rule \<open>R\<close> \\
+    \<open>\<dots>\<close>    & @{method induct} & \<open>\<dots> rule: R\<close>  & explicit rule \<open>R\<close> \\
   \end{tabular}
   \<^medskip>
 
@@ -1176,9 +1175,9 @@
   the induction rule. Equalities reappear in the inductive cases, but have
   been transformed according to the induction principle being involved here.
   In order to achieve practically useful induction hypotheses, some variables
-  occurring in \<open>t\<close> need to be fixed (see below). Instantiations of the form
-  \<open>t\<close>, where \<open>t\<close> is not a variable, are taken as a shorthand for \<open>x \<equiv> t\<close>,
-  where \<open>x\<close> is a fresh variable. If this is not intended, \<open>t\<close> has to be
+  occurring in \<open>t\<close> need to generalized (see below). Instantiations of
+  the form \<open>t\<close>, where \<open>t\<close> is not a variable, are taken as a shorthand for \<open>x \<equiv>
+  t\<close>, where \<open>x\<close> is a fresh variable. If this is not intended, \<open>t\<close> has to be
   enclosed in parentheses. By default, the equalities generated by
   definitional instantiations are pre-simplified using a specific set of
   rules, usually consisting of distinctness and injectivity theorems for
@@ -1205,8 +1204,8 @@
 
   \<^medskip>
   \begin{tabular}{llll}
-    goal          &                    & arguments & rule \\\hline
-                  & @{method coinduct} & \<open>x\<close> & type coinduction (type of \<open>x\<close>) \\
+    goal  &                    & arguments & rule \\\hline
+          & @{method coinduct} & \<open>x\<close> & type coinduction (type of \<open>x\<close>) \\
     \<open>A x\<close> & @{method coinduct} & \<open>\<dots>\<close> & predicate/set coinduction (of \<open>A\<close>) \\
     \<open>\<dots>\<close>   & @{method coinduct} & \<open>\<dots> rule: R\<close> & explicit rule \<open>R\<close> \\
   \end{tabular}
--- a/src/Doc/Isar_Ref/Spec.thy	Wed Mar 31 16:01:31 2021 +0200
+++ b/src/Doc/Isar_Ref/Spec.thy	Mon Sep 06 12:08:20 2021 +0200
@@ -520,8 +520,11 @@
     @{command_def "locale_deps"}\<open>\<^sup>*\<close> & : & \<open>context \<rightarrow>\<close> \\
   \end{tabular}
 
-  \indexisarelem{fixes}\indexisarelem{constrains}\indexisarelem{assumes}
-  \indexisarelem{defines}\indexisarelem{notes}
+  @{index_ref \<open>\<^theory_text>\<open>fixes\<close> (element)\<close>}
+  @{index_ref \<open>\<^theory_text>\<open>constrains\<close> (element)\<close>}
+  @{index_ref \<open>\<^theory_text>\<open>assumes\<close> (element)\<close>}
+  @{index_ref \<open>\<^theory_text>\<open>defines\<close> (element)\<close>}
+  @{index_ref \<open>\<^theory_text>\<open>notes\<close> (element)\<close>}
   \<^rail>\<open>
     @@{command locale} @{syntax name} ('=' @{syntax locale})? @'begin'?
     ;
@@ -735,6 +738,9 @@
   free variable whose name is already bound in the context --- for example,
   because a constant of that name exists --- add it to the \<^theory_text>\<open>for\<close> clause.
 
+  When used in a nested target, resulting declarations are propagated
+  through the whole target stack.
+
   \<^descr> \<^theory_text>\<open>sublocale name \<subseteq> expr defines defs\<close> interprets \<open>expr\<close>
   into the locale \<open>name\<close>. A proof that the specification of \<open>name\<close> implies the
   specification of \<open>expr\<close> is required. As in the localized version of the
--- a/src/Doc/Isar_Ref/Symbols.thy	Wed Mar 31 16:01:31 2021 +0200
+++ b/src/Doc/Isar_Ref/Symbols.thy	Mon Sep 06 12:08:20 2021 +0200
@@ -32,7 +32,7 @@
 
   \begin{center}
   \begin{isabellebody}
-  \input{syms}  
+  @{show_symbols}
   \end{isabellebody}
   \end{center}
 \<close>
--- a/src/Doc/Isar_Ref/document/build	Wed Mar 31 16:01:31 2021 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,11 +0,0 @@
-#!/usr/bin/env bash
-
-set -e
-
-FORMAT="$1"
-VARIANT="$2"
-
-isabelle logo Isar
-./showsymbols "$ISABELLE_HOME/lib/texinputs/isabellesym.sty" > syms.tex
-"$ISABELLE_HOME/src/Doc/prepare_document" "$FORMAT"
-
--- a/src/Doc/Isar_Ref/document/root.tex	Wed Mar 31 16:01:31 2021 +0200
+++ b/src/Doc/Isar_Ref/document/root.tex	Mon Sep 06 12:08:20 2021 +0200
@@ -23,7 +23,7 @@
 \hyphenation{Isar}
 
 \isadroptag{theory}
-\title{\includegraphics[scale=0.5]{isabelle_isar} \\[4ex] The Isabelle/Isar Reference Manual}
+\title{\includegraphics[scale=0.5]{isabelle_logo} \\[4ex] The Isabelle/Isar Reference Manual}
 \author{\emph{Makarius Wenzel} \\[3ex]
   With Contributions by
   Clemens Ballarin,
--- a/src/Doc/Isar_Ref/document/showsymbols	Wed Mar 31 16:01:31 2021 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,23 +0,0 @@
-#!/usr/bin/env perl
-
-print "\\begin{supertabular}{ll\@{\\qquad}ll}\n";
-
-$eol = "&";
-
-while (<ARGV>) {
-    if (m/^\\newcommand\{\\isasym([A-Za-z]+)\}/) {
-        print "\\verb,\\<$1>, & {\\isasym$1} $eol\n";
-        if ("$eol" eq "&") {
-            $eol = "\\\\";
-        } else {
-            $eol = "&";
-        }
-    }
-}
-
-if ("$eol" eq "\\\\") {
-    print "$eol\n";
-}
-
-print "\\end{supertabular}\n";
-
--- a/src/Doc/JEdit/JEdit.thy	Wed Mar 31 16:01:31 2021 +0200
+++ b/src/Doc/JEdit/JEdit.thy	Mon Sep 06 12:08:20 2021 +0200
@@ -206,7 +206,7 @@
   is no longer affected by change of default properties.
 
   Users may modify their keymap later, but this can lead to conflicts with
-  \<^verbatim>\<open>shortcut\<close> properties in \<^file>\<open>$JEDIT_HOME/src/jEdit.props\<close>.
+  \<^verbatim>\<open>shortcut\<close> properties in \<^file>\<open>$JEDIT_HOME/properties/jEdit.props\<close>.
 
   The action @{action_def "isabelle.keymap-merge"} helps to resolve pending
   Isabelle keymap changes wrt. the current jEdit keymap; non-conflicting
@@ -282,10 +282,9 @@
   directly to the underlying \<^verbatim>\<open>java\<close> process.
 
   The \<^verbatim>\<open>-b\<close> and \<^verbatim>\<open>-f\<close> options control the self-build mechanism of
-  Isabelle/jEdit. This is only relevant for building from sources, which also
-  requires an auxiliary \<^verbatim>\<open>jedit_build\<close> component from
-  \<^url>\<open>https://isabelle.in.tum.de/components\<close>. The official Isabelle release
-  already includes a pre-built version of Isabelle/jEdit.
+  Isabelle/Scala/PIDE/jEdit. This is only relevant for building from sources,
+  the official Isabelle release already includes a pre-built version of
+  Isabelle/jEdit.
 
   \<^bigskip>
   It is also possible to connect to an already running Isabelle/jEdit process
@@ -1911,7 +1910,7 @@
 
 text \<open>
   Citations are managed by {\LaTeX} and Bib{\TeX} in \<^verbatim>\<open>.bib\<close> files. The
-  Isabelle session build process and the @{tool latex} tool @{cite
+  Isabelle session build process and the @{tool document} tool @{cite
   "isabelle-system"} are smart enough to assemble the result, based on the
   session directory layout.
 
--- a/src/Doc/JEdit/document/build	Wed Mar 31 16:01:31 2021 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,10 +0,0 @@
-#!/usr/bin/env bash
-
-set -e
-
-FORMAT="$1"
-VARIANT="$2"
-
-isabelle logo jEdit
-"$ISABELLE_HOME/src/Doc/prepare_document" "$FORMAT"
-
--- a/src/Doc/JEdit/document/root.tex	Wed Mar 31 16:01:31 2021 +0200
+++ b/src/Doc/JEdit/document/root.tex	Mon Sep 06 12:08:20 2021 +0200
@@ -20,7 +20,7 @@
 \isabellestyle{literal}
 \def\isastylett{\footnotesize\tt}
 
-\title{\includegraphics[scale=0.5]{isabelle_jedit} \\[4ex] Isabelle/jEdit}
+\title{\includegraphics[scale=0.5]{isabelle_logo} \\[4ex] Isabelle/jEdit}
 
 \author{\emph{Makarius Wenzel}}
 
--- a/src/Doc/Locales/document/build	Wed Mar 31 16:01:31 2021 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,9 +0,0 @@
-#!/usr/bin/env bash
-
-set -e
-
-FORMAT="$1"
-VARIANT="$2"
-
-"$ISABELLE_HOME/src/Doc/prepare_document" "$FORMAT"
-
--- a/src/Doc/Logics/document/build	Wed Mar 31 16:01:31 2021 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,10 +0,0 @@
-#!/usr/bin/env bash
-
-set -e
-
-FORMAT="$1"
-VARIANT="$2"
-
-isabelle logo
-"$ISABELLE_HOME/src/Doc/prepare_document" "$FORMAT"
-
--- a/src/Doc/Logics/document/root.tex	Wed Mar 31 16:01:31 2021 +0200
+++ b/src/Doc/Logics/document/root.tex	Mon Sep 06 12:08:20 2021 +0200
@@ -8,7 +8,7 @@
 %%% to index constants:   \\tt \([a-zA-Z0-9][a-zA-Z0-9_]*\)     \\cdx{\1}  
 %%% to deverbify:         \\verb|\([^|]*\)|     \\ttindex{\1}  
 %% run    ../sedindex logics    to prepare index file
-\title{\includegraphics[scale=0.5]{isabelle} \\[4ex] Isabelle's Logics}
+\title{\includegraphics[scale=0.5]{isabelle_logo} \\[4ex] Isabelle's Logics}
 
 \author{{\em Lawrence C. Paulson}\\
         Computer Laboratory \\ University of Cambridge \\
--- a/src/Doc/Logics_ZF/document/build	Wed Mar 31 16:01:31 2021 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,10 +0,0 @@
-#!/usr/bin/env bash
-
-set -e
-
-FORMAT="$1"
-VARIANT="$2"
-
-isabelle logo ZF
-"$ISABELLE_HOME/src/Doc/prepare_document" "$FORMAT"
-
--- a/src/Doc/Logics_ZF/document/logics.sty	Wed Mar 31 16:01:31 2021 +0200
+++ b/src/Doc/Logics_ZF/document/logics.sty	Mon Sep 06 12:08:20 2021 +0200
@@ -1,1 +1,179 @@
-% logics.sty : Logics Manuals Page Layout
%
\typeout{Document Style logics. Released 18 August 2003}

\hyphenation{Isa-belle man-u-script man-u-scripts ap-pen-dix mut-u-al-ly}
\hyphenation{data-type data-types co-data-type co-data-types }

%usage: \iflabelundefined{LABEL}{if not defined}{if defined}
\newcommand{\iflabelundefined}[1]{\@ifundefined{r@#1}}


%%%INDEXING  use isa-index to process the index

\newcommand\seealso[2]{\emph{see also} #1}
\usepackage{makeidx}

%index, putting page numbers of definitions in boldface
\def\bold#1{\textbf{#1}}
\newcommand\fnote[1]{#1n}
\newcommand\indexbold[1]{\index{#1|bold}}

% The alternative to \protect\isa in the indexing macros is
% \noexpand\noexpand \noexpand\isa
% need TWO levels of \noexpand to delay the expansion of \isa:
%  the \noexpand\noexpand will leave one \noexpand, to be given to the
%  (still unexpanded) \isa token.  See TeX by Topic, page 122.

%%%% for indexing constants, symbols, theorems, ...
\newcommand\cdx[1]{\isa{#1}\index{#1@\protect\isa{#1} (constant)}}
\newcommand\sdx[1]{\isa{#1}\index{#1@\protect\isa{#1} (symbol)}}

\newcommand\tdx[1]{\isa{#1}\index{#1@\protect\isa{#1} (theorem)}}
\newcommand\tdxbold[1]{\isa{#1}\index{#1@\protect\isa{#1} (theorem)|bold}}

\newcommand\cldx[1]{\isa{#1}\index{#1@\protect\isa{#1} (class)}}
\newcommand\tydx[1]{\isa{#1}\index{#1@\protect\isa{#1} (type)}}
\newcommand\thydx[1]{\isa{#1}\index{#1@\protect\isa{#1} (theory)}}

\newcommand\attrdx[1]{\isa{#1}\index{#1@\protect\isa{#1} (attribute)}}
\newcommand\cmmdx[1]{\index{#1@\protect\isacommand{#1} (command)}}
\newcommand\commdx[1]{\isacommand{#1}\index{#1@\protect\isacommand{#1} (command)}}
\newcommand\methdx[1]{\isa{#1}\index{#1@\protect\isa{#1} (method)}}
\newcommand\tooldx[1]{\isa{#1}\index{#1@\protect\isa{#1} (tool)}}
\newcommand\settdx[1]{\isa{#1}\index{#1@\protect\isa{#1} (setting)}}

%set argument in \bf font and index in ROMAN font (for definitions in text!)
\newcommand\bfindex[1]{{\bf#1}\index{#1|bold}\@}

\newcommand\rmindex[1]{{#1}\index{#1}\@}
\newcommand\ttindex[1]{\texttt{#1}\index{#1@\texttt{#1}}\@}
\newcommand\ttindexbold[1]{\texttt{#1}\index{#1@\texttt{#1}|bold}\@}

\newcommand{\indexboldpos}[2]{#1\@}
\newcommand{\ttindexboldpos}[2]{\isa{#1}\@}

%\newtheorem{theorem}{Theorem}[section]
\newtheorem{Exercise}{Exercise}[section]
\newenvironment{exercise}{\begin{Exercise}\rm}{\end{Exercise}}
\newcommand{\ttlbr}{\texttt{[|}}
\newcommand{\ttrbr}{\texttt{|]}}
\newcommand{\ttor}{\texttt{|}}
\newcommand{\ttall}{\texttt{!}}
\newcommand{\ttuniquex}{\texttt{?!}}
\newcommand{\ttEXU}{\texttt{EX!}}
\newcommand{\ttAnd}{\texttt{!!}}

\newcommand{\isasymignore}{}
\newcommand{\isasymimp}{\isasymlongrightarrow}
\newcommand{\isasymImp}{\isasymLongrightarrow}
\newcommand{\isasymFun}{\isasymRightarrow}
\newcommand{\isasymuniqex}{\isamath{\exists!\,}}
\renewcommand{\S}{Sect.\ts}

\renewenvironment{isamarkuptxt}{\begin{isamarkuptext}}{\end{isamarkuptext}}

\newif\ifremarks
\newcommand{\REMARK}[1]{\ifremarks\marginpar{\raggedright\footnotesize#1}\fi}

%names of Isabelle rules
\newcommand{\rulename}[1]{\hfill(#1)}
\newcommand{\rulenamedx}[1]{\hfill(#1\index{#1@\protect\isa{#1} (theorem)|bold})}

%%%% meta-logical connectives

\let\Forall=\bigwedge
\let\Imp=\Longrightarrow
\let\To=\Rightarrow
\newcommand{\Var}[1]{{?\!#1}}

%%% underscores as ordinary characters, not for subscripting
%%  use @ or \sb for subscripting; use \at for @
%%  only works in \tt font
%%  must not make _ an active char; would make \ttindex fail!
\gdef\underscoreoff{\catcode`\@=8\catcode`\_=\other}
\gdef\underscoreon{\catcode`\_=8\makeatother}
\chardef\other=12
\chardef\at=`\@

% alternative underscore
\def\_{\leavevmode\kern.06em\vbox{\hrule height.2ex width.3em}\hskip0.1em}


%%%% ``WARNING'' environment
\def\dbend{\vtop to 0pt{\vss\hbox{\Huge\bf!}\vss}}
\newenvironment{warn}{\medskip\medbreak\begingroup \clubpenalty=10000 
         \small %%WAS\baselineskip=0.9\baselineskip
         \noindent \hangindent\parindent \hangafter=-2 
         \hbox to0pt{\hskip-\hangindent\dbend\hfill}\ignorespaces}%
        {\par\endgroup\medbreak}


%%%% Standard logical symbols
\let\turn=\vdash
\let\conj=\wedge
\let\disj=\vee
\let\imp=\rightarrow
\let\bimp=\leftrightarrow
\newcommand\all[1]{\forall#1.}  %quantification
\newcommand\ex[1]{\exists#1.}
\newcommand{\pair}[1]{\langle#1\rangle}

\newcommand{\lparr}{\mathopen{(\!|}}
\newcommand{\rparr}{\mathclose{|\!)}}
\newcommand{\fs}{\mathpunct{,\,}}
\newcommand{\ty}{\mathrel{::}}
\newcommand{\asn}{\mathrel{:=}}
\newcommand{\more}{\ldots}
\newcommand{\record}[1]{\lparr #1 \rparr}
\newcommand{\dtt}{\mathord.}

\newcommand\lbrakk{\mathopen{[\![}}
\newcommand\rbrakk{\mathclose{]\!]}}
\newcommand\List[1]{\lbrakk#1\rbrakk}  %was \obj
\newcommand\vpile[1]{\begin{array}{c}#1\end{array}}
\newenvironment{matharray}[1]{\[\begin{array}{#1}}{\end{array}\]}
\newcommand{\Text}[1]{\mbox{#1}}

\DeclareMathSymbol{\dshsym}{\mathalpha}{letters}{"2D}
\newcommand{\dsh}{\mathit{\dshsym}}

\let\int=\cap
\let\un=\cup
\let\inter=\bigcap
\let\union=\bigcup

\def\ML{{\sc ml}}
\def\AST{{\sc ast}}

%macros to change the treatment of symbols
\def\relsemicolon{\mathcode`\;="303B}   %treat ; like a relation
\def\binperiod{\mathcode`\.="213A}   %treat . like a binary operator
\def\binvert{\mathcode`\|="226A}     %treat | like a binary operator

%redefinition of \sloppy and \fussy to use \emergencystretch
\def\sloppy{\tolerance2000 \hfuzz.5pt \vfuzz.5pt \emergencystretch=15pt}
\def\fussy{\tolerance200 \hfuzz.1pt \vfuzz.1pt \emergencystretch=0pt}

%non-bf version of description
\def\descrlabel#1{\hspace\labelsep #1}
\def\descr{\list{}{\labelwidth\z@ \itemindent-\leftmargin\let\makelabel\descrlabel}}
\let\enddescr\endlist

% The mathcodes for the letters A, ..., Z, a, ..., z are changed to
% generate text italic rather than math italic by default. This makes
% multi-letter identifiers look better. The mathcode for character c
% is set to |"7000| (variable family) + |"400| (text italic) + |c|.
%
\DeclareSymbolFont{italics}{\encodingdefault}{\rmdefault}{m}{it}%
\def\@setmcodes#1#2#3{{\count0=#1 \count1=#3
        \loop \global\mathcode\count0=\count1 \ifnum \count0<#2
        \advance\count0 by1 \advance\count1 by1 \repeat}}
\@setmcodes{`A}{`Z}{"7\hexnumber@\symitalics41}
\@setmcodes{`a}{`z}{"7\hexnumber@\symitalics61}

%%% \dquotes permits usage of "..." for \hbox{...} 
%%%   also taken from under.sty
{\catcode`\"=\active
\gdef\dquotes{\catcode`\"=\active  \let"=\@mathText}%
\gdef\@mathText#1"{\hbox{\mathTextFont #1\/}}}
\def\mathTextFont{\frenchspacing\tt}
\def\dquotesoff{\catcode`\"=\other}
\ No newline at end of file
+% logics.sty : Logics Manuals Page Layout
+%
+\typeout{Document Style logics. Released 18 August 2003}
+
+\hyphenation{Isa-belle man-u-script man-u-scripts ap-pen-dix mut-u-al-ly}
+\hyphenation{data-type data-types co-data-type co-data-types }
+
+%usage: \iflabelundefined{LABEL}{if not defined}{if defined}
+\newcommand{\iflabelundefined}[1]{\@ifundefined{r@#1}}
+
+
+%%%INDEXING  use isa-index to process the index
+
+\newcommand\seealso[2]{\emph{see also} #1}
+\usepackage{makeidx}
+
+%index, putting page numbers of definitions in boldface
+\def\bold#1{\textbf{#1}}
+\newcommand\fnote[1]{#1n}
+\newcommand\indexbold[1]{\index{#1|bold}}
+
+% The alternative to \protect\isa in the indexing macros is
+% \noexpand\noexpand \noexpand\isa
+% need TWO levels of \noexpand to delay the expansion of \isa:
+%  the \noexpand\noexpand will leave one \noexpand, to be given to the
+%  (still unexpanded) \isa token.  See TeX by Topic, page 122.
+
+%%%% for indexing constants, symbols, theorems, ...
+\newcommand\cdx[1]{\isa{#1}\index{#1@\protect\isa{#1} (constant)}}
+\newcommand\sdx[1]{\isa{#1}\index{#1@\protect\isa{#1} (symbol)}}
+
+\newcommand\tdx[1]{\isa{#1}\index{#1@\protect\isa{#1} (theorem)}}
+\newcommand\tdxbold[1]{\isa{#1}\index{#1@\protect\isa{#1} (theorem)|bold}}
+
+\newcommand\cldx[1]{\isa{#1}\index{#1@\protect\isa{#1} (class)}}
+\newcommand\tydx[1]{\isa{#1}\index{#1@\protect\isa{#1} (type)}}
+\newcommand\thydx[1]{\isa{#1}\index{#1@\protect\isa{#1} (theory)}}
+
+\newcommand\attrdx[1]{\isa{#1}\index{#1@\protect\isa{#1} (attribute)}}
+\newcommand\cmmdx[1]{\index{#1@\protect\isacommand{#1} (command)}}
+\newcommand\commdx[1]{\isacommand{#1}\index{#1@\protect\isacommand{#1} (command)}}
+\newcommand\methdx[1]{\isa{#1}\index{#1@\protect\isa{#1} (method)}}
+
+%set argument in \bf font and index in ROMAN font (for definitions in text!)
+\newcommand\bfindex[1]{{\bf#1}\index{#1|bold}\@}
+
+\newcommand\rmindex[1]{{#1}\index{#1}\@}
+\newcommand\ttindex[1]{\texttt{#1}\index{#1@\texttt{#1}}\@}
+\newcommand\ttindexbold[1]{\texttt{#1}\index{#1@\texttt{#1}|bold}\@}
+
+\newcommand{\indexboldpos}[2]{#1\@}
+\newcommand{\ttindexboldpos}[2]{\isa{#1}\@}
+
+%\newtheorem{theorem}{Theorem}[section]
+\newtheorem{Exercise}{Exercise}[section]
+\newenvironment{exercise}{\begin{Exercise}\rm}{\end{Exercise}}
+\newcommand{\ttlbr}{\texttt{[|}}
+\newcommand{\ttrbr}{\texttt{|]}}
+\newcommand{\ttor}{\texttt{|}}
+\newcommand{\ttall}{\texttt{!}}
+\newcommand{\ttuniquex}{\texttt{?!}}
+\newcommand{\ttEXU}{\texttt{EX!}}
+\newcommand{\ttAnd}{\texttt{!!}}
+
+\newcommand{\isasymignore}{}
+\newcommand{\isasymimp}{\isasymlongrightarrow}
+\newcommand{\isasymImp}{\isasymLongrightarrow}
+\newcommand{\isasymFun}{\isasymRightarrow}
+\newcommand{\isasymuniqex}{\isamath{\exists!\,}}
+\renewcommand{\S}{Sect.\ts}
+
+\renewenvironment{isamarkuptxt}{\begin{isamarkuptext}}{\end{isamarkuptext}}
+
+\newif\ifremarks
+\newcommand{\REMARK}[1]{\ifremarks\marginpar{\raggedright\footnotesize#1}\fi}
+
+%names of Isabelle rules
+\newcommand{\rulename}[1]{\hfill(#1)}
+\newcommand{\rulenamedx}[1]{\hfill(#1\index{#1@\protect\isa{#1} (theorem)|bold})}
+
+%%%% meta-logical connectives
+
+\let\Forall=\bigwedge
+\let\Imp=\Longrightarrow
+\let\To=\Rightarrow
+\newcommand{\Var}[1]{{?\!#1}}
+
+%%% underscores as ordinary characters, not for subscripting
+%%  use @ or \sb for subscripting; use \at for @
+%%  only works in \tt font
+%%  must not make _ an active char; would make \ttindex fail!
+\gdef\underscoreoff{\catcode`\@=8\catcode`\_=\other}
+\gdef\underscoreon{\catcode`\_=8\makeatother}
+\chardef\other=12
+\chardef\at=`\@
+
+% alternative underscore
+\def\_{\leavevmode\kern.06em\vbox{\hrule height.2ex width.3em}\hskip0.1em}
+
+
+%%%% ``WARNING'' environment
+\def\dbend{\vtop to 0pt{\vss\hbox{\Huge\bf!}\vss}}
+\newenvironment{warn}{\medskip\medbreak\begingroup \clubpenalty=10000 
+         \small %%WAS\baselineskip=0.9\baselineskip
+         \noindent \hangindent\parindent \hangafter=-2 
+         \hbox to0pt{\hskip-\hangindent\dbend\hfill}\ignorespaces}%
+        {\par\endgroup\medbreak}
+
+
+%%%% Standard logical symbols
+\let\turn=\vdash
+\let\conj=\wedge
+\let\disj=\vee
+\let\imp=\rightarrow
+\let\bimp=\leftrightarrow
+\newcommand\all[1]{\forall#1.}  %quantification
+\newcommand\ex[1]{\exists#1.}
+\newcommand{\pair}[1]{\langle#1\rangle}
+
+\newcommand{\lparr}{\mathopen{(\!|}}
+\newcommand{\rparr}{\mathclose{|\!)}}
+\newcommand{\fs}{\mathpunct{,\,}}
+\newcommand{\ty}{\mathrel{::}}
+\newcommand{\asn}{\mathrel{:=}}
+\newcommand{\more}{\ldots}
+\newcommand{\record}[1]{\lparr #1 \rparr}
+\newcommand{\dtt}{\mathord.}
+
+\newcommand\lbrakk{\mathopen{[\![}}
+\newcommand\rbrakk{\mathclose{]\!]}}
+\newcommand\List[1]{\lbrakk#1\rbrakk}  %was \obj
+\newcommand\vpile[1]{\begin{array}{c}#1\end{array}}
+\newenvironment{matharray}[1]{\[\begin{array}{#1}}{\end{array}\]}
+\newcommand{\Text}[1]{\mbox{#1}}
+
+\DeclareMathSymbol{\dshsym}{\mathalpha}{letters}{"2D}
+\newcommand{\dsh}{\mathit{\dshsym}}
+
+\let\int=\cap
+\let\un=\cup
+\let\inter=\bigcap
+\let\union=\bigcup
+
+\def\ML{{\sc ml}}
+\def\AST{{\sc ast}}
+
+%macros to change the treatment of symbols
+\def\relsemicolon{\mathcode`\;="303B}   %treat ; like a relation
+\def\binperiod{\mathcode`\.="213A}   %treat . like a binary operator
+\def\binvert{\mathcode`\|="226A}     %treat | like a binary operator
+
+%redefinition of \sloppy and \fussy to use \emergencystretch
+\def\sloppy{\tolerance2000 \hfuzz.5pt \vfuzz.5pt \emergencystretch=15pt}
+\def\fussy{\tolerance200 \hfuzz.1pt \vfuzz.1pt \emergencystretch=0pt}
+
+%non-bf version of description
+\def\descrlabel#1{\hspace\labelsep #1}
+\def\descr{\list{}{\labelwidth\z@ \itemindent-\leftmargin\let\makelabel\descrlabel}}
+\let\enddescr\endlist
+
+% The mathcodes for the letters A, ..., Z, a, ..., z are changed to
+% generate text italic rather than math italic by default. This makes
+% multi-letter identifiers look better. The mathcode for character c
+% is set to |"7000| (variable family) + |"400| (text italic) + |c|.
+%
+\DeclareSymbolFont{italics}{\encodingdefault}{\rmdefault}{m}{it}%
+\def\@setmcodes#1#2#3{{\count0=#1 \count1=#3
+        \loop \global\mathcode\count0=\count1 \ifnum \count0<#2
+        \advance\count0 by1 \advance\count1 by1 \repeat}}
+\@setmcodes{`A}{`Z}{"7\hexnumber@\symitalics41}
+\@setmcodes{`a}{`z}{"7\hexnumber@\symitalics61}
+
+%%% \dquotes permits usage of "..." for \hbox{...} 
+%%%   also taken from under.sty
+{\catcode`\"=\active
+\gdef\dquotes{\catcode`\"=\active  \let"=\@mathText}%
+\gdef\@mathText#1"{\hbox{\mathTextFont #1\/}}}
+\def\mathTextFont{\frenchspacing\tt}
+\def\dquotesoff{\catcode`\"=\other}
--- a/src/Doc/Logics_ZF/document/root.tex	Wed Mar 31 16:01:31 2021 +0200
+++ b/src/Doc/Logics_ZF/document/root.tex	Mon Sep 06 12:08:20 2021 +0200
@@ -13,7 +13,7 @@
 %%% to index constants:   \\tt \([a-zA-Z0-9][a-zA-Z0-9_]*\)     \\cdx{\1}  
 %%% to deverbify:         \\verb|\([^|]*\)|     \\ttindex{\1}  
 
-\title{\includegraphics[scale=0.5]{isabelle_zf} \\[4ex] 
+\title{\includegraphics[scale=0.5]{isabelle_logo} \\[4ex] 
        Isabelle's Logics: FOL and ZF}
 
 \author{{\em Lawrence C. Paulson}\\
--- a/src/Doc/Main/Main_Doc.thy	Wed Mar 31 16:01:31 2021 +0200
+++ b/src/Doc/Main/Main_Doc.thy	Mon Sep 06 12:08:20 2021 +0200
@@ -4,14 +4,14 @@
 begin
 
 setup \<open>
-  Thy_Output.antiquotation_pretty_source \<^binding>\<open>term_type_only\<close> (Args.term -- Args.typ_abbrev)
+  Document_Output.antiquotation_pretty_source \<^binding>\<open>term_type_only\<close> (Args.term -- Args.typ_abbrev)
     (fn ctxt => fn (t, T) =>
       (if fastype_of t = Sign.certify_typ (Proof_Context.theory_of ctxt) T then ()
        else error "term_type_only: type mismatch";
        Syntax.pretty_typ ctxt T))
 \<close>
 setup \<open>
-  Thy_Output.antiquotation_pretty_source \<^binding>\<open>expanded_typ\<close> Args.typ
+  Document_Output.antiquotation_pretty_source \<^binding>\<open>expanded_typ\<close> Args.typ
     Syntax.pretty_typ
 \<close>
 (*>*)
--- a/src/Doc/Main/document/build	Wed Mar 31 16:01:31 2021 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,10 +0,0 @@
-#!/usr/bin/env bash
-
-set -e
-
-FORMAT="$1"
-VARIANT="$2"
-
-isabelle latex -o "$FORMAT"
-isabelle latex -o "$FORMAT"
-
--- a/src/Doc/Nitpick/document/build	Wed Mar 31 16:01:31 2021 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,10 +0,0 @@
-#!/usr/bin/env bash
-
-set -e
-
-FORMAT="$1"
-VARIANT="$2"
-
-isabelle logo Nitpick
-"$ISABELLE_HOME/src/Doc/prepare_document" "$FORMAT"
-
--- a/src/Doc/Nitpick/document/root.tex	Wed Mar 31 16:01:31 2021 +0200
+++ b/src/Doc/Nitpick/document/root.tex	Mon Sep 06 12:08:20 2021 +0200
@@ -2,7 +2,6 @@
 \usepackage[T1]{fontenc}
 \usepackage{amsmath}
 \usepackage{amssymb}
-\usepackage[english]{babel}
 \usepackage{color}
 \usepackage{footmisc}
 \usepackage{graphicx}
@@ -32,7 +31,7 @@
 \def\undef{(\lambda x.\; \_)}
 %\def\unr{\textit{others}}
 \def\unr{\ldots}
-\def\Abs#1{\hbox{\rm{\flqq}}{\,#1\,}\hbox{\rm{\frqq}}}
+\def\Abs#1{\hbox{\rm{\guillemetleft}}{\,#1\,}\hbox{\rm{\guillemetright}}}
 \def\Q{{\smash{\lower.2ex\hbox{$\scriptstyle?$}}}}
 
 \hyphenation{Mini-Sat size-change First-Steps grand-parent nit-pick
@@ -49,7 +48,7 @@
 %\renewcommand\labelitemi{$\bullet$}
 \renewcommand\labelitemi{\raise.065ex\hbox{\small\textbullet}}
 
-\title{\includegraphics[scale=0.5]{isabelle_nitpick} \\[4ex]
+\title{\includegraphics[scale=0.5]{isabelle_logo} \\[4ex]
 Picking Nits \\[\smallskipamount]
 \Large A User's Guide to Nitpick for Isabelle/HOL}
 \author{\hbox{} \\
--- a/src/Doc/Prog_Prove/LaTeXsugar.thy	Wed Mar 31 16:01:31 2021 +0200
+++ b/src/Doc/Prog_Prove/LaTeXsugar.thy	Mon Sep 06 12:08:20 2021 +0200
@@ -44,10 +44,11 @@
   "_asm" :: "prop \<Rightarrow> asms" ("_")
 
 setup \<open>
-  Thy_Output.antiquotation_pretty_source \<^binding>\<open>const_typ\<close> (Scan.lift Args.embedded_inner_syntax)
+  Document_Output.antiquotation_pretty_source \<^binding>\<open>const_typ\<close>
+    (Scan.lift Args.embedded_inner_syntax)
     (fn ctxt => fn c =>
       let val tc = Proof_Context.read_const {proper = false, strict = false} ctxt c in
-        Pretty.block [Thy_Output.pretty_term ctxt tc, Pretty.str " ::",
+        Pretty.block [Document_Output.pretty_term ctxt tc, Pretty.str " ::",
           Pretty.brk 1, Syntax.pretty_typ ctxt (fastype_of tc)]
       end)
 \<close>
--- a/src/Doc/Prog_Prove/document/build	Wed Mar 31 16:01:31 2021 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,10 +0,0 @@
-#!/usr/bin/env bash
-
-set -e
-
-FORMAT="$1"
-VARIANT="$2"
-
-isabelle logo HOL
-"$ISABELLE_HOME/src/Doc/prepare_document" "$FORMAT"
-
--- a/src/Doc/Prog_Prove/document/root.tex	Wed Mar 31 16:01:31 2021 +0200
+++ b/src/Doc/Prog_Prove/document/root.tex	Mon Sep 06 12:08:20 2021 +0200
@@ -7,7 +7,7 @@
 \begin{document}
 
 \title{Programming and Proving in Isabelle/HOL}
-\subtitle{\includegraphics[scale=.7]{isabelle_hol}}
+\subtitle{\includegraphics[scale=.7]{isabelle_logo}}
 \author{Tobias Nipkow}
 \maketitle
 
--- a/src/Doc/ROOT	Wed Mar 31 16:01:31 2021 +0200
+++ b/src/Doc/ROOT	Mon Sep 06 12:08:20 2021 +0200
@@ -1,23 +1,23 @@
 chapter Doc
 
 session Classes (doc) in "Classes" = HOL +
-  options [document_variants = "classes", quick_and_dirty]
+  options [document_logo = "Isar", document_bibliography,
+    document_variants = "classes", quick_and_dirty]
   theories [document = false] Setup
   theories Classes
   document_files (in "..")
-    "prepare_document"
     "pdfsetup.sty"
     "iman.sty"
     "extra.sty"
     "isar.sty"
     "manual.bib"
   document_files
-    "build"
     "root.tex"
     "style.sty"
 
 session Codegen (doc) in "Codegen" = HOL +
-  options [document_variants = "codegen", print_mode = "no_brackets,iff"]
+  options [document_logo = "Isar", document_bibliography, document_variants = "codegen",
+    print_mode = "no_brackets,iff"]
   sessions
     "HOL-Library"
   theories [document = false]
@@ -32,35 +32,31 @@
     Adaptation
     Further
   document_files (in "..")
-    "prepare_document"
     "pdfsetup.sty"
     "iman.sty"
     "extra.sty"
     "isar.sty"
     "manual.bib"
   document_files
-    "build"
     "root.tex"
     "style.sty"
 
 session Corec (doc) in "Corec" = Datatypes +
-  options [document_variants = "corec"]
+  options [document_bibliography, document_variants = "corec"]
   theories
     Corec
   document_files (in "..")
-    "prepare_document"
     "pdfsetup.sty"
     "iman.sty"
     "extra.sty"
     "isar.sty"
     "manual.bib"
   document_files
-    "build"
     "root.tex"
     "style.sty"
 
 session Datatypes (doc) in "Datatypes" = HOL +
-  options [document_variants = "datatypes"]
+  options [document_bibliography, document_variants = "datatypes"]
   sessions
     "HOL-Library"
   theories [document = false]
@@ -68,20 +64,18 @@
   theories
     Datatypes
   document_files (in "..")
-    "prepare_document"
     "pdfsetup.sty"
     "iman.sty"
     "extra.sty"
     "isar.sty"
     "manual.bib"
   document_files
-    "build"
     "root.tex"
     "style.sty"
 
 session Eisbach (doc) in "Eisbach" = HOL +
-  options [document_variants = "eisbach", quick_and_dirty,
-    print_mode = "no_brackets,iff", show_question_marks = false]
+  options [document_logo = "Eisbach", document_bibliography, document_variants = "eisbach",
+    quick_and_dirty, print_mode = "no_brackets,iff", show_question_marks = false]
   sessions
     "HOL-Eisbach"
   theories [document = false]
@@ -90,7 +84,6 @@
     Preface
     Manual
   document_files (in "..")
-    "prepare_document"
     "pdfsetup.sty"
     "iman.sty"
     "extra.sty"
@@ -99,22 +92,20 @@
     "underscore.sty"
     "manual.bib"
   document_files
-    "build"
     "root.tex"
     "style.sty"
 
 session Functions (doc) in "Functions" = HOL +
-  options [document_variants = "functions", skip_proofs = false, quick_and_dirty]
+  options [document_bibliography, document_variants = "functions",
+    skip_proofs = false, quick_and_dirty]
   theories Functions
   document_files (in "..")
-    "prepare_document"
     "pdfsetup.sty"
     "iman.sty"
     "extra.sty"
     "isar.sty"
     "manual.bib"
   document_files
-    "build"
     "conclusion.tex"
     "intro.tex"
     "root.tex"
@@ -130,9 +121,9 @@
     "prelude.tex"
 
 session Intro (doc) in "Intro" = Pure +
-  options [document_variants = "intro"]
+  options [document_logo = "_", document_bibliography, document_build = "build",
+    document_variants = "intro"]
   document_files (in "..")
-    "prepare_document"
     "pdfsetup.sty"
     "iman.sty"
     "extra.sty"
@@ -146,7 +137,8 @@
     "root.tex"
 
 session Implementation (doc) in "Implementation" = HOL +
-  options [document_variants = "implementation", quick_and_dirty]
+  options [document_logo = "Isar", document_bibliography,
+    document_variants = "implementation", quick_and_dirty]
   theories
     Eq
     Integration
@@ -160,7 +152,6 @@
   theories [parallel_proofs = 0]
     Logic
   document_files (in "..")
-    "prepare_document"
     "pdfsetup.sty"
     "iman.sty"
     "extra.sty"
@@ -169,12 +160,12 @@
     "underscore.sty"
     "manual.bib"
   document_files
-    "build"
     "root.tex"
     "style.sty"
 
 session Isar_Ref (doc) in "Isar_Ref" = HOL +
-  options [document_variants = "isar-ref", quick_and_dirty, thy_output_source]
+  options [document_logo = "Isar", document_bibliography, document_variants = "isar-ref",
+    quick_and_dirty, thy_output_source]
   sessions
     "HOL-Library"
   theories
@@ -193,7 +184,6 @@
     Quick_Reference
     Symbols
   document_files (in "..")
-    "prepare_document"
     "pdfsetup.sty"
     "iman.sty"
     "extra.sty"
@@ -202,15 +192,14 @@
     "underscore.sty"
     "manual.bib"
   document_files
-    "build"
     "isar-vm.pdf"
     "isar-vm.svg"
     "root.tex"
-    "showsymbols"
     "style.sty"
 
 session JEdit (doc) in "JEdit" = HOL +
-  options [document_variants = "jedit", thy_output_source]
+  options [document_logo = "jEdit", document_bibliography, document_variants = "jedit",
+    thy_output_source]
   theories
     JEdit
   document_files (in "..")
@@ -219,7 +208,6 @@
     "isar.sty"
     "manual.bib"
     "pdfsetup.sty"
-    "prepare_document"
     "ttbox.sty"
     "underscore.sty"
   document_files (in "../Isar_Ref/document")
@@ -227,7 +215,6 @@
   document_files
     "auto-tools.png"
     "bibtex-mode.png"
-    "build"
     "cite-completion.png"
     "isabelle-jedit.png"
     "markdown-document.png"
@@ -247,54 +234,52 @@
     "theories.png"
 
 session Sugar (doc) in "Sugar" = HOL +
-  options [document_variants = "sugar"]
+  options [document_bibliography, document_variants = "sugar"]
   sessions
     "HOL-Library"
   theories Sugar
   document_files (in "..")
-    "prepare_document"
     "pdfsetup.sty"
   document_files
-    "build"
     "root.bib"
     "root.tex"
 
 session Locales (doc) in "Locales" = HOL +
-  options [document_variants = "locales", thy_output_margin = 65, skip_proofs = false]
+  options [document_bibliography, document_variants = "locales",
+    thy_output_margin = 65, skip_proofs = false]
   theories
     Examples1
     Examples2
     Examples3
   document_files (in "..")
-    "prepare_document"
     "pdfsetup.sty"
   document_files
-    "build"
     "root.bib"
     "root.tex"
 
 session Logics (doc) in "Logics" = Pure +
-  options [document_variants = "logics"]
+  options [document_logo = "_", document_bibliography, document_build = "build",
+    document_variants = "logics"]
   document_files (in "..")
-    "prepare_document"
     "pdfsetup.sty"
     "iman.sty"
     "extra.sty"
     "ttbox.sty"
     "manual.bib"
+  document_files (in "../Intro/document")
+    "build"
   document_files
     "CTT.tex"
     "HOL.tex"
     "LK.tex"
     "Sequents.tex"
-    "build"
     "preface.tex"
     "root.tex"
     "syntax.tex"
 
 session Logics_ZF (doc) in "Logics_ZF" = ZF +
-  options [document_variants = "logics-ZF", print_mode = "brackets",
-    thy_output_source]
+  options [document_logo = "ZF", document_bibliography, document_build = "build",
+    document_variants = "logics-ZF", print_mode = "brackets", thy_output_source]
   sessions
     FOL
   theories
@@ -304,17 +289,17 @@
     If
     ZF_Isar
   document_files (in "..")
-    "prepare_document"
     "pdfsetup.sty"
     "isar.sty"
     "ttbox.sty"
     "manual.bib"
+  document_files (in "../Intro/document")
+    "build"
   document_files (in "../Logics/document")
     "syntax.tex"
   document_files
     "FOL.tex"
     "ZF.tex"
-    "build"
     "logics.sty"
     "root.tex"
 
@@ -322,25 +307,22 @@
   options [document_variants = "main"]
   theories Main_Doc
   document_files (in "..")
-    "prepare_document"
     "pdfsetup.sty"
   document_files
-    "build"
     "root.tex"
 
 session Nitpick (doc) in "Nitpick" = Pure +
-  options [document_variants = "nitpick"]
+  options [document_logo = "Nitpick", document_bibliography, document_variants = "nitpick"]
   document_files (in "..")
-    "prepare_document"
     "pdfsetup.sty"
     "iman.sty"
     "manual.bib"
   document_files
-    "build"
     "root.tex"
 
 session Prog_Prove (doc) in "Prog_Prove" = HOL +
-  options [document_variants = "prog-prove", show_question_marks = false]
+  options [document_logo = "HOL", document_bibliography, document_variants = "prog-prove",
+    show_question_marks = false]
   theories
     Basics
     Bool_nat_list
@@ -351,11 +333,9 @@
   document_files (in ".")
     "MyList.thy"
   document_files (in "..")
-    "prepare_document"
     "pdfsetup.sty"
   document_files
     "bang.pdf"
-    "build"
     "intro-isabelle.tex"
     "prelude.tex"
     "root.bib"
@@ -363,18 +343,17 @@
     "svmono.cls"
 
 session Sledgehammer (doc) in "Sledgehammer" = Pure +
-  options [document_variants = "sledgehammer"]
+  options [document_logo = "S/H", document_bibliography, document_variants = "sledgehammer"]
   document_files (in "..")
-    "prepare_document"
     "pdfsetup.sty"
     "iman.sty"
     "manual.bib"
   document_files
-    "build"
     "root.tex"
 
 session System (doc) in "System" = Pure +
-  options [document_variants = "system", thy_output_source]
+  options [document_logo = "_", document_bibliography, document_variants = "system",
+    thy_output_source]
   sessions
     "HOL-Library"
   theories
@@ -386,7 +365,6 @@
     Phabricator
     Misc
   document_files (in "..")
-    "prepare_document"
     "pdfsetup.sty"
     "iman.sty"
     "extra.sty"
@@ -397,11 +375,11 @@
   document_files (in "../Isar_Ref/document")
     "style.sty"
   document_files
-    "build"
     "root.tex"
 
 session Tutorial (doc) in "Tutorial" = HOL +
-  options [document_variants = "tutorial", print_mode = "brackets", skip_proofs = false]
+  options [document_logo = "HOL", document_bibliography, document_build = "build",
+    document_variants = "tutorial", print_mode = "brackets", skip_proofs = false]
   directories "Advanced" "CTL" "CodeGen" "Datatype" "Documents" "Fun" "Ifexpr"
     "Inductive" "Misc" "Protocol" "Rules" "Sets" "ToyList" "Trie" "Types"
   theories [document = false]
@@ -494,7 +472,7 @@
     "types0.tex"
 
 session Typeclass_Hierarchy (doc) in "Typeclass_Hierarchy" = HOL +
-  options [document_variants = "typeclass_hierarchy"]
+  options [document_logo = "Isar", document_bibliography, document_variants = "typeclass_hierarchy"]
   sessions
     "HOL-Library"
   theories [document = false]
@@ -502,13 +480,11 @@
   theories
     Typeclass_Hierarchy
   document_files (in "..")
-    "prepare_document"
     "pdfsetup.sty"
     "iman.sty"
     "extra.sty"
     "isar.sty"
     "manual.bib"
   document_files
-    "build"
     "root.tex"
     "style.sty"
--- a/src/Doc/Sledgehammer/document/build	Wed Mar 31 16:01:31 2021 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,9 +0,0 @@
-#!/usr/bin/env bash
-
-set -e
-
-FORMAT="$1"
-VARIANT="$2"
-
-isabelle logo -o isabelle_sledgehammer.pdf "S/H"
-"$ISABELLE_HOME/src/Doc/prepare_document" "$FORMAT"
--- a/src/Doc/Sledgehammer/document/root.tex	Wed Mar 31 16:01:31 2021 +0200
+++ b/src/Doc/Sledgehammer/document/root.tex	Mon Sep 06 12:08:20 2021 +0200
@@ -2,7 +2,6 @@
 \usepackage[T1]{fontenc}
 \usepackage{amsmath}
 \usepackage{amssymb}
-\usepackage[english]{babel}
 \usepackage{color}
 \usepackage{footmisc}
 \usepackage{graphicx}
@@ -40,7 +39,7 @@
 \def\undef{(\lambda x.\; \unk)}
 %\def\unr{\textit{others}}
 \def\unr{\ldots}
-\def\Abs#1{\hbox{\rm{\flqq}}{\,#1\,}\hbox{\rm{\frqq}}}
+\def\Abs#1{\hbox{\rm{\guillemetleft}}{\,#1\,}\hbox{\rm{\guillemetright}}}
 \def\Q{{\smash{\lower.2ex\hbox{$\scriptstyle?$}}}}
 
 \urlstyle{tt}
@@ -55,7 +54,7 @@
 %\renewcommand\labelitemi{$\bullet$}
 \renewcommand\labelitemi{\raise.065ex\hbox{\small\textbullet}}
 
-\title{\includegraphics[scale=0.5]{isabelle_sledgehammer} \\[4ex]
+\title{\includegraphics[scale=0.5]{isabelle_logo} \\[4ex]
 Hammering Away \\[\smallskipamount]
 \Large A User's Guide to Sledgehammer for Isabelle/HOL}
 \author{\hbox{} \\
@@ -110,8 +109,8 @@
 Vampire \cite{riazanov-voronkov-2002}, Waldmeister \cite{waldmeister}, and
 Zipperposition \cite{cruanes-2014}. The ATPs are run either locally or remotely
 via the System\-On\-TPTP web service \cite{sutcliffe-2000}. The supported SMT
-solvers are CVC3 \cite{cvc3}, CVC4 \cite{cvc4}, veriT \cite{bouton-et-al-2009},
-and Z3 \cite{de-moura-2008}. These are always run locally.
+solvers are CVC4 \cite{cvc4}, veriT \cite{bouton-et-al-2009}, and Z3
+\cite{de-moura-2008}. These are always run locally.
 
 The problem passed to the external provers (or solvers) consists of your current
 goal together with a heuristic selection of hundreds of facts (theorems) from the
@@ -148,12 +147,11 @@
 Sledgehammer is part of Isabelle, so you do not need to install it. However, it
 relies on third-party automatic provers (ATPs and SMT solvers).
 
-Among the ATPs, agsyHOL, Alt-Ergo, E, LEO-II, Leo-III, Satallax, SPASS,
-Vampire, and Zipperposition can be run locally; in addition, agsyHOL,
-Alt-Ergo, E, iProver, LEO-II, Leo-III, Satallax, Vampire, Waldmeister,
-and Zipperposition are available remotely via System\-On\-TPTP
-\cite{sutcliffe-2000}. The SMT solvers CVC3, CVC4, veriT, and Z3 can be run
-locally.
+Among the ATPs, agsyHOL, Alt-Ergo, E, LEO-II, Leo-III, Satallax, SPASS, Vampire,
+and Zipperposition can be run locally; in addition, agsyHOL, Alt-Ergo, E,
+iProver, LEO-II, Leo-III, Satallax, Vampire, Waldmeister, and Zipperposition are
+available remotely via System\-On\-TPTP \cite{sutcliffe-2000}. The SMT solvers
+CVC4, veriT, and Z3 can be run locally.
 
 There are three main ways to install automatic provers on your machine:
 
@@ -165,9 +163,9 @@
 noncommercial user, as indicated by the message that is displayed when
 Sledgehammer is invoked the first time.
 
-\item[\labelitemi] Alternatively, you can download the Isabelle-aware CVC3,
-CVC4, E, SPASS, Vampire, veriT, and Z3 binary packages from \download. Extract
-the archives, then add a line to your \texttt{\$ISABELLE\_HOME\_USER\slash
+\item[\labelitemi] Alternatively, you can download the Isabelle-aware CVC4, E,
+SPASS, Vampire, veriT, and Z3 binary packages from \download. Extract the
+archives, then add a line to your \texttt{\$ISABELLE\_HOME\_USER\slash
 etc\slash components}%
 \footnote{The variable \texttt{\$ISABELLE\_HOME\_USER} is set by Isabelle at
 startup. Its value can be retrieved by executing \texttt{isabelle}
@@ -190,24 +188,17 @@
 \texttt{eprover} (and/or \texttt{eproof} or \texttt{eproof\_ram}),
 \texttt{leo}, \texttt{leo3}, or \texttt{satallax} executable;
 for Alt-Ergo, set the environment variable \texttt{WHY3\_HOME} to the
-directory that contains the \texttt{why3} executable. Sledgehammer has been
-tested with agsyHOL 1.0, Alt-Ergo 0.95.2, E 1.6 to 2.0, LEO-II 1.3.4, Leo-III
-1.1, and Satallax 2.7. Since the ATPs' output formats are neither documented
-nor stable, other versions might not work well with Sledgehammer. Ideally, you
+directory that contains the \texttt{why3} executable. Ideally, you
 should also set \texttt{E\_VERSION}, \texttt{LEO2\_VERSION},
 \texttt{LEO3\_VERSION}, or \texttt{SATALLAX\_VERSION} to the prover's version
-number (e.g., ``2.7''); this might help Sledgehammer invoke the prover
-optimally.
+number (e.g., ``3.6'').
 
-Similarly, if you want to install CVC3, CVC4, veriT, or Z3, set the environment
-variable \texttt{CVC3\_\allowbreak SOLVER}, \texttt{CVC4\_\allowbreak SOLVER},
-\texttt{VERIT\_\allowbreak SOLVER}, or \texttt{Z3\_SOLVER} to the complete path
-of the executable, \emph{including the file name}. Sledgehammer has been tested
-with CVC3 2.2 and 2.4.1, CVC4 1.5-prerelease, veriT 2020.10-rmx, and Z3 4.3.2.
-Since Z3's output format is somewhat unstable, other versions of the solver
-might not work well with Sledgehammer. Ideally, also set
-\texttt{CVC3\_VERSION}, \texttt{CVC4\_VERSION}, \texttt{VERIT\_VERSION}, or
-\texttt{Z3\_VERSION} to the solver's version number (e.g., ``4.4.0'').
+Similarly, if you want to install CVC4, veriT, or Z3, set the environment
+variable \texttt{CVC4\_\allowbreak SOLVER}, \texttt{VERIT\_\allowbreak SOLVER},
+or \texttt{Z3\_SOLVER} to the complete path of the executable, \emph{including
+the file name}. Ideally, also set \texttt{CVC4\_VERSION},
+\texttt{VERIT\_VERSION}, or \texttt{Z3\_VERSION} to the solver's version number
+(e.g., ``4.4.0'').
 \end{enum}
 \end{sloppy}
 
@@ -458,8 +449,8 @@
 \textit{full\_types} option to \textit{metis} directly.
 
 
-\point{And what are the \textit{lifting} and \textit{hide\_lams} \\ arguments
-to Metis?}
+\point{And what are the \textit{lifting} and \textit{opaque\_lifting} \\
+arguments to Metis?}
 
 Orthogonally to the encoding of types, it is important to choose an appropriate
 translation of $\lambda$-abstractions. Metis supports three translation
@@ -615,7 +606,7 @@
 with the same semantics as Sledgehammer's \textit{type\_enc} option
 (\S\ref{problem-encoding}).
 %
-The supported $\lambda$ translation schemes are \textit{hide\_lams},
+The supported $\lambda$ translation schemes are \textit{opaque\_lifting},
 \textit{lifting}, and \textit{combs} (the default).
 %
 All the untyped type encodings listed in \S\ref{problem-encoding} are supported.
@@ -690,8 +681,7 @@
 \item[\labelitemi] \textbf{\textit{agsyhol}:} agsyHOL is an automatic
 higher-order prover developed by Fredrik Lindblad \cite{agsyHOL}. To use
 agsyHOL, set the environment variable \texttt{AGSYHOL\_HOME} to the directory
-that contains the \texttt{agsyHOL} executable. Sledgehammer has been tested
-with version 1.0.
+that contains the \texttt{agsyHOL} executable.
 
 \item[\labelitemi] \textbf{\textit{alt\_ergo}:} Alt-Ergo is a polymorphic
 ATP developed by Bobot et al.\ \cite{alt-ergo}.
@@ -700,83 +690,73 @@
 to the directory that contains the \texttt{why3} executable. Sledgehammer
 requires Alt-Ergo 0.95.2 and Why3 0.83.
 
-\item[\labelitemi] \textbf{\textit{cvc3}:} CVC3 is an SMT solver developed by
-Clark Barrett, Cesare Tinelli, and their colleagues \cite{cvc3}. To use CVC3,
-set the environment variable \texttt{CVC3\_SOLVER} to the complete path of the
-executable, including the file name, or install the prebuilt CVC3 package from
-\download. Sledgehammer has been tested with versions 2.2 and 2.4.1.
-
-\item[\labelitemi] \textbf{\textit{cvc4}:} CVC4 \cite{cvc4} is the successor to
-CVC3. To use CVC4, set the environment variable \texttt{CVC4\_SOLVER} to the
-complete path of the executable, including the file name, or install the
-prebuilt CVC4 package from \download. Sledgehammer has been tested with version
-1.5-prerelease.
+\item[\labelitemi] \textbf{\textit{cvc4}:} CVC4 is an SMT solver developed by
+Clark Barrett, Cesare Tinelli, and their colleagues \cite{cvc4}. To use CVC4,
+set the environment variable \texttt{CVC4\_SOLVER} to the complete path of the
+executable, including the file name, or install the prebuilt CVC4 package from
+\download.
 
 \item[\labelitemi] \textbf{\textit{e}:} E is a first-order resolution prover
 developed by Stephan Schulz \cite{schulz-2019}. To use E, set the environment
 variable \texttt{E\_HOME} to the directory that contains the \texttt{eproof}
 executable and \texttt{E\_VERSION} to the version number (e.g., ``1.8''), or
-install the prebuilt E package from \download. Sledgehammer has been tested with
-versions 1.6 to 1.8.
+install the prebuilt E package from \download.
 
 \item[\labelitemi] \textbf{\textit{iprover}:} iProver is a pure
-instantiation-based prover developed by Konstantin Korovin
-\cite{korovin-2009}. To use iProver, set the environment variable
-\texttt{IPROVER\_HOME} to the directory that contains the \texttt{iproveropt}
-executable. Sledgehammer has been tested with version 2.8. iProver depends on
-E to clausify problems, so make sure that E is installed as well.
+instantiation-based prover developed by Konstantin Korovin \cite{korovin-2009}.
+To use iProver, set the environment variable \texttt{IPROVER\_HOME} to the
+directory that contains the \texttt{iproveropt} executable. iProver depends on
+Vampire to clausify problems, so make sure that Vampire is installed as well.
 
 \item[\labelitemi] \textbf{\textit{leo2}:} LEO-II is an automatic
 higher-order prover developed by Christoph Benzm\"uller et al.\ \cite{leo2},
 with support for the TPTP typed higher-order syntax (TH0). To use LEO-II, set
 the environment variable \texttt{LEO2\_HOME} to the directory that contains the
-\texttt{leo} executable. Sledgehammer has been tested with version 1.3.4.
+\texttt{leo} executable.
 
 \item[\labelitemi] \textbf{\textit{leo3}:} Leo-III is an automatic
 higher-order prover developed by Alexander Steen, Max Wisniewski, Christoph
 Benzm\"uller et al.\ \cite{leo3},
 with support for the TPTP typed higher-order syntax (TH0). To use Leo-III, set
 the environment variable \texttt{LEO3\_HOME} to the directory that contains the
-\texttt{leo3} executable. Sledgehammer has been tested with version 1.1.
+\texttt{leo3} executable.
 
 \item[\labelitemi] \textbf{\textit{satallax}:} Satallax is an automatic
 higher-order prover developed by Chad Brown et al.\ \cite{satallax}, with
 support for the TPTP typed higher-order syntax (TH0). To use Satallax, set the
 environment variable \texttt{SATALLAX\_HOME} to the directory that contains the
-\texttt{satallax} executable. Sledgehammer has been tested with version 2.2.
+\texttt{satallax} executable.
 
 \item[\labelitemi] \textbf{\textit{spass}:} SPASS is a first-order resolution
 prover developed by Christoph Weidenbach et al.\ \cite{weidenbach-et-al-2009}.
 To use SPASS, set the environment variable \texttt{SPASS\_HOME} to the directory
 that contains the \texttt{SPASS} executable and \texttt{SPASS\_VERSION} to the
 version number (e.g., ``3.8ds''), or install the prebuilt SPASS package from
-\download. Sledgehammer has been tested with version 3.8ds.
+\download.
 
 \item[\labelitemi] \textbf{\textit{vampire}:} Vampire is a first-order
 resolution prover developed by Andrei Voronkov and his colleagues
 \cite{riazanov-voronkov-2002}. To use Vampire, set the environment variable
 \texttt{VAMPIRE\_HOME} to the directory that contains the \texttt{vampire}
 executable and \texttt{VAMPIRE\_VERSION} to the version number (e.g.,
-``4.2.2''). Sledgehammer has been tested with versions 1.8 to 4.2.2 (in the
-post-2010 numbering scheme).
+``4.2.2'').
 
 \item[\labelitemi] \textbf{\textit{verit}:} veriT \cite{bouton-et-al-2009} is an
 SMT solver developed by David D\'eharbe, Pascal Fontaine, and their colleagues.
 It is designed to produce detailed proofs for reconstruction in proof
 assistants. To use veriT, set the environment variable \texttt{VERIT\_SOLVER}
-to the complete path of the executable, including the file name. Sledgehammer
-has been tested with version 2020.10-rmx.
+to the complete path of the executable, including the file name.
 
 \item[\labelitemi] \textbf{\textit{z3}:} Z3 is an SMT solver developed at
 Microsoft Research \cite{de-moura-2008}. To use Z3, set the environment variable
 \texttt{Z3\_SOLVER} to the complete path of the executable, including the
-file name. Sledgehammer has been tested with a pre-release version of 4.4.0.
+file name.
 
 \item[\labelitemi] \textbf{\textit{z3\_tptp}:} This version of Z3 pretends to
 be an ATP, exploiting Z3's support for the TPTP typed first-order format (TF0).
-It is included for experimental purposes. Sledgehammer has been tested with
-version 4.3.1. To use it, set the environment variable \texttt{Z3\_TPTP\_HOME}
-to the directory that contains the \texttt{z3\_tptp} executable.
+It is included for experimental purposes. To use it, set the environment
+variable \texttt{Z3\_TPTP\_HOME} to the directory that contains the
+\texttt{z3\_tptp} executable.
 
 \item[\labelitemi] \textbf{\textit{zipperposition}:} Zipperposition
 \cite{cruanes-2014} is a higher-order superposition prover developed by Simon
@@ -784,7 +764,6 @@
 environment variable \texttt{ZIPPERPOSITION\_HOME} to the directory that
 contains the \texttt{zipperposition} executable and
 \texttt{ZIPPERPOSITION\_VERSION} to the version number (e.g., ``2.0.1'').
-Sledgehammer has been tested with version 2.0.1.
 \end{enum}
 
 \end{sloppy}
@@ -811,9 +790,6 @@
 \item[\labelitemi] \textbf{\textit{remote\_leo3}:} The remote version of Leo-III
 runs on Geoff Sutcliffe's Miami servers \cite{sutcliffe-2000}.
 
-\item[\labelitemi] \textbf{\textit{remote\_vampire}:} The remote version of
-Vampire runs on Geoff Sutcliffe's Miami servers.
-
 \item[\labelitemi] \textbf{\textit{remote\_waldmeister}:} Waldmeister is a unit
 equality prover developed by Hillenbrand et al.\ \cite{waldmeister}. It can be
 used to prove universally quantified equations using unconditional equations,
@@ -962,6 +938,25 @@
 
 \nopagebreak
 {\small See also \textit{type\_enc} (\S\ref{problem-encoding}).}
+
+\opdefault{induction\_rules}{string}{smart}
+Specifies whether induction rules should be considered as relevant facts.
+The following behaviors are available:
+\begin{enum}
+\item[\labelitemi] \textbf{\textit{include}:}
+Induction rules are considered by the relevance filter.
+
+\item[\labelitemi] \textbf{\textit{exclude}:}
+Induction rules are ignored by the relevance filter.
+
+\item[\labelitemi] \textbf{\textit{instantiated}:}
+Induction rules are instantiated based on the conjecture and then
+considered by the relevance filter.
+
+\item[\labelitemi] \textbf{\textit{smart}:}
+Same as \textit{include} if the prover supports higher-order logic;
+same as \textit{exclude} otherwise.
+\end{enum}
 \end{enum}
 
 
@@ -976,14 +971,15 @@
 translation schemes are listed below:
 
 \begin{enum}
-\item[\labelitemi] \textbf{\textit{hide\_lams}:} Hide the $\lambda$-abstractions
-by replacing them by unspecified fresh constants, effectively disabling all
-reasoning under $\lambda$-abstractions.
-
 \item[\labelitemi] \textbf{\textit{lifting}:} Introduce a new
 supercombinator \const{c} for each cluster of $n$~$\lambda$-abstractions,
 defined using an equation $\const{c}~x_1~\ldots~x_n = t$ ($\lambda$-lifting).
 
+\item[\labelitemi] \textbf{\textit{opaque\_lifting}:} Same as
+\textit{lifting}, except that the supercombinators are kept opaque,
+i.e. they are unspecified fresh constants. This effectively disables
+all reasoning under $\lambda$-abstractions.
+
 \item[\labelitemi] \textbf{\textit{combs}:} Rewrite lambdas to the Curry
 combinators (\comb{I}, \comb{K}, \comb{S}, \comb{B}, \comb{C}). Combinators
 enable the ATPs to synthesize $\lambda$-terms but tend to yield bulkier formulas
@@ -991,6 +987,10 @@
 equational definitions of the combinators are very prolific in the context of
 resolution.
 
+\item[\labelitemi] \textbf{\textit{opaque\_combs}:} Same as
+\textit{combs}, except that the combinators are kept opaque, i.e. without
+equational definitions.
+
 \item[\labelitemi] \textbf{\textit{combs\_and\_lifting}:} Introduce a new
 supercombinator \const{c} for each cluster of $\lambda$-abstractions and characterize it both using a
 lifted equation $\const{c}~x_1~\ldots~x_n = t$ and via Curry combinators.
@@ -1001,7 +1001,7 @@
 
 \item[\labelitemi] \textbf{\textit{keep\_lams}:}
 Keep the $\lambda$-abstractions in the generated problems. This is available
-only with provers that support the TH0 syntax.
+only with provers that support $\lambda$s.
 
 \item[\labelitemi] \textbf{\textit{smart}:} The actual translation scheme used
 depends on the ATP and should be the most efficient scheme for that ATP.
@@ -1235,86 +1235,111 @@
 \label{mirabelle}
 
 The \texttt{isabelle mirabelle} tool executes Sledgehammer or other advisory
-tools (e.g., Nitpick) or tactics (e.g., \textit{auto}) on all subgoals emering
+tools (e.g., Nitpick) or tactics (e.g., \textit{auto}) on all subgoals emerging
 in a theory. It is typically used to measure the success rate of a proof tool
 on some benchmark. Its command-line usage is as follows:
 
 {\small
 \begin{verbatim}
-isabelle mirabelle [OPTIONS] ACTIONS FILES
+Usage: isabelle mirabelle [OPTIONS] [SESSIONS ...]
 
   Options are:
-    -L LOGIC     parent logic to use (default HOL)
-    -O DIR       output directory for test data (default None)
-    -S FILE      user-provided setup file (no actions required)
-    -T THEORY    parent theory to use (default Main)
-    -d DIR       include session directory
-    -q           be quiet (suppress output of Isabelle process)
-    -t TIMEOUT   timeout for each action in seconds (default 30)
+    -A ACTION    add to list of actions
+    -O DIR       output directory for log files (default: "mirabelle")
+    -T THEORY    theory restriction: NAME or NAME[FIRST_LINE:LAST_LINE]
+    -m INT       max. no. of calls to each action (0: unbounded) (default 0)
+    -s INT       run actions on every nth goal (0: uniform distribution) (default 1)
+    -t SECONDS   timeout in seconds for each action (default 30)
+    ...
 
-  Apply the given actions at all proof steps in the given theory
-  files.
+  Apply the given ACTIONs at all theories and proof steps of the
+  specified sessions.
+
+  The absence of theory restrictions (option -T) means to check all
+  theories fully. Otherwise only the named theories are checked.
 \end{verbatim}
 }
 
-Option \texttt{-L LOGIC} specifies the parent session to use. This is often a
-logic (e.g., \texttt{Pure}, \texttt{HOL}) but may be any session (e.g., from
-the AFP). Using multiple sessions is not supported. If a theory A needs to
-import theories from multiple sessions, this limitation can be overcome as
-follows:
+Option \texttt{-A ACTION} specifies an action to run on all subgoals. When
+specified multiple times, all actions are performed in parallel on all
+selected subgoals. Available actions are \texttt{arith}, \texttt{metis},
+\texttt{quickcheck}, \texttt{sledgehammer}, \texttt{sledgehammer\_filter}, and
+\texttt{try0}.
+
+Option \texttt{-O DIR} specifies the output directory, which is created
+if needed. In this directory, a log file named "mirabelle.log" records the
+position of each tested subgoal and the result of executing the actions.
 
-\begin{enumerate}
-  \item Define a custom session \texttt{S} with a single theory \texttt{B}.
-  \item Move all imports from \texttt{A} to \texttt{B}.
-  \item Build the heap image of \texttt{S}.
-  \item Import \texttt{S.B} from theory \texttt{A}.
-  \item Execute Mirabelle with \texttt{C} as parent logic (i.e., with
-    \texttt{-L S}).
-\end{enumerate}
+Option \texttt{-T THEORY} restricts the subgoals to those emerging from this
+theory. When not provided, all subgoals from are theories are selected. When
+provided multiple times, the union of all specified theories' subgoals is
+selected.
 
-Option \texttt{-O DIR} specifies the output directory, which is created if
-needed. In this directory, one log file per theory records the position of each
-tested subgoal and the result of executing the action.
+Option \texttt{-m INT} specifies a maximum number of goals on which the action
+are run.
 
-Option \texttt{-t TIMEOUT} specifies a generic timeout that the actions may
+Option \texttt{-s INT} specifies a stride, effectively running the actions on
+every n$^{th}$ goal.
+
+Option \texttt{-t SECONDS} specifies a generic timeout that the actions may
 interpret differently.
 
-More specific documentation about the \texttt{ACTIONS} and \texttt{FILES}
-parameters and their corresponding options can be found in the Isabelle tool
+More specific documentation about low-level options, the \texttt{ACTION}
+parameter, and its corresponding options can be found in the Isabelle tool
 usage by entering \texttt{isabelle mirabelle -?} on the command line.
 
+The following subsections assume that the environment variable \texttt{AFP} is
+defined and points to a release of the Archive of Formal Proofs.
+
 \subsection{Example of Benchmarking Sledgehammer}
 
 \begin{verbatim}
-isabelle mirabelle -O output/ \
-  sledgehammer[prover=e,prover_timeout=10] Huffman.thy
+isabelle mirabelle -d $AFP -O output \
+  -A "sledgehammer[prover=e, prover_timeout=30]" \
+  VeriComp
+\end{verbatim}
+
+This command specifies to run the Sledgehammer action, using the E prover with
+a timeout of 10 seconds, on all subgoals emerging from all theory in the AFP
+session VeriComp. The results are written to \texttt{output/mirabelle.log}.
+
+\begin{verbatim}
+isabelle mirabelle -d $AFP -O output \
+  -T Semantics -T Compiler \
+  -A "sledgehammer[prover=e, prover_timeout=30]" \
+  VeriComp
 \end{verbatim}
 
-This command specifies Sledgehammer as the action, using the E prover with a
-timeout of 10 seconds. The results are written to \texttt{output/Huffman.log}.
+This command also specifies to run the Sledgehammer action, but this time only
+on subgoals emerging from theories Semantics or Compiler.
 
-\subsection{Example of Benchmarking Another Tool}
+
+\subsection{Example of Benchmarking Multiple Tools}
 
 \begin{verbatim}
-isabelle mirabelle -O output/ -t 10 try0 Huffman.thy
+isabelle mirabelle -d $AFP -O output -t 10 \
+  -A "try0" -A "metis" \
+  VeriComp
 \end{verbatim}
 
-This command specifies the \textbf{try0} command as the action, with a timeout
-of 10 seconds. The results are written to \texttt{output/Huffman.log}.
+This command specifies two actions running the \textbf{try0} and \textbf{metis}
+commands, respectively, each with a timeout of 10 seconds. The results are
+written to \texttt{output/mirabelle.log}.
 
 \subsection{Example of Generating TPTP Files}
 
 \begin{verbatim}
-isabelle mirabelle -O output/ \
-  sledgehammer[prover=e,prover_timeout=1,keep=/tptp/files/] \
-  Huffman.thy
+isabelle mirabelle -d $AFP -O output \
+  -A "sledgehammer[prover=e, prover_timeout=5, keep=true]" \
+  VeriComp
 \end{verbatim}
 
-This command generates TPTP files using Sledgehammer. Since the file is
-generated at the very beginning of every Sledgehammer invocation, a timeout of
-one second making the prover fail faster speeds up processing the theory. The
-results are written in the specified directory (\texttt{/tptp/files/}),
-which must exist beforehand. A TPTP file is generated for each subgoal.
+This command generates TPTP files using Sledgehammer. Since the file
+is generated at the very beginning of every Sledgehammer invocation,
+a timeout of five seconds making the prover fail faster speeds up
+processing the subgoals. The results are written in an action-specific
+subdirectory of the specified output directory (\texttt{output}). A TPTP
+file is generated for each subgoal.
 
 \let\em=\sl
 \bibliography{manual}{}
--- a/src/Doc/Sugar/document/build	Wed Mar 31 16:01:31 2021 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,9 +0,0 @@
-#!/usr/bin/env bash
-
-set -e
-
-FORMAT="$1"
-VARIANT="$2"
-
-"$ISABELLE_HOME/src/Doc/prepare_document" "$FORMAT"
-
--- a/src/Doc/System/Environment.thy	Wed Mar 31 16:01:31 2021 +0200
+++ b/src/Doc/System/Environment.thy	Mon Sep 06 12:08:20 2021 +0200
@@ -110,39 +110,28 @@
   defaults may be overridden by a private \<^verbatim>\<open>$ISABELLE_HOME_USER/etc/settings\<close>.
 
   \<^descr>[@{setting_def ISABELLE_PLATFORM_FAMILY}\<open>\<^sup>*\<close>] is automatically set to the
-  general platform family: \<^verbatim>\<open>linux\<close>, \<^verbatim>\<open>macos\<close>, \<^verbatim>\<open>windows\<close>. Note that
+  general platform family (\<^verbatim>\<open>linux\<close>, \<^verbatim>\<open>macos\<close>, \<^verbatim>\<open>windows\<close>). Note that
   platform-dependent tools usually need to refer to the more specific
   identification according to @{setting ISABELLE_PLATFORM64}, @{setting
-  ISABELLE_PLATFORM32}, @{setting ISABELLE_WINDOWS_PLATFORM64}, @{setting
-  ISABELLE_WINDOWS_PLATFORM32}.
-
-  \<^descr>[@{setting_def ISABELLE_PLATFORM64}\<open>\<^sup>*\<close>, @{setting_def
-  ISABELLE_PLATFORM32}\<open>\<^sup>*\<close>] indicate the standard Posix platform: \<^verbatim>\<open>x86_64\<close>
-  for 64 bit and \<^verbatim>\<open>x86\<close> for 32 bit, together with a symbolic name for the
-  operating system (\<^verbatim>\<open>linux\<close>, \<^verbatim>\<open>darwin\<close>, \<^verbatim>\<open>cygwin\<close>). All platforms support 64
-  bit executables, some platforms also support 32 bit executables.
+  ISABELLE_WINDOWS_PLATFORM64}, @{setting ISABELLE_APPLE_PLATFORM64}.
 
-  In GNU bash scripts, it is possible to use the following expressions (with
-  quotes) to specify a preference of 64 bit over 32 bit:
-
-  @{verbatim [display] \<open>"${ISABELLE_PLATFORM64:-$ISABELLE_PLATFORM32}"\<close>}
-
-  In contrast, the subsequent expression prefers the old 32 bit variant (which
-  is only relevant for unusual applications):
-
-  @{verbatim [display] \<open>"${ISABELLE_PLATFORM32:-$ISABELLE_PLATFORM64}"\<close>}
+  \<^descr>[@{setting_def ISABELLE_PLATFORM64}\<open>\<^sup>*\<close>] indicates the standard Posix
+  platform (\<^verbatim>\<open>x86_64\<close>, \<^verbatim>\<open>arm64\<close>), together with a symbolic name for the
+  operating system (\<^verbatim>\<open>linux\<close>, \<^verbatim>\<open>darwin\<close>, \<^verbatim>\<open>cygwin\<close>).
 
   \<^descr>[@{setting_def ISABELLE_WINDOWS_PLATFORM64}\<open>\<^sup>*\<close>, @{setting_def
-  ISABELLE_WINDOWS_PLATFORM32}\<open>\<^sup>*\<close>] indicate the native Windows platform.
-  These settings are analogous (but independent) of those for the standard
-  Posix subsystem: @{setting ISABELLE_PLATFORM64}, @{setting
-  ISABELLE_PLATFORM32}.
+  ISABELLE_WINDOWS_PLATFORM32}\<open>\<^sup>*\<close>] indicate the native Windows platform: both
+  64\,bit and 32\,bit executables are supported here.
 
   In GNU bash scripts, a preference for native Windows platform variants may
   be specified like this (first 64 bit, second 32 bit):
 
   @{verbatim [display] \<open>"${ISABELLE_WINDOWS_PLATFORM64:-${ISABELLE_WINDOWS_PLATFORM32:-
-  ${ISABELLE_PLATFORM64:-$ISABELLE_PLATFORM32}}}"\<close>}
+  $ISABELLE_PLATFORM64}}"\<close>}
+
+  \<^descr>[@{setting_def ISABELLE_APPLE_PLATFORM64}\<open>\<^sup>*\<close>] indicates the native Apple
+  Silicon platform (\<^verbatim>\<open>arm64-darwin\<close> if available), instead of Intel emulation
+  via Rosetta (\<^verbatim>\<open>ISABELLE_PLATFORM64=x86_64-darwin\<close>).
 
   \<^descr>[@{setting ISABELLE_TOOL}\<open>\<^sup>*\<close>] is automatically set to the full path name
   of the @{executable isabelle} executable.
@@ -192,9 +181,10 @@
   \<^descr>[@{setting_def ISABELLE_LINE_EDITOR}] specifies the line editor for the
   @{tool_ref console} interface.
 
-  \<^descr>[@{setting_def ISABELLE_PDFLATEX}, @{setting_def ISABELLE_BIBTEX}] refer to
-  {\LaTeX} related tools for Isabelle document preparation (see also
-  \secref{sec:tool-latex}).
+  \<^descr>[@{setting_def ISABELLE_PDFLATEX}, @{setting_def ISABELLE_LUALATEX},
+  @{setting_def ISABELLE_BIBTEX}, @{setting_def ISABELLE_MAKEINDEX}] refer to
+  {\LaTeX}-related tools for Isabelle document preparation (see also
+  \secref{sec:tool-document}).
 
   \<^descr>[@{setting_def ISABELLE_TOOLS}] is a colon separated list of directories
   that are scanned by @{executable isabelle} for external utility programs
@@ -469,7 +459,7 @@
 text \<open>
   The subsequent example creates a raw Java process on the command-line and
   invokes the main Isabelle application entry point:
-  @{verbatim [display] \<open>isabelle_java isabelle.Main\<close>}
+  @{verbatim [display] \<open>isabelle_java -Djava.awt.headless=false isabelle.jedit.Main\<close>}
 \<close>
 
 
--- a/src/Doc/System/Misc.thy	Wed Mar 31 16:01:31 2021 +0200
+++ b/src/Doc/System/Misc.thy	Mon Sep 06 12:08:20 2021 +0200
@@ -77,7 +77,7 @@
   of \<^verbatim>\<open>apt-get install\<close> within the underlying Linux distribution.
 
   Option \<^verbatim>\<open>-P\<close> refers to high-level package collections: \<^verbatim>\<open>X11\<close> or \<^verbatim>\<open>latex\<close> as
-  provided by \<^verbatim>\<open>isabelle build_docker\<close> (assuming Ubuntu 18.04 LTS). This
+  provided by \<^verbatim>\<open>isabelle build_docker\<close> (assuming Ubuntu 20.04 LTS). This
   imposes extra weight on the resulting Docker images. Note that \<^verbatim>\<open>X11\<close> will
   only provide remote X11 support according to the modest GUI quality
   standards of the late 1990-ies.
@@ -220,8 +220,7 @@
   Options are:
     -a           display complete environment
     -b           print values only (doesn't work for -a)
-    -d FILE      dump complete environment to FILE
-                 (null terminated entries)
+    -d FILE      dump complete environment to file (NUL terminated entries)
 
   Get value of VARNAMES from the Isabelle settings.\<close>}
 
@@ -232,8 +231,11 @@
   to be printed.
 
   Option \<^verbatim>\<open>-d\<close> produces a dump of the complete environment to the specified
-  file. Entries are terminated by the ASCII null character, i.e.\ the C string
-  terminator.
+  file. Entries are terminated by the ASCII NUL character, i.e.\ the string
+  terminator in C. Thus the Isabelle/Scala operation
+  \<^scala_method>\<open>isabelle.Isabelle_System.init\<close> can import the settings
+  environment robustly, and provide its own
+  \<^scala_method>\<open>isabelle.Isabelle_System.getenv\<close> function.
 \<close>
 
 
--- a/src/Doc/System/Phabricator.thy	Wed Mar 31 16:01:31 2021 +0200
+++ b/src/Doc/System/Phabricator.thy	Mon Sep 06 12:08:20 2021 +0200
@@ -63,7 +63,7 @@
 section \<open>Quick start\<close>
 
 text \<open>
-  The starting point is a fresh installation of \<^bold>\<open>Ubuntu 18.04 or 20.04
+  The starting point is a fresh installation of \<^bold>\<open>Ubuntu 20.04
   LTS\<close>\<^footnote>\<open>\<^url>\<open>https://ubuntu.com/download\<close>\<close>: this version is mandatory due to
   subtle dependencies on system packages and configuration that is assumed by
   the Isabelle setup tool.
@@ -233,7 +233,7 @@
     @{verbatim [display] \<open>  systemctl reload apache2\<close>}
 
     \<^item> Install \<^verbatim>\<open>certbot\<close> from \<^url>\<open>https://certbot.eff.org\<close> following the
-    description for Apache and Ubuntu 18.04 or 20.04 on
+    description for Apache and Ubuntu 20.04 on
     \<^url>\<open>https://certbot.eff.org/lets-encrypt/ubuntubionic-apache\<close>. Run
     \<^verbatim>\<open>certbot\<close> interactively and let it operate on the domain
     \<^verbatim>\<open>vcs.example.org\<close>.
@@ -390,7 +390,7 @@
 
 text \<open>
   The @{tool_def phabricator_setup} tool installs a fresh Phabricator instance
-  on Ubuntu 18.04 or 20.04 LTS:
+  on Ubuntu 20.04 LTS:
   @{verbatim [display] \<open>Usage: isabelle phabricator_setup [OPTIONS]
 
   Options are:
@@ -428,9 +428,9 @@
   Option \<^verbatim>\<open>-M:\<close> installs a standard Mercurial release from source --- the one
   that is used by the Phabricator hosting service
   \<^url>\<open>https://admin.phacility.com\<close>. This avoids various problems with the
-  package provided by Ubuntu 18.04 or 20.04. Alternatively, an explicit file
-  path or URL the source archive (\<^verbatim>\<open>.tar.gz\<close>) may be given here. This option
-  is recommended for production use, but it requires to \<^emph>\<open>uninstall\<close> existing
+  package provided by Ubuntu 20.04. Alternatively, an explicit file path or
+  URL the source archive (\<^verbatim>\<open>.tar.gz\<close>) may be given here. This option is
+  recommended for production use, but it requires to \<^emph>\<open>uninstall\<close> existing
   Mercurial packages provided by the operating system.
 
   Option \<^verbatim>\<open>-n\<close> provides an alternative installation name. The default name
--- a/src/Doc/System/Presentation.thy	Wed Mar 31 16:01:31 2021 +0200
+++ b/src/Doc/System/Presentation.thy	Mon Sep 06 12:08:20 2021 +0200
@@ -22,8 +22,7 @@
   with the PDF into the given directory (relative to the session directory).
 
   Alternatively, @{tool_ref document} may be used to turn the generated
-  {\LaTeX} sources of a session (exports from its build database) into PDF,
-  using suitable invocations of @{tool_ref latex}.
+  {\LaTeX} sources of a session (exports from its build database) into PDF.
 \<close>
 
 
@@ -48,9 +47,9 @@
   reported by the above verbose invocation of the build process.
 
   Many Isabelle sessions (such as \<^session>\<open>HOL-Library\<close> in
-  \<^dir>\<open>~~/src/HOL/Library\<close>) also provide printable documents in PDF. These are
+  \<^dir>\<open>~~/src/HOL/Library\<close>) also provide theory documents in PDF. These are
   prepared automatically as well if enabled like this:
-  @{verbatim [display] \<open>isabelle build -o browser_info -o document=pdf -v -c HOL-Library\<close>}
+  @{verbatim [display] \<open>isabelle build -o browser_info -o document -v -c HOL-Library\<close>}
 
   Enabling both browser info and document preparation simultaneously causes an
   appropriate ``document'' link to be included in the HTML index. Documents
@@ -161,12 +160,20 @@
 
   \<^medskip> Isabelle is usually smart enough to create the PDF from the given
   \<^verbatim>\<open>root.tex\<close> and optional \<^verbatim>\<open>root.bib\<close> (bibliography) and \<^verbatim>\<open>root.idx\<close> (index)
-  using standard {\LaTeX} tools. Alternatively, \isakeyword{document\_files}
-  in the session \<^verbatim>\<open>ROOT\<close> may include an executable \<^verbatim>\<open>build\<close> script to take
-  care of that. It is invoked with command-line arguments for the document
-  format (\<^verbatim>\<open>pdf\<close>) and the document variant name. The script needs to produce
-  corresponding output files, e.g.\ \<^verbatim>\<open>root.pdf\<close> for default document variants
-  (the main work can be delegated to @{tool latex}). \<close>
+  using standard {\LaTeX} tools. Actual command-lines are given by settings
+  @{setting_ref ISABELLE_PDFLATEX}, @{setting_ref ISABELLE_LUALATEX},
+  @{setting_ref ISABELLE_BIBTEX}, @{setting_ref ISABELLE_MAKEINDEX}: these
+  variables are used without quoting in shell scripts, and thus may contain
+  additional options.
+
+  Alternatively, the session \<^verbatim>\<open>ROOT\<close> may include an option
+  \<^verbatim>\<open>document_build=build\<close> together with an executable \<^verbatim>\<open>build\<close> script in
+  \isakeyword{document\_files}: it is invoked with command-line arguments for
+  the document format (\<^verbatim>\<open>pdf\<close>) and the document variant name. The script needs
+  to produce corresponding output files, e.g.\ \<^verbatim>\<open>root.pdf\<close> for default
+  document variants.
+\<close>
+
 
 subsubsection \<open>Examples\<close>
 
@@ -177,47 +184,4 @@
   @{verbatim [display] \<open>isabelle document -v -V -O. FOL\<close>}
 \<close>
 
-
-section \<open>Running {\LaTeX} within the Isabelle environment
-  \label{sec:tool-latex}\<close>
-
-text \<open>
-  The @{tool_def latex} tool provides the basic interface for Isabelle
-  document preparation. Its usage is:
-  @{verbatim [display]
-\<open>Usage: isabelle latex [OPTIONS] [FILE]
-
-  Options are:
-    -o FORMAT    specify output format: pdf (default), bbl, idx, sty
-
-  Run LaTeX (and related tools) on FILE (default root.tex),
-  producing the specified output format.\<close>}
-
-  Appropriate {\LaTeX}-related programs are run on the input file, according
-  to the given output format: @{executable pdflatex}, @{executable bibtex}
-  (for \<^verbatim>\<open>bbl\<close>), and @{executable makeindex} (for \<^verbatim>\<open>idx\<close>). The actual commands
-  are determined from the settings environment (@{setting ISABELLE_PDFLATEX}
-  etc.).
-
-  The \<^verbatim>\<open>sty\<close> output format causes the Isabelle style files to be updated from
-  the distribution. This is useful in special situations where the document
-  sources are to be processed another time by separate tools.
-\<close>
-
-
-subsubsection \<open>Examples\<close>
-
-text \<open>
-  Invoking @{tool latex} by hand may be occasionally useful when debugging
-  failed attempts of the automatic document preparation stage of batch-mode
-  Isabelle. The abortive process leaves the sources at a certain place within
-  @{setting ISABELLE_BROWSER_INFO}, see the runtime error message for details.
-  This enables users to inspect {\LaTeX} runs in further detail, e.g.\ like
-  this:
-
-  @{verbatim [display]
-\<open>cd "$(isabelle getenv -b ISABELLE_BROWSER_INFO)/Unsorted/Test/document"
-isabelle latex -o pdf\<close>}
-\<close>
-
 end
--- a/src/Doc/System/Scala.thy	Wed Mar 31 16:01:31 2021 +0200
+++ b/src/Doc/System/Scala.thy	Mon Sep 06 12:08:20 2021 +0200
@@ -31,30 +31,22 @@
     operates on the running Java application, using the Scala
     read-eval-print-loop (REPL).
 
-  The main Isabelle/Scala functionality is provided by \<^verbatim>\<open>Pure.jar\<close>, but
-  further add-ons are bundled with Isabelle, e.g.\ to access SQLite or
-  PostgreSQL using JDBC (Java Database Connectivity).
-
-  Other components may augment the system environment by providing a suitable
-  \<^path>\<open>etc/settings\<close> shell script in the component directory. Some shell
-  functions are available to help with that:
-
-    \<^item> Function \<^bash_function>\<open>classpath\<close> adds \<^verbatim>\<open>jar\<close> files in Isabelle path
-    notation (POSIX). On Windows, this is converted to native path names
-    before invoking @{tool java} or @{tool scala} (\secref{sec:scala-tools}).
+  The main Isabelle/Scala/jEdit functionality is provided by
+  \<^file>\<open>$ISABELLE_HOME/lib/classes/isabelle.jar\<close>. Further underlying Scala and
+  Java libraries are bundled with Isabelle, e.g.\ to access SQLite or
+  PostgreSQL via JDBC.
 
-    \<^item> Function \<^bash_function>\<open>isabelle_scala_service\<close> registers global
-    service providers as subclasses of
-    \<^scala_type>\<open>isabelle.Isabelle_System.Service\<close>, using the raw Java name
-    according to @{scala_method (in java.lang.Object) getClass} (it should be
-    enclosed in single quotes to avoid special characters like \<^verbatim>\<open>$\<close> to be
-    interpreted by the shell).
+  Add-on Isabelle components may augment the system environment by providing
+  suitable configuration in \<^path>\<open>etc/settings\<close> (GNU bash script). The
+  shell function \<^bash_function>\<open>classpath\<close> helps to write
+  \<^path>\<open>etc/settings\<close> in a portable manner: it refers to library \<^verbatim>\<open>jar\<close>
+  files in standard POSIX path notation. On Windows, this is converted to
+  native platform format, before invoking Java (\secref{sec:scala-tools}).
 
-    Particular Isabelle/Scala services require particular subclasses:
-    instances are filtered according to their dynamic type. For example, class
-    \<^scala_type>\<open>isabelle.Isabelle_Scala_Tools\<close> collects Scala command-line
-    tools, and class \<^scala_type>\<open>isabelle.Scala.Functions\<close>
-    collects Scala functions (\secref{sec:scala-functions}).
+  \<^medskip>
+  There is also an implicit build process for Isabelle/Scala/Java modules,
+  based on \<^path>\<open>etc/build.props\<close> within the component directory (see also
+  \secref{sec:scala-build}).
 \<close>
 
 
@@ -103,25 +95,6 @@
 \<close>
 
 
-subsection \<open>Scala compiler \label{sec:tool-scalac}\<close>
-
-text \<open>
-  The @{tool_def scalac} tool is a direct wrapper for the Scala compiler; see
-  also @{tool scala} above. The command line arguments are that of the
-  bundled Scala distribution.
-
-  This allows to compile further Scala modules, depending on existing
-  Isabelle/Scala functionality. The resulting \<^verbatim>\<open>class\<close> or \<^verbatim>\<open>jar\<close> files can be
-  added to the Java classpath using the shell function
-  \<^bash_function>\<open>classpath\<close>. Thus add-on components can register themselves
-  in a modular manner, see also \secref{sec:components}.
-
-  Note that Isabelle/jEdit @{cite "isabelle-jedit"} has its own mechanisms for
-  adding plugin components. This needs special attention, since it overrides
-  the standard Java class loader.
-\<close>
-
-
 subsection \<open>Scala script wrapper\<close>
 
 text \<open>
@@ -143,16 +116,167 @@
 \<close>
 
 
-subsection \<open>Project setup for common Scala IDEs\<close>
+subsection \<open>Scala compiler \label{sec:tool-scalac}\<close>
+
+text \<open>
+  The @{tool_def scalac} tool is a direct wrapper for the Scala compiler; see
+  also @{tool scala} above. The command line arguments are that of the
+  bundled Scala distribution.
+
+  This provides a low-level mechanism to compile further Scala modules,
+  depending on existing Isabelle/Scala functionality; the resulting \<^verbatim>\<open>class\<close>
+  or \<^verbatim>\<open>jar\<close> files can be added to the Java classpath using the shell function
+  \<^bash_function>\<open>classpath\<close>.
+
+  A more convenient high-level approach works via \<^path>\<open>etc/build.props\<close>
+  (see \secref{sec:scala-build}).
+\<close>
+
+
+section \<open>Isabelle/Scala/Java modules \label{sec:scala-build}\<close>
+
+subsection \<open>Component configuration via \<^path>\<open>etc/build.props\<close>\<close>
 
 text \<open>
-  The @{tool_def scala_project} tool creates a project configuration for
-  Isabelle/Scala/jEdit:
+  Isabelle components may augment the Isabelle/Scala/Java environment
+  declaratively via properties given in \<^path>\<open>etc/build.props\<close> (within the
+  component directory). This specifies an output \<^verbatim>\<open>jar\<close> \<^emph>\<open>module\<close>, based on
+  Scala or Java \<^emph>\<open>sources\<close>, and arbitrary \<^emph>\<open>resources\<close>. Moreover, a module can
+  specify \<^emph>\<open>services\<close> that are subclasses of
+  \<^scala_type>\<open>isabelle.Isabelle_System.Service\<close>; these have a particular
+  meaning to Isabelle/Scala tools.
+
+  Before running a Scala or Java process, the Isabelle system implicitly
+  ensures that all provided modules are compiled and packaged (as jars). It is
+  also possible to invoke @{tool scala_build} explicitly, with extra options.
+
+  \<^medskip>
+  The syntax of in \<^path>\<open>etc/build.props\<close> follows a regular Java properties
+  file\<^footnote>\<open>\<^url>\<open>https://docs.oracle.com/en/java/javase/15/docs/api/java.base/java/util/Properties.html#load(java.io.Reader)\<close>\<close>,
+  but the encoding is \<^verbatim>\<open>UTF-8\<close>, instead of historic \<^verbatim>\<open>ISO 8859-1\<close> from the API
+  documentation.
+
+  The subsequent properties are relevant for the Scala/Java build process.
+  Most properties are optional: the default is an empty string (or list). File
+  names are relative to the main component directory and may refer to Isabelle
+  settings variables (e.g. \<^verbatim>\<open>$ISABELLE_HOME\<close>).
+
+    \<^item> \<^verbatim>\<open>title\<close> (required) is a human-readable description of the module, used
+    in printed messages.
+
+    \<^item> \<^verbatim>\<open>module\<close> specifies a \<^verbatim>\<open>jar\<close> file name for the output module, as result
+    of the specified sources (and resources). If this is absent (or
+    \<^verbatim>\<open>no_build\<close> is set, as described below), there is no implicit build
+    process. The contributing sources might be given nonetheless, notably for
+    @{tool scala_project} (\secref{sec:tool-scala-project}), which includes
+    Scala/Java sources of components, while suppressing \<^verbatim>\<open>jar\<close> modules (to
+    avoid duplication of program content).
+
+    \<^item> \<^verbatim>\<open>no_build\<close> is a Boolean property, with default \<^verbatim>\<open>false\<close>. If set to
+    \<^verbatim>\<open>true\<close>, the implicit build process for the given \<^verbatim>\<open>module\<close> is \<^emph>\<open>omitted\<close>
+    --- it is assumed to be provided by other means.
+
+    \<^item> \<^verbatim>\<open>scalac_options\<close> and \<^verbatim>\<open>javac_options\<close> augment the default settings
+    @{setting_ref ISABELLE_SCALAC_OPTIONS} and @{setting_ref
+    ISABELLE_JAVAC_OPTIONS} for this component; option syntax follows the
+    regular command-line tools \<^verbatim>\<open>scalac\<close> and \<^verbatim>\<open>javac\<close>, respectively.
+
+    \<^item> \<^verbatim>\<open>main\<close> specifies the main entry point for the \<^verbatim>\<open>jar\<close> module. This is
+    only relevant for direct invocation like ``\<^verbatim>\<open>java -jar test.jar\<close>''.
+
+    \<^item> \<^verbatim>\<open>requirements\<close> is a list of \<^verbatim>\<open>jar\<close> modules that are needed in the
+    compilation process, but not provided by the regular classpath (notably
+    @{setting ISABELLE_CLASSPATH}).
+
+    A \<^emph>\<open>normal entry\<close> refers to a single \<^verbatim>\<open>jar\<close> file name, possibly with
+    settings variables as usual. E.g. \<^file>\<open>$ISABELLE_SCALA_JAR\<close> for the main
+    \<^file>\<open>$ISABELLE_HOME/lib/classes/isabelle.jar\<close> (especially relevant for
+    add-on modules).
+
+    A \<^emph>\<open>special entry\<close> is of of the form \<^verbatim>\<open>env:\<close>\<open>variable\<close> and refers to a
+    settings variable from the Isabelle environment: its value may consist of
+    multiple \<^verbatim>\<open>jar\<close> entries (separated by colons). Environment variables are
+    not expanded recursively.
+
+    \<^item> \<^verbatim>\<open>resources\<close> is a list of files that should be included in the resulting
+    \<^verbatim>\<open>jar\<close> file. Each item consists of a pair separated by colon:
+    \<open>source\<close>\<^verbatim>\<open>:\<close>\<open>target\<close> means to copy an existing source file (relative to
+    the component directory) to the given target file or directory (relative
+    to the \<^verbatim>\<open>jar\<close> name space). A \<open>file\<close> specification without colon
+    abbreviates \<open>file\<close>\<^verbatim>\<open>:\<close>\<open>file\<close>, i.e. the file is copied while retaining its
+    relative path name.
+
+    \<^item> \<^verbatim>\<open>sources\<close> is a list of \<^verbatim>\<open>.scala\<close> or \<^verbatim>\<open>.java\<close> files that contribute to
+    the specified module. It is possible to use both languages simultaneously:
+    the Scala and Java compiler will be invoked consecutively to make this
+    work.
+
+    \<^item> \<^verbatim>\<open>services\<close> is a list of class names to be registered as Isabelle
+    service providers (subclasses of
+    \<^scala_type>\<open>isabelle.Isabelle_System.Service\<close>). Internal class names of
+    the underlying JVM need to be given: e.g. see method @{scala_method (in
+    java.lang.Object) getClass}.
+
+    Particular services require particular subclasses: instances are filtered
+    according to their dynamic type. For example, class
+    \<^scala_type>\<open>isabelle.Isabelle_Scala_Tools\<close> collects Scala command-line
+    tools, and class \<^scala_type>\<open>isabelle.Scala.Functions\<close> collects Scala
+    functions (\secref{sec:scala-functions}).
+\<close>
+
+
+subsection \<