From 7077e2e8fed4a52af4894954c8446781cb5d40d6 Mon Sep 17 00:00:00 2001 From: David Aspinall Date: Tue, 5 Dec 2006 12:49:56 +0000 Subject: Deleted file --- isa/BUGS | 68 --- isa/Example-Xsym.ML | 20 - isa/Example.ML | 18 - isa/Example.thy | 20 - isa/Example2.ML | 15 - isa/README | 32 -- isa/interface-setup.el | 43 -- isa/isa-syntax.el | 352 ---------------- isa/isa.el | 723 -------------------------------- isa/isabelle-system.el | 598 -------------------------- isa/thy-mode.el | 1045 ---------------------------------------------- isa/todo | 62 --- isa/x-symbol-isa.el | 21 - isa/x-symbol-isabelle.el | 514 ----------------------- 14 files changed, 3531 deletions(-) delete mode 100644 isa/BUGS delete mode 100644 isa/Example-Xsym.ML delete mode 100644 isa/Example.ML delete mode 100644 isa/Example.thy delete mode 100644 isa/Example2.ML delete mode 100644 isa/README delete mode 100644 isa/interface-setup.el delete mode 100644 isa/isa-syntax.el delete mode 100644 isa/isa.el delete mode 100644 isa/isabelle-system.el delete mode 100644 isa/thy-mode.el delete mode 100644 isa/todo delete mode 100644 isa/x-symbol-isa.el delete mode 100644 isa/x-symbol-isabelle.el (limited to 'isa') diff --git a/isa/BUGS b/isa/BUGS deleted file mode 100644 index 41f992c3..00000000 --- a/isa/BUGS +++ /dev/null @@ -1,68 +0,0 @@ --*- mode:outline -*- - -* Isabelle Proof General Bugs - -See also ../BUGS for generic bugs. - -See also ../isar/BUGS. Isar is now main the instance for -Isabelle PG, the original Isabelle instance less supported. - - -** Issues with tracing mode - -1. Large volumes of output can cause Emacs to hog CPU spending -all its time processing the output (esp with fontifying and X-symbol -decoding). It becomes difficult to use normal editing commands, -even C-c C-c to interrupt the prover. Workaround: hitting C-g, -the Emacs quit key, will interrupt the prover in this state. -See manual for further description of this. - -2. Interrupt response may be lost in large volumes of output, when -using pty communication. Symptom is interrupt on C-g, but PG thinks -the prover is still busy. Workaround: hit return in the shell buffer, -or set proof-shell-process-connection-type to nil to use piped -communication. - -** set proof_timing is problematic - -It will make the goals display disappear during proof. This is -because Proof General only displays goals output that appears *after* -Isabelle messages, but Isabelle prints the timing message after the -goals are displayed. - -** General difficulty with proof scripts containing ML structures, etc. - -Proof General does not understand full ML syntax(!), so it will be -confused by structures which contain semi-colons after declarations, -for example. Also, it cannot undo function declarations. See the -section on ML files in the manual for more details. - -** Blocking when processing multiple files, beginning from a .ML file. - -Proof General will block the Emacs process when it is waiting for a -theory file (and it's ancestors) to be read as scripting is turned on. -To avoid this, assert the theory file rather than the ML file. - -** Subsection Interaction with theory database - -Isabelle Proof General uses some support from Isabelle to remove and -reload theories from the theory database. To maintain consistency, -Isabelle is rather conservative. So re-asserting a retracted file will -often re-load it, even if it has not changed. (This is because the -file may have implicit dependencies on things in the global ML -environment not made apparent by the theory structure). -This may lead to seemingly unnecessary repetition of time-consuming -proofs, so be careful not to retract more than you need! - -As of Isabelle 99-1 and Proof General 3.2, there should be much -less unncessary re-loading of theories; be careful to use Isabelle's -mechanisms of declaring dependencies in theory file headers. - -** Clash with SML mode - -Since Isabelle proof scripts are not differentiated from `.ML' files, -Proof General may compete with `sml-mode' (if you use it) for -controlling these buffers. To ensure Proof General wins, load it last. - -Workaround: use another extension for real ML files, e.g. `.sml', -and disable `.ML' from entering `sml-mode'. diff --git a/isa/Example-Xsym.ML b/isa/Example-Xsym.ML deleted file mode 100644 index ed97c291..00000000 --- a/isa/Example-Xsym.ML +++ /dev/null @@ -1,20 +0,0 @@ -(* - Example proof script for Isabelle Proof General. - - $Id$ - - Just a version of Example.ML using XSymbol. - - Also subscripts/superscripts: A\<^sup>1 \\ A\<^sub>2 - [NB: these can't be used in identifiers or otherwise - parsed by Isabelle unless declared as part of a theory's - concrete syntax, see docs or examples in HOL/IMP.] -*) - -Goal "A \\ B \\ B \\ A"; -by (rtac impI 1); -by (etac conjE 1); -by (rtac conjI 1); -by (assume_tac 1); -by (assume_tac 1); -qed "and_comms"; diff --git a/isa/Example.ML b/isa/Example.ML deleted file mode 100644 index 57733a48..00000000 --- a/isa/Example.ML +++ /dev/null @@ -1,18 +0,0 @@ -(* -*- isa -*- - - Example proof script for Isabelle Proof General. - - $Id$ - - The line at the top of this comment forces - Proof General's classic Isabelle mode - (instead of Isar: you can't use both at once). -*) - -Goal "A & B --> B & A"; - by (rtac impI 1); - by (etac conjE 1); - by (rtac conjI 1); - by (assume_tac 1); - by (assume_tac 1); -qed "and_comms"; diff --git a/isa/Example.thy b/isa/Example.thy deleted file mode 100644 index ba64d959..00000000 --- a/isa/Example.thy +++ /dev/null @@ -1,20 +0,0 @@ -(* -*- isa -*- - - Example theory file for Isabelle - - David Aspinall - - $Id$ - - The line at the top of this comment forces - Proof General's classic Isabelle mode; - scripting takes place in .ML files. - - NB: this is incompatible with ProofGeneral/Isar which is - a separate instance of Proof General. - - See the PG manual for ways to select Isabelle/Classic - by default. -*) - -Example = Main diff --git a/isa/Example2.ML b/isa/Example2.ML deleted file mode 100644 index ab2fef03..00000000 --- a/isa/Example2.ML +++ /dev/null @@ -1,15 +0,0 @@ -(* - Example proof script for Isabelle Proof General. - - $Id$ - - Same as Example.ML, except using X-Symbol input tokens. -*) - -Goal "A \\ B \\ B \\ A"; - by (rtac impI 1); - by (etac conjE 1); - by (rtac conjI 1); - by (assume_tac 1); - by (assume_tac 1); -qed "and_comms"; diff --git a/isa/README b/isa/README deleted file mode 100644 index 01490085..00000000 --- a/isa/README +++ /dev/null @@ -1,32 +0,0 @@ -Isabelle Proof General - -Written by David Aspinall, later with assistance from -Markus Wenzel and David von Oheimb. - -Status: supported -Maintainer: David Aspinall -Isabelle versions: Isabelle2003, Isabelle2004 -Isabelle homepage: http://www.cl.cam.ac.uk/Research/HVG/Isabelle/ - -==================================================================== - -Isabelle Proof General has full support for multiple file scripting, -with dependencies between theories communicated between Isabelle and -Proof General. It has a mode for editing theory files taken from -Isamode. - -There is excellent support for X Symbol, using the Isabelle print mode -for X Symbol tokens. Many Isabelle theories have X Symbol syntax -already defined and it's easy to add to your own theories. - -The script `interface' and file 'interface-setup.el' are used to start -Isabelle Proof General via the 'Isabelle' shell command. These files -were provided by Markus Wenzel. - -Check the value of isabelle-prog-name. - - -======================================== - -$Id$ - diff --git a/isa/interface-setup.el b/isa/interface-setup.el deleted file mode 100644 index 16c167cc..00000000 --- a/isa/interface-setup.el +++ /dev/null @@ -1,43 +0,0 @@ -;; interface-setup.el Interface wrapper for Isabelle Proof General -;; -;; This file is free software; you can redistribute it and/or modify -;; it under the terms of the GNU General Public License as published by -;; the Free Software Foundation; either version 2, or (at your option) -;; any later version. -;; -;; Author: Markus Wenzel -;; -;; interface-setup.el,v 7.0 2002/08/29 09:14:03 da Exp -;; - -;; -;; X-Symbol -;; - -(let ((xsymbol (getenv "PROOFGENERAL_XSYMBOL")) - (enable-var (if (equal (getenv "PROOFGENERAL_ASSISTANTS") "isa") - 'isa-x-symbol-enable 'isar-x-symbol-enable))) - - ;; avoid confusing warning message - (if (not (boundp 'x-symbol-image-converter)) - (customize-set-variable 'x-symbol-image-converter nil)) - - ;; tell Proof General about -x option - (if (and xsymbol (not (equal xsymbol ""))) - (customize-set-variable enable-var (equal xsymbol "true")))) - - -;; -;; Unicode -;; - -(let ((unicode (getenv "PROOFGENERAL_UNICODE"))) - (if (and unicode (not (equal unicode ""))) - (customize-set-variable 'proof-shell-unicode (equal unicode "true")))) - -;; -;; Proof General -;; - -(if (not (featurep 'proof-site)) - (load (concat (getenv "PROOFGENERAL_HOME") "/generic/proof-site.el"))) diff --git a/isa/isa-syntax.el b/isa/isa-syntax.el deleted file mode 100644 index 3ed6c53e..00000000 --- a/isa/isa-syntax.el +++ /dev/null @@ -1,352 +0,0 @@ -;; isa-syntax.el Syntax expressions for Isabelle -;; -;; Copyright (C) 1994-1998 LFCS Edinburgh. -;; License: GPL (GNU GENERAL PUBLIC LICENSE) -;; Author: David Aspinall -;; -;; $Id$ -;; -;; -(require 'proof-syntax) - -;; character syntax - -(defun isa-init-syntax-table () - "Set appropriate values for syntax table in current buffer." - (modify-syntax-entry ?\$ ".") - (modify-syntax-entry ?\/ ".") - (modify-syntax-entry ?\\ ".") - (modify-syntax-entry ?+ ".") - (modify-syntax-entry ?- ".") - (modify-syntax-entry ?= ".") - (modify-syntax-entry ?% ".") - (modify-syntax-entry ?< ".") - (modify-syntax-entry ?> ".") - (modify-syntax-entry ?\& ".") - (modify-syntax-entry ?. "w") - (modify-syntax-entry ?_ "w") - (modify-syntax-entry ?\' "w") - (modify-syntax-entry ?\| ".") - (modify-syntax-entry ?\* ". 23") - (modify-syntax-entry ?\( "()1") - (modify-syntax-entry ?\) ")(4")) - -(defun isa-init-output-syntax-table () - "Set appropriate values for syntax table for Isabelle output." - (isa-init-syntax-table) - ;; ignore strings so font-locking works - ;; inside them - (modify-syntax-entry ?\" " ") - (modify-syntax-entry ?\* ".") - (modify-syntax-entry ?\( "()") - (modify-syntax-entry ?\) ")(") - (modify-syntax-entry ?\{ "(}") - (modify-syntax-entry ?\} "){")) - -;; -;; Syntax for font-lock and other features -;; - -;; Note: this command-keyword recognition of the proof script isn't -;; good enough for Isabelle, since we can have arbitrary ML code -;; around. -;; Alternatives: -;; 1) propose a restricted language consisting of the interactive -;; commands. Or try Markus Wenzel's Isar proof language! -;; 2) add hooks from Isabelle to say "I've just seen a goal command" -;; or "I've just seen a tactic". This would allow more accurate -;; counting of undos. We could even approximate this without hooks, -;; by examining the proof state output carefully. -;; - -;; FIXME da: here are some examples of input failures I've -;; found in real proofs: -;; -;; val lemma = result() RS spec RS mp; -;; -;; Not recognized as a qed command, and therefore assumed -;; to be an undoable tactic command. -;; - -(defgroup isa-syntax nil - "Customization of Isabelle syntax for proof mode" - :group 'isa-settings) - -(defcustom isa-keywords-defn - '("bind_thm" "bind_thms") - "Isabelle keywords for definitions" - :group 'isa-syntax - :type '(repeat string)) - -;; isa-keywords-goal is used to manage undo actions -(defcustom isa-keywords-goal - '("Goal" "Goalw" "goal" "goalw" "goalw_cterm" "atomic_goal" "atomic_goalw") - "Isabelle commands to begin an interactive proof" - :group 'isa-syntax - :type '(repeat string)) - -(defcustom isa-keywords-save - '("qed" "qed_spec_mp" "no_qed") - ;; Related commands, but having different types, so PG - ;; won't bother support them: - ;; "uresult" "bind_thm" "store_thm" - "Isabelle commands to extract the proved theorem" - :group 'isa-syntax - :type '(repeat string)) - -(defcustom isa-keywords-commands - '("by" "byev" - "ba" "br" "be" "bd" "brs" "bes" "bds" - "chop" "choplev" "back" "undo" "ProofGeneral.repeat_undo" - "fa" "fr" "fe" "fd" "frs" "fes" "fds" - "bw" "bws" "ren" - ;; batch proofs - "prove_goal" "qed_goal" "prove_goalw" "qed_goalw" "prove_goalw_cterm") - "Isabelle command keywords" - :group 'isa-syntax - :type '(repeat string)) - -(defcustom isa-keywords-sml - '("abstype" "and" "andalso" "as" "case" "datatype" "do" "else" "end" - "eqtype" "exception" "fn" "fun" "functor" "handle" "if" "in" "include" - "infix" "infixr" "let" "local" "nonfix" "of" "op" "open" "orelse" - "raise" "rec" "sharing" "sig" "signature" "struct" "structure" "then" - "type" "val" "while" "with" "withtype") - "Standard ML keywords that are nice to have coloured." - :group 'isa-syntax - :type '(repeat string)) - -(defcustom isa-keyword-symbols - '("=" "=>" "|" ";" "," "(" ")" "-" "." "->" ":" "{" "}" "[" "]" "#") - "Symbols that are nice to have in bold." - :group 'isa-syntax - :type '(repeat string)) - -(defcustom isa-sml-names-keywords - '("fun" "val" "structure" "signature" "functor") - "Keywords that then define a name." - :group 'isa-syntax - :type '(repeat string)) - -(defcustom isa-sml-typenames-keywords - '("type" "eqtype" "datatype") - "Keywords that define a type, this is only terminated by a '=' or '\n'." - :group 'isa-syntax - :type '(repeat string)) - - -;; NB: this means that any adjustments above by customize will -;; only have effect in next session. -(defconst isa-keywords - (append isa-keywords-goal isa-keywords-save - isa-keywords-defn isa-keywords-commands - isa-keywords-sml) - "All keywords in a Isabelle script") - -(defconst isa-keywords-proof-commands - (append isa-keywords-goal isa-keywords-save isa-keywords-commands) - "Actual Isabelle proof script commands") - -;; The most common Isabelle/Pure tacticals -(defconst isa-tacticals - '("ALLGOALS" "DETERM" "EVERY" "EVERY'" "FIRST" "FIRST'" "FIRSTGOAL" - "ORELSE" "ORELSE'" "REPEAT" "REPEAT" "REPEAT1" "REPEAT_FIRST" - "REPEAT_SOME" "SELECT_GOAL" "SOMEGOAL" "THEN" "THEN'" "TRY" "TRYALL")) - - -;; ----- regular expressions - -(defconst isa-id "\\([A-Za-z][A-Za-z0-9'_]*\\)") -(defconst isa-idx (concat isa-id "\\(\\.[0-9]+\\)?")) - -(defconst isa-ids (proof-ids isa-id "[ \t]*") - "Matches a sequence of identifiers separated by whitespace.") - -(defconst isa-string "\"\\(\\([^\\\"]\\|\\\\\"\\)*\\)\"") - -(defcustom isa-save-command-regexp - (proof-regexp-alt - (proof-anchor-regexp (proof-ids-to-regexp isa-keywords-save)) - ;; match val ... = result blah - (proof-anchor-regexp - (concat - (proof-ids-to-regexp '("val")) ".+=\\s-*" - "\\(" (proof-ids-to-regexp isa-keywords-save) "\\)"))) - "Regular expression used to match a qed/result." - :type 'regexp - :group 'isabelle-config) - - -;; CHECKED -(defconst isa-save-with-hole-regexp - (concat "\\(" (proof-ids-to-regexp isa-keywords-save) - "\\)\\s-+\"\\(" isa-id "\\)\"\\s-*;")) - -(defcustom isa-goal-command-regexp - (proof-regexp-alt - (proof-anchor-regexp (proof-ids-to-regexp isa-keywords-goal)) - ;; match val ... = goal blah - (proof-anchor-regexp - (concat - (proof-ids-to-regexp '("val")) ".+=\\s-*" - "\\(" (proof-ids-to-regexp isa-keywords-goal) "\\)"))) - "Regular expression used to match a goal." - :type 'regexp - :group 'isabelle-config) - -(defconst isa-string-regexp - (concat "\\s-*\"\\(" isa-id "\\)\"\\s-*") - "Regexp matching ML strings, with contents bracketed.") - -(defconst isa-goal-with-hole-regexp - (concat "\\(" - ;; Don't bother with "val xxx = prove_goal blah". - (proof-ids-to-regexp '("qed_goal")) - "\\)" isa-string-regexp) - "Regexp matching goal commands in Isabelle which name a theorem") - - -(defconst isa-proof-command-regexp - (proof-ids-to-regexp isa-keywords-proof-commands) - "Regexp to match proof commands, with no extra output (apart from proof state)") - - -;; ----- Isabelle inner syntax hilite - -(defface isabelle-class-name-face - '((((type x) (class color) (background light)) - (:foreground "red")) - (((type x) (class color) (background dark)) - (:foreground "red3")) - (t - (bold t))) - "*Face for Isabelle term / type hiliting" - :group 'proof-faces) - -(defface isabelle-tfree-name-face - '((((type x) (class color) (background light)) - (:foreground "purple")) - (((type x) (class color) (background dark)) - (:foreground "purple3")) - (t - (bold t))) - "*Face for Isabelle term / type hiliting" - :group 'proof-faces) - -(defface isabelle-tvar-name-face - '((((type x) (class color) (background light)) - (:foreground "purple")) - (((type x) (class color) (background dark)) - (:foreground "purple3")) - (t - (bold t))) - "*Face for Isabelle term / type hiliting" - :group 'proof-faces) - -(defface isabelle-free-name-face - '((((type x) (class color) (background light)) - (:foreground "blue")) - (((type x) (class color) (background dark)) - (:foreground "blue3")) - (t - (bold t))) - "*Face for Isabelle term / type hiliting" - :group 'proof-faces) - -(defface isabelle-bound-name-face - '((((type x) (class color) (background light)) - (:foreground "green4")) - (((type x) (class color) (background dark)) - (:foreground "green")) - (t - (bold t))) - "*Face for Isabelle term / type hiliting" - :group 'proof-faces) - -(defface isabelle-var-name-face - '((((type x) (class color) (background light)) - (:foreground "darkblue")) - (((type x) (class color) (background dark)) - (:foreground "blue3")) - (t - (bold t))) - "*Face for Isabelle term / type hiliting" - :group 'proof-faces) - -;; special face for key symbols, make them bold -(defface isabelle-sml-symbol-face - '((((class color) (background dark)) (:bold t)) - (((class color) (background light)) (:bold t)) - (((class grayscale) (background light)) (:bold t)) - (((class grayscale) (background dark)) (:bold t)) - (t (:bold t))) - "*SML symbol/character highlightling face" - :group 'proof-faces) - -;; GNU Emacs compatibility for above faces. -(defconst isabelle-class-name-face 'isabelle-class-name-face) -(defconst isabelle-tfree-name-face 'isabelle-tfree-name-face) -(defconst isabelle-tvar-name-face 'isabelle-tvar-name-face) -(defconst isabelle-free-name-face 'isabelle-free-name-face) -(defconst isabelle-bound-name-face 'isabelle-bound-name-face) -(defconst isabelle-var-name-face 'isabelle-var-name-face) -(defconst isabelle-sml-symbol-face 'isabelle-sml-symbol-face) - -;; regexp for finding function/variable/struct/sig/functor names -(defconst isa-sml-function-var-names-regexp - (concat "\\(" (proof-ids-to-regexp isa-sml-names-keywords) "\\)[\ \t]*\\(" isa-id "\\)")) - -;; regexp for finding type names, note that types may be compound, -;; thus this needs to be separate from function names -(defconst isa-sml-type-names-regexp - (concat "\\(" (proof-ids-to-regexp isa-sml-typenames-keywords) "\\)\\([^\n=]*\\)[\n=]")) - -;; make stuff to be syntax colourd.... -(defvar isa-font-lock-keywords-1 - (list - (cons (proof-ids-to-regexp isa-keywords) 'font-lock-keyword-face) - (cons (regexp-opt isa-keyword-symbols) 'isabelle-sml-symbol-face) - (list isa-sml-function-var-names-regexp 2 'font-lock-function-name-face 'append' t) - (list isa-sml-type-names-regexp 2 'font-lock-function-name-face 'append' t) - (cons (proof-ids-to-regexp isa-tacticals) 'proof-tacticals-name-face) - (list isa-goal-with-hole-regexp 2 'font-lock-function-name-face) - (list isa-save-with-hole-regexp 2 'font-lock-function-name-face))) - -(defvar isa-output-font-lock-keywords-1 - (list - (cons (concat "\351" isa-id "\350") 'isabelle-class-name-face) - (cons (concat "\352'" isa-id "\350") 'isabelle-tfree-name-face) - (cons (concat "\353\\?'" isa-idx "\350") 'isabelle-tvar-name-face) - (cons (concat "\354" isa-id "\350") 'isabelle-free-name-face) - (cons (concat "\355" isa-id "\350") 'isabelle-bound-name-face) - (cons (concat "\356\\?" isa-idx "\350") 'isabelle-var-name-face) - (cons (concat "\357\\?" isa-idx "\350") 'proof-declaration-name-face) - ) - "*Font-lock table for Isabelle terms.") - -(defvar isa-goals-font-lock-keywords - (append - (list - "^Level [0-9].*" - "^No subgoals!$" - "^Variables:$" - "^Constants:$" - "\\s-*[0-9][0-9]?\\. ") - isa-output-font-lock-keywords-1) - "*Font-lock table for Isabelle goals output.") - - -;; ----- indentation - -(defconst isa-indent-any-regexp - (proof-regexp-alt (proof-ids-to-regexp isa-keywords) "\\s(" "\\s)")) -(defconst isa-indent-inner-regexp - (proof-regexp-alt "\\s(" "\\s)")) -(defconst isa-indent-enclose-regexp - (proof-ids-to-regexp isa-keywords-save)) -(defconst isa-indent-open-regexp - (proof-regexp-alt (proof-ids-to-regexp isa-keywords-goal) "\\s(")) -(defconst isa-indent-close-regexp - (proof-regexp-alt (proof-ids-to-regexp isa-keywords-save) "\\s)")) - -(provide 'isa-syntax) diff --git a/isa/isa.el b/isa/isa.el deleted file mode 100644 index 22b68642..00000000 --- a/isa/isa.el +++ /dev/null @@ -1,723 +0,0 @@ -; isa-mode.el Emacs support for Isabelle proof assistant -;; Copyright (C) 1993-2000 LFCS Edinburgh, David Aspinall. -;; License: GPL (GNU GENERAL PUBLIC LICENSE) -;; Author: David Aspinall -;; -;; $Id$ -;; -;; ----------------------------------------------------------------- -;; -;; This file and the rest of Isabelle Proof General contain code taken -;; from David Aspinall's Isamode system, a personal project undertaken -;; 1993-1999 as a contribution to the Isabelle community. -;; -;; ----------------------------------------------------------------- - - -;; In case Isa mode was invoked directly or by -*- isa -*- at -;; the start of the file, ensure that Isa mode is used from now -;; on for .thy and .ML files. -;; FIXME: be less messy with auto-mode-alist here (remove dups) -(setq auto-mode-alist - (cons '("\\.ML$\\|\\.thy$" . isa-mode) auto-mode-alist)) - -(require 'proof) -(require 'isa-syntax) -(require 'isabelle-system) - -;;; -;;; ======== User settings for Isabelle ======== -;;; - -;;; proof-site provides us with the cusomization groups -;;; -;;; 'isabelle - User options for Isabelle Proof General -;;; 'isabelle-config - Configuration of Isabelle Proof General -;;; (constants, but may be nice to tweak) - - -;;; -;;; ======== Configuration of generic modes ======== -;;; - -(defcustom isa-outline-regexp - (proof-ids-to-regexp '("goal" "Goal" "prove_goal")) - "Outline regexp for Isabelle ML files" - :type 'regexp - :group 'isabelle-config) - -;;; End of a command needs parsing to find, so this is approximate. -(defcustom isa-outline-heading-end-regexp ";[ \t\n]*" - "Outline heading end regexp for Isabelle ML files." - :type 'regexp - :group 'isabelle-config) - -(defvar isa-shell-outline-regexp "\370[ \t]*\\([0-9]+\\)\\.") -(defvar isa-shell-outline-heading-end-regexp "$") - - -(defun isa-mode-config-set-variables () - "Configure generic proof scripting/thy mode variables for Isabelle. -Settings here are the ones which are needed for both shell mode -and script mode." - (setq - proof-assistant-home-page isabelle-web-page - proof-mode-for-script 'isa-proofscript-mode - ;; proof script syntax - proof-terminal-char ?\; ; ends a proof - proof-script-comment-start "(*" ; comment in a proof - proof-script-comment-end "*)" ; - ;; Next few used for func-menu and recognizing goal..save regions in - ;; script buffer. - proof-save-command-regexp isa-save-command-regexp - proof-goal-command-regexp isa-goal-command-regexp - proof-goal-with-hole-regexp isa-goal-with-hole-regexp - proof-save-with-hole-regexp isa-save-with-hole-regexp - ;; Unfortunately the default value of proof-script-next-entity-regexps - ;; is no good, because goals with holes in Isabelle are batch - ;; commands, and not terminated by saves. So we omit the forward - ;; search from the default value. - proof-script-next-entity-regexps - (list (proof-regexp-alt - isa-goal-with-hole-regexp - isa-save-with-hole-regexp) - (list isa-goal-with-hole-regexp 2) - (list isa-save-with-hole-regexp 2 - 'backward isa-goal-command-regexp)) - - proof-indent-enclose-offset (- proof-indent) - proof-indent-open-offset 0 - proof-indent-close-offset 0 - proof-indent-any-regexp isa-indent-any-regexp - proof-indent-inner-regexp isa-indent-inner-regexp - proof-indent-enclose-regexp isa-indent-enclose-regexp - proof-indent-open-regexp isa-indent-open-regexp - proof-indent-close-regexp isa-indent-close-regexp - - ;; proof engine commands - proof-showproof-command "pr();" - proof-goal-command "Goal \"%s\";" - proof-save-command "qed \"%s\";" - proof-context-command "ProofGeneral.show_context();" - proof-info-command "ProofGeneral.help();" - proof-kill-goal-command "ProofGeneral.kill_goal();" - proof-find-theorems-command "ProofGeneral.thms_containing (space_explode \",\" \"%s\");" - proof-shell-start-silent-cmd "Goals.disable_pr();" - proof-shell-stop-silent-cmd "Goals.enable_pr();" - ;; command hooks - proof-goal-command-p 'isa-goal-command-p - proof-count-undos-fn 'isa-count-undos - proof-find-and-forget-fn 'isa-find-and-forget - proof-state-preserving-p 'isa-state-preserving-p - - ;; close goal..save regions eagerly - proof-completed-proof-behaviour 'closeany - - proof-shell-compute-new-files-list 'isa-shell-compute-new-files-list - proof-shell-inform-file-processed-cmd - "ProofGeneral.inform_file_processed \"%s\";" - proof-shell-inform-file-retracted-cmd - "ProofGeneral.inform_file_retracted \"%s\";" - - ;; span menu - proof-script-span-context-menu-extensions 'isabelle-create-span-menu - - ;; Parsing error messages. Bit tricky to allow for - ;; multitude of possible error formats Isabelle spits out. - ;; Ideally we shouldn't bother parsing errors that appear - ;; in the temporary ML files generated while reading - ;; theories, but unfortunately the user sometimes needs to - ;; examine them to understand a strange problem... - pg-next-error-regexp - "\\(error on \\|Error: in '[^']+', \\)line \\([0-9]+\\)\\|The error(s) above occurred" - pg-next-error-filename-regexp - "\\(Loading theory \"\\|Error: in '\\)\\([^\"']+\\)[\"']" - pg-next-error-extract-filename - "%s.thy")) - - - - -(defun isa-shell-mode-config-set-variables () - "Configure generic proof shell mode variables for Isabelle." - (setq - pg-subterm-first-special-char ?\350 - - proof-shell-wakeup-char ?\372 - proof-shell-annotated-prompt-regexp "\\(val it = () : unit\n\\)?> \372" - - ;; This pattern is just for comint - proof-shell-prompt-pattern "^2?[ML-=#>]>? \372?" - - ;; for issuing command, not used to track cwd in any way. - proof-shell-cd-cmd "ThyLoad.add_path \"%s\";" - - ;; Escapes for filenames inside ML strings. - ;; We also make a hack for Isabelle, by switching from backslashes - ;; to forward slashes if it looks like we're running on Windows. - proof-shell-filename-escapes - (if (fboundp 'win32-long-file-name) ; rough test for XEmacs on win32 - ;; Patterns to unixfy names. Avoids a deliberate bomb in Isabelle which - ;; barfs at paths with these characters in them. - '(("\\\\" . "/") ("\"" . "\\\"") ("^[a-zA-Z]:" . "")) - ;; Normal case: quotation for backslash, quote mark. - '(("\\\\" . "\\\\") ("\"" . "\\\""))) - - proof-shell-interrupt-regexp "Interrupt" - proof-shell-error-regexp "^\364\\*\\*\\*\\|^.*Error:\\|^uncaught exception \\|^Exception-\\( \\|$\\)" - - ;; matches names of assumptions - proof-shell-assumption-regexp isa-id - ;; matches subgoal name - ;; FIXME: not used yet. In future will be used for - ;; proof-by-pointing like features. - ;; proof-shell-goal-regexp "\370[ \t]*\\([0-9]+\\)\\." - - proof-shell-start-goals-regexp "\366" - proof-shell-end-goals-regexp "\367" - pg-topterm-char ?\370 - - proof-shell-proof-completed-regexp "^No subgoals!" - - ;; initial command configures Isabelle by hacking print functions, - ;; restoring settings saved by Proof General, etc. - - proof-shell-pre-sync-init-cmd "ProofGeneral.init false;" - proof-shell-init-cmd nil - - proof-shell-restart-cmd "ProofGeneral.isa_restart();" - proof-shell-quit-cmd "quit();" - - ;; NB: settings below only recognize tracing output in Isabelle2002 - proof-shell-eager-annotation-start "\360\\|\362" - proof-shell-eager-annotation-start-length 1 - proof-shell-eager-annotation-end "\361\\|\363" - ;; see isa-pre-shell-start for proof-shell-trace-output-regexp - - ;; Isabelle is learning to talk PGIP... - proof-shell-match-pgip-cmd "