lib/Tools/update_theorems
changeset 61337 4645502c3c64
child 62450 2154f709fc25
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lib/Tools/update_theorems	Tue Oct 06 15:14:28 2015 +0200
@@ -0,0 +1,40 @@
+#!/usr/bin/env bash
+#
+# Author: Makarius
+#
+# DESCRIPTION: update toplevel theorem keywords
+
+
+## diagnostics
+
+PRG="$(basename "$0")"
+
+function usage()
+{
+  echo
+  echo "Usage: isabelle $PRG [FILES|DIRS...]"
+  echo
+  echo "  Recursively find .thy files and update toplevel theorem keywords:"
+  echo
+  echo "    theorems             ~>  lemmas"
+  echo "    schematic_theorem    ~>  schematic_goal"
+  echo "    schematic_lemma      ~>  schematic_goal"
+  echo "    schematic_corollary  ~>  schematic_goal"
+  echo
+  echo "  Old versions of files are preserved by appending \"~~\"."
+  echo
+  exit 1
+}
+
+
+## process command line
+
+[ "$#" -eq 0 -o "$1" = "-?" ] && usage
+
+SPECS="$@"; shift "$#"
+
+
+## main
+
+find $SPECS -name \*.thy -print0 | \
+  xargs -0 "$ISABELLE_TOOL" java isabelle.Update_Theorems