# HG changeset patch # User wenzelm # Date 1376838010 -7200 # Node ID 98fc4753334252b6fae498dc23d199e778e0688e # Parent 6a3410845bb26b9f88b2ead447f912858df9bfe2# Parent e62c7a4b6697e62e7267a08ee2a4e0fcf0101e13 merged diff -r 6a3410845bb2 -r 98fc47533342 etc/symbols --- a/etc/symbols Sun Aug 18 15:35:01 2013 +0200 +++ b/etc/symbols Sun Aug 18 17:00:10 2013 +0200 @@ -350,9 +350,9 @@ \ code: 0x0000b8 \ code: 0x0002dd \ code: 0x0003f5 -\<^sub> code: 0x0021e9 group: control font: IsabelleText abbrev: =_ -\<^sup> code: 0x0021e7 group: control font: IsabelleText abbrev: =^ -\<^bold> code: 0x002759 group: control font: IsabelleText abbrev: -. +\<^sub> code: 0x0021e9 group: control font: IsabelleText +\<^sup> code: 0x0021e7 group: control font: IsabelleText +\<^bold> code: 0x002759 group: control font: IsabelleText \<^bsub> code: 0x0021d8 group: control_block font: IsabelleText abbrev: =_( \<^esub> code: 0x0021d9 group: control_block font: IsabelleText abbrev: =_) \<^bsup> code: 0x0021d7 group: control_block font: IsabelleText abbrev: =^( diff -r 6a3410845bb2 -r 98fc47533342 src/Doc/IsarImplementation/Logic.thy --- a/src/Doc/IsarImplementation/Logic.thy Sun Aug 18 15:35:01 2013 +0200 +++ b/src/Doc/IsarImplementation/Logic.thy Sun Aug 18 17:00:10 2013 +0200 @@ -881,8 +881,7 @@ The @{text "TYPE"} constructor is the canonical representative of the unspecified type @{text "\ itself"}; it essentially injects the language of types into that of terms. There is specific notation - @{text "TYPE(\)"} for @{text "TYPE\<^bsub>\ - itself\<^esub>"}. + @{text "TYPE(\)"} for @{text "TYPE\<^bsub>\ itself\<^esub>"}. Although being devoid of any particular meaning, the term @{text "TYPE(\)"} accounts for the type @{text "\"} within the term language. In particular, @{text "TYPE(\)"} may be used as formal diff -r 6a3410845bb2 -r 98fc47533342 src/Doc/IsarImplementation/ML.thy --- a/src/Doc/IsarImplementation/ML.thy Sun Aug 18 15:35:01 2013 +0200 +++ b/src/Doc/IsarImplementation/ML.thy Sun Aug 18 17:00:10 2013 +0200 @@ -800,7 +800,7 @@ reasoning.} Currying gives some flexiblity due to \emph{partial application}. A - function @{text "f: \\<^sub>1 \ \\<^bsub>2\<^esub> \ \"} can be applied to @{text "x: \\<^sub>1"} + function @{text "f: \\<^sub>1 \ \\<^sub>2 \ \"} can be applied to @{text "x: \\<^sub>1"} and the remaining @{text "(f x): \\<^sub>2 \ \"} passed to another function etc. How well this works in practice depends on the order of arguments. In the worst case, arguments are arranged erratically, @@ -904,8 +904,8 @@ parametrized by arguments of type @{text "\"}. Given @{text "a: \"} the partial application @{text "(f a): \ \ \"} operates homogeneously on @{text "\"}. This can be iterated naturally over a - list of parameters @{text "[a\<^sub>1, \, a\<^sub>n]"} as @{text "f a\<^sub>1 #> \ #> f - a\<^bsub>n\<^esub>\<^bsub>\<^esub>"}. The latter expression is again a function @{text "\ \ \"}. + list of parameters @{text "[a\<^sub>1, \, a\<^sub>n]"} as @{text "f a\<^sub>1 #> \ #> f a\<^sub>n"}. + The latter expression is again a function @{text "\ \ \"}. It can be applied to an initial configuration @{text "b: \"} to start the iteration over the given list of arguments: each @{text "a"} in @{text "a\<^sub>1, \, a\<^sub>n"} is applied consecutively by updating a diff -r 6a3410845bb2 -r 98fc47533342 src/HOL/Decision_Procs/Dense_Linear_Order.thy --- a/src/HOL/Decision_Procs/Dense_Linear_Order.thy Sun Aug 18 15:35:01 2013 +0200 +++ b/src/HOL/Decision_Procs/Dense_Linear_Order.thy Sun Aug 18 17:00:10 2013 +0200 @@ -34,7 +34,7 @@ lemma gather_start [no_atp]: "(\x. P x) \ (\x. (\y \ {}. y < x) \ (\y\ {}. x < y) \ P x)" by simp -text{* Theorems for @{text "\z. \x. x < z \ (P x \ P\<^bsub>-\\<^esub>)"}*} +text{* Theorems for @{text "\z. \x. x < z \ (P x \ P\<^sub>-\<^sub>\)"}*} lemma minf_lt[no_atp]: "\z . \x. x < z \ (x < t \ True)" by auto lemma minf_gt[no_atp]: "\z . \x. x < z \ (t < x \ False)" by (simp add: not_less) (rule exI[where x="t"], auto simp add: less_le) @@ -46,7 +46,7 @@ lemma minf_neq[no_atp]: "\z. \x. x < z \ (x \ t \ True)" by auto lemma minf_P[no_atp]: "\z. \x. x < z \ (P \ P)" by blast -text{* Theorems for @{text "\z. \x. x < z \ (P x \ P\<^bsub>+\\<^esub>)"}*} +text{* Theorems for @{text "\z. \x. x < z \ (P x \ P\<^sub>+\<^sub>\)"}*} lemma pinf_gt[no_atp]: "\z. \x. z < x \ (t < x \ True)" by auto lemma pinf_lt[no_atp]: "\z. \x. z < x \ (x < t \ False)" by (simp add: not_less) (rule exI[where x="t"], auto simp add: less_le) @@ -351,7 +351,7 @@ lemma ge_ex[no_atp]: "\y. x \ y" using gt_ex by auto -text {* Theorems for @{text "\z. \x. z \ x \ (P x \ P\<^bsub>+\\<^esub>)"} *} +text {* Theorems for @{text "\z. \x. z \ x \ (P x \ P\<^sub>+\<^sub>\)"} *} lemma pinf_conj[no_atp]: assumes ex1: "\z1. \x. z1 \ x \ (P1 x \ P1')" and ex2: "\z2. \x. z2 \ x \ (P2 x \ P2')" @@ -402,7 +402,7 @@ lemma le_ex[no_atp]: "\y. y \ x" using lt_ex by auto -text {* Theorems for @{text "\z. \x. x \ z \ (P x \ P\<^bsub>-\\<^esub>)"} *} +text {* Theorems for @{text "\z. \x. x \ z \ (P x \ P\<^sub>-\<^sub>\)"} *} lemma minf_conj[no_atp]: assumes ex1: "\z1. \x. x \ z1 \ (P1 x \ P1')" and ex2: "\z2. \x. x \ z2 \ (P2 x \ P2')" diff -r 6a3410845bb2 -r 98fc47533342 src/HOL/Predicate_Compile_Examples/Specialisation_Examples.thy --- a/src/HOL/Predicate_Compile_Examples/Specialisation_Examples.thy Sun Aug 18 15:35:01 2013 +0200 +++ b/src/HOL/Predicate_Compile_Examples/Specialisation_Examples.thy Sun Aug 18 17:00:10 2013 +0200 @@ -194,35 +194,35 @@ | "\\<^sub>e (Suc n) k \ = \\<^sub>e n k (\[k \\<^sub>\ Top]\<^sub>e)" inductive - well_formed :: "env \ type \ bool" ("_ \\<^bsub>wf\<^esub> _" [50, 50] 50) + well_formed :: "env \ type \ bool" ("_ \\<^sub>w\<^sub>f _" [50, 50] 50) where - wf_TVar: "\\i\ = \TVarB T\ \ \ \\<^bsub>wf\<^esub> TVar i" -| wf_Top: "\ \\<^bsub>wf\<^esub> Top" -| wf_arrow: "\ \\<^bsub>wf\<^esub> T \ \ \\<^bsub>wf\<^esub> U \ \ \\<^bsub>wf\<^esub> T \ U" -| wf_all: "\ \\<^bsub>wf\<^esub> T \ TVarB T \ \ \\<^bsub>wf\<^esub> U \ \ \\<^bsub>wf\<^esub> (\<:T. U)" + wf_TVar: "\\i\ = \TVarB T\ \ \ \\<^sub>w\<^sub>f TVar i" +| wf_Top: "\ \\<^sub>w\<^sub>f Top" +| wf_arrow: "\ \\<^sub>w\<^sub>f T \ \ \\<^sub>w\<^sub>f U \ \ \\<^sub>w\<^sub>f T \ U" +| wf_all: "\ \\<^sub>w\<^sub>f T \ TVarB T \ \ \\<^sub>w\<^sub>f U \ \ \\<^sub>w\<^sub>f (\<:T. U)" inductive - well_formedE :: "env \ bool" ("_ \\<^bsub>wf\<^esub>" [50] 50) - and well_formedB :: "env \ binding \ bool" ("_ \\<^bsub>wfB\<^esub> _" [50, 50] 50) + well_formedE :: "env \ bool" ("_ \\<^sub>w\<^sub>f" [50] 50) + and well_formedB :: "env \ binding \ bool" ("_ \\<^sub>w\<^sub>f\<^sub>B _" [50, 50] 50) where - "\ \\<^bsub>wfB\<^esub> B \ \ \\<^bsub>wf\<^esub> type_ofB B" -| wf_Nil: "[] \\<^bsub>wf\<^esub>" -| wf_Cons: "\ \\<^bsub>wfB\<^esub> B \ \ \\<^bsub>wf\<^esub> \ B \ \ \\<^bsub>wf\<^esub>" + "\ \\<^sub>w\<^sub>f\<^sub>B B \ \ \\<^sub>w\<^sub>f type_ofB B" +| wf_Nil: "[] \\<^sub>w\<^sub>f" +| wf_Cons: "\ \\<^sub>w\<^sub>f\<^sub>B B \ \ \\<^sub>w\<^sub>f \ B \ \ \\<^sub>w\<^sub>f" inductive_cases well_formed_cases: - "\ \\<^bsub>wf\<^esub> TVar i" - "\ \\<^bsub>wf\<^esub> Top" - "\ \\<^bsub>wf\<^esub> T \ U" - "\ \\<^bsub>wf\<^esub> (\<:T. U)" + "\ \\<^sub>w\<^sub>f TVar i" + "\ \\<^sub>w\<^sub>f Top" + "\ \\<^sub>w\<^sub>f T \ U" + "\ \\<^sub>w\<^sub>f (\<:T. U)" inductive_cases well_formedE_cases: - "B \ \ \\<^bsub>wf\<^esub>" + "B \ \ \\<^sub>w\<^sub>f" inductive subtyping :: "env \ type \ type \ bool" ("_ \ _ <: _" [50, 50, 50] 50) where - SA_Top: "\ \\<^bsub>wf\<^esub> \ \ \\<^bsub>wf\<^esub> S \ \ \ S <: Top" -| SA_refl_TVar: "\ \\<^bsub>wf\<^esub> \ \ \\<^bsub>wf\<^esub> TVar i \ \ \ TVar i <: TVar i" + SA_Top: "\ \\<^sub>w\<^sub>f \ \ \\<^sub>w\<^sub>f S \ \ \ S <: Top" +| SA_refl_TVar: "\ \\<^sub>w\<^sub>f \ \ \\<^sub>w\<^sub>f TVar i \ \ \ TVar i <: TVar i" | SA_trans_TVar: "\\i\ = \TVarB U\ \ \ \ \\<^sub>\ (Suc i) 0 U <: T \ \ \ TVar i <: T" | SA_arrow: "\ \ T\<^sub>1 <: S\<^sub>1 \ \ \ S\<^sub>2 <: T\<^sub>2 \ \ \ S\<^sub>1 \ S\<^sub>2 <: T\<^sub>1 \ T\<^sub>2" @@ -232,7 +232,7 @@ inductive typing :: "env \ trm \ type \ bool" ("_ \ _ : _" [50, 50, 50] 50) where - T_Var: "\ \\<^bsub>wf\<^esub> \ \\i\ = \VarB U\ \ T = \\<^sub>\ (Suc i) 0 U \ \ \ Var i : T" + T_Var: "\ \\<^sub>w\<^sub>f \ \\i\ = \VarB U\ \ T = \\<^sub>\ (Suc i) 0 U \ \ \ Var i : T" | T_Abs: "VarB T\<^sub>1 \ \ \ t\<^sub>2 : T\<^sub>2 \ \ \ (\:T\<^sub>1. t\<^sub>2) : T\<^sub>1 \ \\<^sub>\ 1 0 T\<^sub>2" | T_App: "\ \ t\<^sub>1 : T\<^sub>11 \ T\<^sub>12 \ \ \ t\<^sub>2 : T\<^sub>11 \ \ \ t\<^sub>1 \ t\<^sub>2 : T\<^sub>12" | T_TAbs: "TVarB T\<^sub>1 \ \ \ t\<^sub>2 : T\<^sub>2 \ \ \ (\<:T\<^sub>1. t\<^sub>2) : (\<:T\<^sub>1. T\<^sub>2)" diff -r 6a3410845bb2 -r 98fc47533342 src/Tools/jEdit/src/plugin.scala --- a/src/Tools/jEdit/src/plugin.scala Sun Aug 18 15:35:01 2013 +0200 +++ b/src/Tools/jEdit/src/plugin.scala Sun Aug 18 17:00:10 2013 +0200 @@ -35,7 +35,10 @@ @volatile var plugin: Plugin = null @volatile var session: Session = new Session(new JEdit_Thy_Load(Set.empty, Outer_Syntax.empty)) - def options_changed() { session.global_options.event(Session.Global_Options(options.value)) } + def options_changed() { + session.global_options.event(Session.Global_Options(options.value)) + plugin.load_theories() + } def thy_load(): JEdit_Thy_Load = session.thy_load.asInstanceOf[JEdit_Thy_Load] @@ -132,41 +135,45 @@ PIDE.init_models(JEdit_Lib.jedit_buffers().toList) } + def load_theories() { Swing_Thread.later { delay_load.invoke() }} + private lazy val delay_load = Swing_Thread.delay_last(PIDE.options.seconds("editor_load_delay")) { - val view = jEdit.getActiveView() + if (Isabelle.continuous_checking) { + val view = jEdit.getActiveView() - val buffers = JEdit_Lib.jedit_buffers().toList - if (buffers.forall(_.isLoaded)) { - def loaded_buffer(name: String): Boolean = - buffers.exists(buffer => JEdit_Lib.buffer_name(buffer) == name) + val buffers = JEdit_Lib.jedit_buffers().toList + if (buffers.forall(_.isLoaded)) { + def loaded_buffer(name: String): Boolean = + buffers.exists(buffer => JEdit_Lib.buffer_name(buffer) == name) - val thys = - for (buffer <- buffers; model <- PIDE.document_model(buffer)) - yield model.node_name + val thys = + for (buffer <- buffers; model <- PIDE.document_model(buffer)) + yield model.node_name - val thy_info = new Thy_Info(PIDE.thy_load) - // FIXME avoid I/O in Swing thread!?! - val files = thy_info.dependencies(thys).deps.map(_.name.node). - filter(file => !loaded_buffer(file) && PIDE.thy_load.check_file(view, file)) + val thy_info = new Thy_Info(PIDE.thy_load) + // FIXME avoid I/O in Swing thread!?! + val files = thy_info.dependencies(thys).deps.map(_.name.node). + filter(file => !loaded_buffer(file) && PIDE.thy_load.check_file(view, file)) - if (!files.isEmpty) { - val files_list = new ListView(files.sorted) - for (i <- 0 until files.length) - files_list.selection.indices += i + if (!files.isEmpty) { + val files_list = new ListView(files.sorted) + for (i <- 0 until files.length) + files_list.selection.indices += i - val answer = - GUI.confirm_dialog(view, - "Auto loading of required files", - JOptionPane.YES_NO_OPTION, - "The following files are required to resolve theory imports.", - "Reload selected files now?", - new ScrollPane(files_list)) - if (answer == 0) { - files.foreach(file => - if (files_list.selection.items.contains(file)) - jEdit.openFile(null: View, file)) + val answer = + GUI.confirm_dialog(view, + "Auto loading of required files", + JOptionPane.YES_NO_OPTION, + "The following files are required to resolve theory imports.", + "Reload selected files now?", + new ScrollPane(files_list)) + if (answer == 0) { + files.foreach(file => + if (files_list.selection.items.contains(file)) + jEdit.openFile(null: View, file)) + } } } } @@ -239,7 +246,7 @@ if (PIDE.session.is_ready) { val buffer = msg.getBuffer if (buffer != null && !buffer.isLoading) delay_init.invoke() - Swing_Thread.later { delay_load.invoke() } + load_theories() } case msg: EditPaneUpdate