author | wenzelm |
Fri, 01 Jan 2010 21:45:26 +0100 | |
changeset 34826 | 6b38fc0b3406 |
parent 34825 | 7f72547f9b12 |
child 34831 | 4ad3298781d9 |
permissions | -rw-r--r-- |
34777
91d6089cef88
class Session models full session, with or without prover process (cf. heaps, browser_info);
wenzelm
parents:
diff
changeset
|
1 |
/* |
91d6089cef88
class Session models full session, with or without prover process (cf. heaps, browser_info);
wenzelm
parents:
diff
changeset
|
2 |
* Isabelle session, potentially with running prover |
91d6089cef88
class Session models full session, with or without prover process (cf. heaps, browser_info);
wenzelm
parents:
diff
changeset
|
3 |
* |
91d6089cef88
class Session models full session, with or without prover process (cf. heaps, browser_info);
wenzelm
parents:
diff
changeset
|
4 |
* @author Makarius |
91d6089cef88
class Session models full session, with or without prover process (cf. heaps, browser_info);
wenzelm
parents:
diff
changeset
|
5 |
*/ |
91d6089cef88
class Session models full session, with or without prover process (cf. heaps, browser_info);
wenzelm
parents:
diff
changeset
|
6 |
|
91d6089cef88
class Session models full session, with or without prover process (cf. heaps, browser_info);
wenzelm
parents:
diff
changeset
|
7 |
package isabelle.proofdocument |
91d6089cef88
class Session models full session, with or without prover process (cf. heaps, browser_info);
wenzelm
parents:
diff
changeset
|
8 |
|
91d6089cef88
class Session models full session, with or without prover process (cf. heaps, browser_info);
wenzelm
parents:
diff
changeset
|
9 |
|
34820
a8ba6cde13e9
basic setup for synchronous / modal (!) prover startup;
wenzelm
parents:
34819
diff
changeset
|
10 |
import scala.actors.TIMEOUT |
34777
91d6089cef88
class Session models full session, with or without prover process (cf. heaps, browser_info);
wenzelm
parents:
diff
changeset
|
11 |
import scala.actors.Actor._ |
91d6089cef88
class Session models full session, with or without prover process (cf. heaps, browser_info);
wenzelm
parents:
diff
changeset
|
12 |
|
34815
6bae73cd8e33
unified Command and Command_State, eliminated separate Accumulator;
wenzelm
parents:
34813
diff
changeset
|
13 |
|
34791 | 14 |
object Session |
15 |
{ |
|
34813
f0107bc96961
more explicit modeling of Command and Command_State as Session.Entity;
wenzelm
parents:
34810
diff
changeset
|
16 |
/* events */ |
f0107bc96961
more explicit modeling of Command and Command_State as Session.Entity;
wenzelm
parents:
34810
diff
changeset
|
17 |
|
34791 | 18 |
case object Global_Settings |
34813
f0107bc96961
more explicit modeling of Command and Command_State as Session.Entity;
wenzelm
parents:
34810
diff
changeset
|
19 |
|
f0107bc96961
more explicit modeling of Command and Command_State as Session.Entity;
wenzelm
parents:
34810
diff
changeset
|
20 |
|
f0107bc96961
more explicit modeling of Command and Command_State as Session.Entity;
wenzelm
parents:
34810
diff
changeset
|
21 |
/* managed entities */ |
f0107bc96961
more explicit modeling of Command and Command_State as Session.Entity;
wenzelm
parents:
34810
diff
changeset
|
22 |
|
f0107bc96961
more explicit modeling of Command and Command_State as Session.Entity;
wenzelm
parents:
34810
diff
changeset
|
23 |
type Entity_ID = String |
f0107bc96961
more explicit modeling of Command and Command_State as Session.Entity;
wenzelm
parents:
34810
diff
changeset
|
24 |
|
f0107bc96961
more explicit modeling of Command and Command_State as Session.Entity;
wenzelm
parents:
34810
diff
changeset
|
25 |
trait Entity |
f0107bc96961
more explicit modeling of Command and Command_State as Session.Entity;
wenzelm
parents:
34810
diff
changeset
|
26 |
{ |
f0107bc96961
more explicit modeling of Command and Command_State as Session.Entity;
wenzelm
parents:
34810
diff
changeset
|
27 |
val id: Entity_ID |
f0107bc96961
more explicit modeling of Command and Command_State as Session.Entity;
wenzelm
parents:
34810
diff
changeset
|
28 |
def consume(session: Session, message: XML.Tree): Unit |
f0107bc96961
more explicit modeling of Command and Command_State as Session.Entity;
wenzelm
parents:
34810
diff
changeset
|
29 |
} |
34791 | 30 |
} |
31 |
||
34777
91d6089cef88
class Session models full session, with or without prover process (cf. heaps, browser_info);
wenzelm
parents:
diff
changeset
|
32 |
|
91d6089cef88
class Session models full session, with or without prover process (cf. heaps, browser_info);
wenzelm
parents:
diff
changeset
|
33 |
class Session(system: Isabelle_System) |
91d6089cef88
class Session models full session, with or without prover process (cf. heaps, browser_info);
wenzelm
parents:
diff
changeset
|
34 |
{ |
34809 | 35 |
/* pervasive event buses */ |
36 |
||
37 |
val global_settings = new Event_Bus[Session.Global_Settings.type] |
|
38 |
val raw_results = new Event_Bus[Isabelle_Process.Result] |
|
39 |
val results = new Event_Bus[Command] |
|
40 |
||
41 |
val command_change = new Event_Bus[Command] |
|
34823 | 42 |
val document_change = new Event_Bus[Document] |
34809 | 43 |
|
44 |
||
34778 | 45 |
/* unique ids */ |
46 |
||
47 |
private var id_count: BigInt = 0 |
|
34813
f0107bc96961
more explicit modeling of Command and Command_State as Session.Entity;
wenzelm
parents:
34810
diff
changeset
|
48 |
def create_id(): Session.Entity_ID = synchronized { id_count += 1; "j" + id_count } |
34778 | 49 |
|
50 |
||
34826 | 51 |
|
52 |
/** main actor **/ |
|
34809 | 53 |
|
34819 | 54 |
@volatile private var syntax = new Outer_Syntax(system.symbols) |
55 |
def current_syntax: Outer_Syntax = syntax |
|
34809 | 56 |
|
34816
d33312514220
maintain generic session entities -- cover commands, states, etc. (but not yet documents);
wenzelm
parents:
34815
diff
changeset
|
57 |
@volatile private var entities = Map[Session.Entity_ID, Session.Entity]() |
d33312514220
maintain generic session entities -- cover commands, states, etc. (but not yet documents);
wenzelm
parents:
34815
diff
changeset
|
58 |
def lookup_entity(id: Session.Entity_ID): Option[Session.Entity] = entities.get(id) |
d33312514220
maintain generic session entities -- cover commands, states, etc. (but not yet documents);
wenzelm
parents:
34815
diff
changeset
|
59 |
|
d33312514220
maintain generic session entities -- cover commands, states, etc. (but not yet documents);
wenzelm
parents:
34815
diff
changeset
|
60 |
private case class Register(entity: Session.Entity) |
34820
a8ba6cde13e9
basic setup for synchronous / modal (!) prover startup;
wenzelm
parents:
34819
diff
changeset
|
61 |
private case class Start(timeout: Int, args: List[String]) |
34777
91d6089cef88
class Session models full session, with or without prover process (cf. heaps, browser_info);
wenzelm
parents:
diff
changeset
|
62 |
private case object Stop |
34808
e462572536e9
eliminated global Session.document_0 -- did not work due to hardwired id;
wenzelm
parents:
34807
diff
changeset
|
63 |
private case class Begin_Document(path: String) |
34777
91d6089cef88
class Session models full session, with or without prover process (cf. heaps, browser_info);
wenzelm
parents:
diff
changeset
|
64 |
|
34809 | 65 |
private val session_actor = actor { |
66 |
||
67 |
var prover: Isabelle_Process with Isar_Document = null |
|
68 |
||
34816
d33312514220
maintain generic session entities -- cover commands, states, etc. (but not yet documents);
wenzelm
parents:
34815
diff
changeset
|
69 |
def register(entity: Session.Entity) { entities += (entity.id -> entity) } |
d33312514220
maintain generic session entities -- cover commands, states, etc. (but not yet documents);
wenzelm
parents:
34815
diff
changeset
|
70 |
|
34809 | 71 |
|
72 |
/* document changes */ |
|
73 |
||
74 |
def handle_change(change: Change) |
|
75 |
{ |
|
34824
ac35eee85f5c
renamed current_document to recent_document (might be a bit older than current_change);
wenzelm
parents:
34823
diff
changeset
|
76 |
require(change.parent.isDefined) |
34809 | 77 |
|
34825 | 78 |
val (doc, changes) = change.result.join |
34809 | 79 |
val id_changes = changes map { |
80 |
case (c1, c2) => |
|
81 |
(c1.map(_.id).getOrElse(""), |
|
82 |
c2 match { |
|
83 |
case None => None |
|
84 |
case Some(command) => // FIXME clarify -- may reuse existing commands!?? |
|
34816
d33312514220
maintain generic session entities -- cover commands, states, etc. (but not yet documents);
wenzelm
parents:
34815
diff
changeset
|
85 |
register(command) |
34809 | 86 |
prover.define_command(command.id, system.symbols.encode(command.content)) |
87 |
Some(command.id) |
|
88 |
}) |
|
89 |
} |
|
34818
7df68a8f0e3e
register Proof_Document instances as session entities -- handle Markup.EDIT messages locally;
wenzelm
parents:
34817
diff
changeset
|
90 |
register(doc) |
34824
ac35eee85f5c
renamed current_document to recent_document (might be a bit older than current_change);
wenzelm
parents:
34823
diff
changeset
|
91 |
prover.edit_document(change.parent.get.document.id, doc.id, id_changes) |
34809 | 92 |
|
93 |
document_change.event(doc) |
|
94 |
} |
|
95 |
||
96 |
||
97 |
/* prover results */ |
|
98 |
||
99 |
def handle_result(result: Isabelle_Process.Result) |
|
100 |
{ |
|
101 |
raw_results.event(result) |
|
34799
0330a4284a9b
just one variable for outer syntax keywords and completion;
wenzelm
parents:
34795
diff
changeset
|
102 |
|
34813
f0107bc96961
more explicit modeling of Command and Command_State as Session.Entity;
wenzelm
parents:
34810
diff
changeset
|
103 |
val target: Option[Session.Entity] = |
34817 | 104 |
Position.get_id(result.props) match { |
34809 | 105 |
case None => None |
34816
d33312514220
maintain generic session entities -- cover commands, states, etc. (but not yet documents);
wenzelm
parents:
34815
diff
changeset
|
106 |
case Some(id) => entities.get(id) |
34809 | 107 |
} |
34813
f0107bc96961
more explicit modeling of Command and Command_State as Session.Entity;
wenzelm
parents:
34810
diff
changeset
|
108 |
if (target.isDefined) target.get.consume(this, result.message) |
34809 | 109 |
else if (result.kind == Isabelle_Process.Kind.STATUS) { |
34818
7df68a8f0e3e
register Proof_Document instances as session entities -- handle Markup.EDIT messages locally;
wenzelm
parents:
34817
diff
changeset
|
110 |
// global status message |
34809 | 111 |
for (elem <- result.body) { |
112 |
elem match { |
|
113 |
// command and keyword declarations |
|
114 |
case XML.Elem(Markup.COMMAND_DECL, (Markup.NAME, name) :: (Markup.KIND, kind) :: _, _) => |
|
34819 | 115 |
syntax += (name, kind) |
34809 | 116 |
case XML.Elem(Markup.KEYWORD_DECL, (Markup.NAME, name) :: _, _) => |
34819 | 117 |
syntax += name |
34809 | 118 |
|
34820
a8ba6cde13e9
basic setup for synchronous / modal (!) prover startup;
wenzelm
parents:
34819
diff
changeset
|
119 |
case _ => |
34809 | 120 |
} |
121 |
} |
|
122 |
} |
|
123 |
else if (result.kind == Isabelle_Process.Kind.EXIT) |
|
124 |
prover = null |
|
125 |
} |
|
126 |
||
34820
a8ba6cde13e9
basic setup for synchronous / modal (!) prover startup;
wenzelm
parents:
34819
diff
changeset
|
127 |
|
a8ba6cde13e9
basic setup for synchronous / modal (!) prover startup;
wenzelm
parents:
34819
diff
changeset
|
128 |
/* prover startup */ |
a8ba6cde13e9
basic setup for synchronous / modal (!) prover startup;
wenzelm
parents:
34819
diff
changeset
|
129 |
|
a8ba6cde13e9
basic setup for synchronous / modal (!) prover startup;
wenzelm
parents:
34819
diff
changeset
|
130 |
def startup_error(): String = |
a8ba6cde13e9
basic setup for synchronous / modal (!) prover startup;
wenzelm
parents:
34819
diff
changeset
|
131 |
{ |
a8ba6cde13e9
basic setup for synchronous / modal (!) prover startup;
wenzelm
parents:
34819
diff
changeset
|
132 |
val buf = new StringBuilder |
a8ba6cde13e9
basic setup for synchronous / modal (!) prover startup;
wenzelm
parents:
34819
diff
changeset
|
133 |
while ( |
a8ba6cde13e9
basic setup for synchronous / modal (!) prover startup;
wenzelm
parents:
34819
diff
changeset
|
134 |
receiveWithin(0) { |
a8ba6cde13e9
basic setup for synchronous / modal (!) prover startup;
wenzelm
parents:
34819
diff
changeset
|
135 |
case result: Isabelle_Process.Result => |
a8ba6cde13e9
basic setup for synchronous / modal (!) prover startup;
wenzelm
parents:
34819
diff
changeset
|
136 |
if (result.is_raw) { |
a8ba6cde13e9
basic setup for synchronous / modal (!) prover startup;
wenzelm
parents:
34819
diff
changeset
|
137 |
for (text <- XML.content(result.message)) |
a8ba6cde13e9
basic setup for synchronous / modal (!) prover startup;
wenzelm
parents:
34819
diff
changeset
|
138 |
buf.append(text) |
a8ba6cde13e9
basic setup for synchronous / modal (!) prover startup;
wenzelm
parents:
34819
diff
changeset
|
139 |
} |
a8ba6cde13e9
basic setup for synchronous / modal (!) prover startup;
wenzelm
parents:
34819
diff
changeset
|
140 |
true |
a8ba6cde13e9
basic setup for synchronous / modal (!) prover startup;
wenzelm
parents:
34819
diff
changeset
|
141 |
case TIMEOUT => false |
a8ba6cde13e9
basic setup for synchronous / modal (!) prover startup;
wenzelm
parents:
34819
diff
changeset
|
142 |
}) {} |
a8ba6cde13e9
basic setup for synchronous / modal (!) prover startup;
wenzelm
parents:
34819
diff
changeset
|
143 |
buf.toString |
a8ba6cde13e9
basic setup for synchronous / modal (!) prover startup;
wenzelm
parents:
34819
diff
changeset
|
144 |
} |
a8ba6cde13e9
basic setup for synchronous / modal (!) prover startup;
wenzelm
parents:
34819
diff
changeset
|
145 |
|
a8ba6cde13e9
basic setup for synchronous / modal (!) prover startup;
wenzelm
parents:
34819
diff
changeset
|
146 |
def prover_startup(timeout: Int): Option[String] = |
a8ba6cde13e9
basic setup for synchronous / modal (!) prover startup;
wenzelm
parents:
34819
diff
changeset
|
147 |
{ |
a8ba6cde13e9
basic setup for synchronous / modal (!) prover startup;
wenzelm
parents:
34819
diff
changeset
|
148 |
receiveWithin(timeout) { |
a8ba6cde13e9
basic setup for synchronous / modal (!) prover startup;
wenzelm
parents:
34819
diff
changeset
|
149 |
case result: Isabelle_Process.Result |
a8ba6cde13e9
basic setup for synchronous / modal (!) prover startup;
wenzelm
parents:
34819
diff
changeset
|
150 |
if result.kind == Isabelle_Process.Kind.INIT => |
a8ba6cde13e9
basic setup for synchronous / modal (!) prover startup;
wenzelm
parents:
34819
diff
changeset
|
151 |
while (receive { |
a8ba6cde13e9
basic setup for synchronous / modal (!) prover startup;
wenzelm
parents:
34819
diff
changeset
|
152 |
case result: Isabelle_Process.Result => |
a8ba6cde13e9
basic setup for synchronous / modal (!) prover startup;
wenzelm
parents:
34819
diff
changeset
|
153 |
handle_result(result); !result.is_ready |
a8ba6cde13e9
basic setup for synchronous / modal (!) prover startup;
wenzelm
parents:
34819
diff
changeset
|
154 |
}) {} |
a8ba6cde13e9
basic setup for synchronous / modal (!) prover startup;
wenzelm
parents:
34819
diff
changeset
|
155 |
None |
a8ba6cde13e9
basic setup for synchronous / modal (!) prover startup;
wenzelm
parents:
34819
diff
changeset
|
156 |
|
a8ba6cde13e9
basic setup for synchronous / modal (!) prover startup;
wenzelm
parents:
34819
diff
changeset
|
157 |
case result: Isabelle_Process.Result |
a8ba6cde13e9
basic setup for synchronous / modal (!) prover startup;
wenzelm
parents:
34819
diff
changeset
|
158 |
if result.kind == Isabelle_Process.Kind.EXIT => |
a8ba6cde13e9
basic setup for synchronous / modal (!) prover startup;
wenzelm
parents:
34819
diff
changeset
|
159 |
Some(startup_error()) |
a8ba6cde13e9
basic setup for synchronous / modal (!) prover startup;
wenzelm
parents:
34819
diff
changeset
|
160 |
|
a8ba6cde13e9
basic setup for synchronous / modal (!) prover startup;
wenzelm
parents:
34819
diff
changeset
|
161 |
case TIMEOUT => // FIXME clarify |
a8ba6cde13e9
basic setup for synchronous / modal (!) prover startup;
wenzelm
parents:
34819
diff
changeset
|
162 |
prover.kill; Some(startup_error()) |
a8ba6cde13e9
basic setup for synchronous / modal (!) prover startup;
wenzelm
parents:
34819
diff
changeset
|
163 |
} |
a8ba6cde13e9
basic setup for synchronous / modal (!) prover startup;
wenzelm
parents:
34819
diff
changeset
|
164 |
} |
34809 | 165 |
|
166 |
||
167 |
/* main loop */ |
|
168 |
||
34820
a8ba6cde13e9
basic setup for synchronous / modal (!) prover startup;
wenzelm
parents:
34819
diff
changeset
|
169 |
val xml_cache = new XML.Cache(131071) |
a8ba6cde13e9
basic setup for synchronous / modal (!) prover startup;
wenzelm
parents:
34819
diff
changeset
|
170 |
|
34777
91d6089cef88
class Session models full session, with or without prover process (cf. heaps, browser_info);
wenzelm
parents:
diff
changeset
|
171 |
loop { |
91d6089cef88
class Session models full session, with or without prover process (cf. heaps, browser_info);
wenzelm
parents:
diff
changeset
|
172 |
react { |
34816
d33312514220
maintain generic session entities -- cover commands, states, etc. (but not yet documents);
wenzelm
parents:
34815
diff
changeset
|
173 |
case Register(entity: Session.Entity) => |
d33312514220
maintain generic session entities -- cover commands, states, etc. (but not yet documents);
wenzelm
parents:
34815
diff
changeset
|
174 |
register(entity) |
d33312514220
maintain generic session entities -- cover commands, states, etc. (but not yet documents);
wenzelm
parents:
34815
diff
changeset
|
175 |
reply(()) |
d33312514220
maintain generic session entities -- cover commands, states, etc. (but not yet documents);
wenzelm
parents:
34815
diff
changeset
|
176 |
|
34820
a8ba6cde13e9
basic setup for synchronous / modal (!) prover startup;
wenzelm
parents:
34819
diff
changeset
|
177 |
case Start(timeout, args) => |
34777
91d6089cef88
class Session models full session, with or without prover process (cf. heaps, browser_info);
wenzelm
parents:
diff
changeset
|
178 |
if (prover == null) { |
34780 | 179 |
prover = new Isabelle_Process(system, self, args:_*) with Isar_Document |
34820
a8ba6cde13e9
basic setup for synchronous / modal (!) prover startup;
wenzelm
parents:
34819
diff
changeset
|
180 |
val origin = sender |
a8ba6cde13e9
basic setup for synchronous / modal (!) prover startup;
wenzelm
parents:
34819
diff
changeset
|
181 |
val opt_err = prover_startup(timeout) |
a8ba6cde13e9
basic setup for synchronous / modal (!) prover startup;
wenzelm
parents:
34819
diff
changeset
|
182 |
if (opt_err.isDefined) prover = null |
a8ba6cde13e9
basic setup for synchronous / modal (!) prover startup;
wenzelm
parents:
34819
diff
changeset
|
183 |
origin ! opt_err |
a8ba6cde13e9
basic setup for synchronous / modal (!) prover startup;
wenzelm
parents:
34819
diff
changeset
|
184 |
} |
a8ba6cde13e9
basic setup for synchronous / modal (!) prover startup;
wenzelm
parents:
34819
diff
changeset
|
185 |
else reply(None) |
a8ba6cde13e9
basic setup for synchronous / modal (!) prover startup;
wenzelm
parents:
34819
diff
changeset
|
186 |
|
a8ba6cde13e9
basic setup for synchronous / modal (!) prover startup;
wenzelm
parents:
34819
diff
changeset
|
187 |
case Stop => // FIXME clarify; synchronous |
a8ba6cde13e9
basic setup for synchronous / modal (!) prover startup;
wenzelm
parents:
34819
diff
changeset
|
188 |
if (prover != null) { |
a8ba6cde13e9
basic setup for synchronous / modal (!) prover startup;
wenzelm
parents:
34819
diff
changeset
|
189 |
prover.kill |
a8ba6cde13e9
basic setup for synchronous / modal (!) prover startup;
wenzelm
parents:
34819
diff
changeset
|
190 |
prover = null |
34777
91d6089cef88
class Session models full session, with or without prover process (cf. heaps, browser_info);
wenzelm
parents:
diff
changeset
|
191 |
} |
91d6089cef88
class Session models full session, with or without prover process (cf. heaps, browser_info);
wenzelm
parents:
diff
changeset
|
192 |
|
34820
a8ba6cde13e9
basic setup for synchronous / modal (!) prover startup;
wenzelm
parents:
34819
diff
changeset
|
193 |
case Begin_Document(path: String) if prover != null => |
34808
e462572536e9
eliminated global Session.document_0 -- did not work due to hardwired id;
wenzelm
parents:
34807
diff
changeset
|
194 |
val id = create_id() |
34823 | 195 |
val doc = Document.empty(id) |
34818
7df68a8f0e3e
register Proof_Document instances as session entities -- handle Markup.EDIT messages locally;
wenzelm
parents:
34817
diff
changeset
|
196 |
register(doc) |
34808
e462572536e9
eliminated global Session.document_0 -- did not work due to hardwired id;
wenzelm
parents:
34807
diff
changeset
|
197 |
prover.begin_document(id, path) |
e462572536e9
eliminated global Session.document_0 -- did not work due to hardwired id;
wenzelm
parents:
34807
diff
changeset
|
198 |
reply(doc) |
34809 | 199 |
|
34820
a8ba6cde13e9
basic setup for synchronous / modal (!) prover startup;
wenzelm
parents:
34819
diff
changeset
|
200 |
case change: Change if prover != null => |
34777
91d6089cef88
class Session models full session, with or without prover process (cf. heaps, browser_info);
wenzelm
parents:
diff
changeset
|
201 |
handle_change(change) |
91d6089cef88
class Session models full session, with or without prover process (cf. heaps, browser_info);
wenzelm
parents:
diff
changeset
|
202 |
|
91d6089cef88
class Session models full session, with or without prover process (cf. heaps, browser_info);
wenzelm
parents:
diff
changeset
|
203 |
case result: Isabelle_Process.Result => |
34795 | 204 |
handle_result(result.cache(xml_cache)) |
34777
91d6089cef88
class Session models full session, with or without prover process (cf. heaps, browser_info);
wenzelm
parents:
diff
changeset
|
205 |
|
34820
a8ba6cde13e9
basic setup for synchronous / modal (!) prover startup;
wenzelm
parents:
34819
diff
changeset
|
206 |
case bad if prover != null => |
34777
91d6089cef88
class Session models full session, with or without prover process (cf. heaps, browser_info);
wenzelm
parents:
diff
changeset
|
207 |
System.err.println("session_actor: ignoring bad message " + bad) |
91d6089cef88
class Session models full session, with or without prover process (cf. heaps, browser_info);
wenzelm
parents:
diff
changeset
|
208 |
} |
91d6089cef88
class Session models full session, with or without prover process (cf. heaps, browser_info);
wenzelm
parents:
diff
changeset
|
209 |
} |
91d6089cef88
class Session models full session, with or without prover process (cf. heaps, browser_info);
wenzelm
parents:
diff
changeset
|
210 |
} |
91d6089cef88
class Session models full session, with or without prover process (cf. heaps, browser_info);
wenzelm
parents:
diff
changeset
|
211 |
|
34809 | 212 |
|
213 |
/* main methods */ |
|
214 |
||
34816
d33312514220
maintain generic session entities -- cover commands, states, etc. (but not yet documents);
wenzelm
parents:
34815
diff
changeset
|
215 |
def register_entity(entity: Session.Entity) { session_actor !? Register(entity) } |
d33312514220
maintain generic session entities -- cover commands, states, etc. (but not yet documents);
wenzelm
parents:
34815
diff
changeset
|
216 |
|
34820
a8ba6cde13e9
basic setup for synchronous / modal (!) prover startup;
wenzelm
parents:
34819
diff
changeset
|
217 |
def start(timeout: Int, args: List[String]): Option[String] = |
a8ba6cde13e9
basic setup for synchronous / modal (!) prover startup;
wenzelm
parents:
34819
diff
changeset
|
218 |
(session_actor !? Start(timeout, args)).asInstanceOf[Option[String]] |
a8ba6cde13e9
basic setup for synchronous / modal (!) prover startup;
wenzelm
parents:
34819
diff
changeset
|
219 |
|
34777
91d6089cef88
class Session models full session, with or without prover process (cf. heaps, browser_info);
wenzelm
parents:
diff
changeset
|
220 |
def stop() { session_actor ! Stop } |
91d6089cef88
class Session models full session, with or without prover process (cf. heaps, browser_info);
wenzelm
parents:
diff
changeset
|
221 |
def input(change: Change) { session_actor ! change } |
91d6089cef88
class Session models full session, with or without prover process (cf. heaps, browser_info);
wenzelm
parents:
diff
changeset
|
222 |
|
34823 | 223 |
def begin_document(path: String): Document = |
224 |
(session_actor !? Begin_Document(path)).asInstanceOf[Document] |
|
34777
91d6089cef88
class Session models full session, with or without prover process (cf. heaps, browser_info);
wenzelm
parents:
diff
changeset
|
225 |
} |