1 \documentclass[runningheads]{llncs}
7 % \myincludegraphics{filename}{place}{width}{caption}{label}
8 \newcommand{\myincludegraphics}[5]{
11 \includegraphics[width=#3]{eps/#1.eps}
19 \usepackage{draftstamp}
21 \newcommand{\musing}{\texttt{musing}}
22 \newcommand{\musings}{\texttt{musings}}
23 \newcommand{\ws}{Web-Service}
24 \newcommand{\wss}{Web-Services}
25 \newcommand{\hbugs}{H-Bugs}
26 \newcommand{\helm}{HELM}
27 \newcommand{\Omegapp}{$\Omega$mega}
28 \newcommand{\OmegaAnts}{$\Omega$mega-Ants}
30 \title{Brokers and Web-Services for Automatic Deduction: a Case Study}
32 \author{Claudio Sacerdoti Coen \and Stefano Zacchiroli}
35 Department of Computer Science\\
36 University of Bologna\\
37 Mura Anteo Zamboni 7, 40127 Bologna, ITALY\\
38 \email{sacerdot@cs.unibo.it}
40 Department of Computer Science\\
41 \'Ecole Normale Sup\'erieure\\
42 45, Rue d'Ulm, F-75230 Paris Cedex 05, FRANCE\\
43 \email{zack@cs.unibo.it}
53 We present a planning broker and several Web-Services for automatic deduction.
54 Each Web-Service implements one of the tactics usually available in an
55 interactive proof-assistant. When the broker is submitted a "proof status" (an
56 unfinished proof tree and a focus on an open goal) it dispatches the proof to
57 the Web-Services, collects the successful results, and send them back to the
58 client as "hints" as soon as they are available.
60 In our experience this architecture turns out to be helpful both for
61 experienced users (who can take benefit of distributing heavy computations)
62 and beginners (who can learn from it).
65 \section{Introduction}
66 The \ws{} approach at software development seems to be a working solution for
67 getting rid of a wide range of incompatibilities between communicating
68 software applications. W3C's efforts in standardizing related technologies
69 grant longevity and implementations availability for frameworks based on
70 \wss{} for information exchange. As a direct consequence, the number of such
71 frameworks is increasing and the World Wide Web is moving from a disorganized
72 repository of human-understandable HTML documents to a disorganized repository
73 of applications working on machine-understandable XML documents both for input
76 The big challenge for the next future is to provide stable and reliable
77 services over this disorganized, unreliable and ever-evolving architecture.
78 The standard solution is providing a further level of
79 stable services (called \emph{brokers}) that behave as common gateway/address
80 for client applications to access a wide variety of services and abstract over
83 Since the \emph{Declaration of Linz}, the MONET
84 Consortium\footnote{\url{http://monet.nag.co.uk/cocoon/monet/index.html}}
85 is working on the development of a framework, based on the
86 \wss{}/brokers approach, aimed at providing a set of software tools for the
87 advertisement and the discovery of mathematical \wss{}.
88 %CSC This framework turns out to be strongly based on both \wss{} and brokers.
90 Several groups have already developed software bus and
91 services\footnote{The most part of these systems predate the development of
92 \wss. Those systems whose development is still active are slowly being
93 reimplemented as \wss.} providing both computational and reasoning
94 capabilities \cite{ws1,ws2,ws3,ws4}: the first ones are implemented on top of
95 Computer Algebra Systems; the second ones provide interfaces to well-known
97 Proof-planners, proof-assistants, CAS and
98 domain-specific problem solvers are natural candidates to be client of these
99 services. Nevertheless, so far the number of examples in the literature has
100 been extremely low and the concrete benefits are still to be assessed.
102 In this paper we present an architecture, namely \hbugs{}, implementing a
103 \emph{suggestion engine} for the proof assistant developed on behalf of the
104 \helm{}\footnote{Hypertextual Electronic Library of Mathematics,
105 \url{http://helm.cs.unibo.it}} project
106 \cite{helm}. We provide several \wss{} (called \emph{tutors}) able to
107 suggest possible ways to proceed in a proof. The tutors are orchestrated
108 by a broker (a \ws{} itself) that is able to dispatch a proof
109 status from a client (the proof-assistant) to the tutors;
110 each tutor try to make progress in the proof and, in case
111 of success, notify the client that shows an \emph{hint} to the user.
112 The broker is an instance of the homonymous entity of the MONET framework.
113 The tutors are MONET services. Another \ws (which is not described in this
114 paper and which is called Getter \cite{zack}) is used to locate and download
115 mathematical entities; the Getter plays the role of the Mathematical Object
116 Manager in the MONET framework.
118 A precursor of \hbugs{} is the \OmegaAnts{} project
119 \cite{omegaants1,omegaants2}, which provided similar functionalities to the
120 \Omegapp{} proof-planner \cite{omega}. The main architectural difference
121 between \hbugs{} and \OmegaAnts{} are that the latter is based on a
122 black-board architecture and it is not implemented using \wss{} and
125 In Sect. \ref{architecture} we present the architecture of \hbugs{}.
126 Further implementation details are given in Sect. \ref{implementation}.
127 Sect. \ref{tutors} is an overview of the tutors that have been implemented.
128 As usual, the paper ends with the conclusions and future works.
130 \section{An \hbugs{} Bird's Eye View}
132 \myincludegraphics{arch}{t}{8cm}{\hbugs{} architecture}{\hbugs{} architecture}
134 The \hbugs{} architecture (depicted in Fig. \ref{arch}) is based on three
135 different kinds of actors: \emph{clients}, \emph{brokers}, and \emph{tutors}.
136 Each actor present one or more \ws{} interfaces to its neighbors \hbugs{}
139 In this section we will detail the role and requirements of each kind of
140 actors and discuss about the correspondences between them and the MONET
141 entities described in \cite{MONET-Overview}.
144 An \hbugs{} client is a software component able to produce \emph{proof
145 status} and to consume \emph{hints}.
147 A proof status is a representation of an incomplete proof and is supposed to
148 be informative enough to be used by an interactive proof assistant. No
149 additional requirements exist on the proof status, but there should be an
150 agreement on its format between clients and tutors. An hint is an
151 encoding of a step that can be performed in order to proceed in an
152 incomplete proof. Usually it represents a reference to a tactic available
153 on some proof assistant along with an instantiation for its formal
154 parameters. More structured hints can also be used: an hint can be
155 as complex as a whole proof-plan.
157 Using W3C's terminology \cite{ws-glossary}, clients act both as \ws{}
158 providers and requesters, see Fig. \ref{interfaces}.
159 They act as providers for the broker (to receive hints)
160 and as requesters (to submit new status). Clients
161 additionally use broker service to know which tutors are available and to
162 subscribe to one or more of them.
164 Usually, when the role of client is taken by an interactive proof assistant,
165 new status are sent to the broker as soon as the proof change (e.g. when the
166 user applies a tactic or when a new proof is started) and hints are shown to
167 the user be the means of some effect in the user interface (e.g. popping a
168 dialog box or enlightening a tactic button).\ednote{CSC: questo \'e un
169 possibile posto dove mettere una mini-sessione interattiva. L'appendice
172 \myincludegraphics{interfaces}{t!}{10cm}{\hbugs{} \wss{} interfaces}
173 {\hbugs{} \wss{} interfaces}
175 \hbugs{} clients act as MONET clients and ask brokers to provide access to a
176 set of services (the tutors). \hbugs{} has no actors corresponding to
177 MONET's Broker Locating Service (since the client is supposed to know the
178 URI of at least one broker). The \hbugs{} client and tutors contact the
179 Getter (a MONET Mathematical Object Manager) to locate and retrieve
180 mathematical items in the \helm{} library.
181 The proof status that are exchanged
182 by the \hbugs{} actors, instead, are built on the fly and are neither
183 stored nor are given an unique identifier (URI) to be managed by the
187 Brokers are the key actors of the \hbugs{} architecture since they
188 act as intermediaries between clients and tutors. They behave as \wss{}
189 providers and requesters for \emph{both} clients and tutors, see Fig.
192 With respect to client, a broker act as \ws{} provider, receiving the
193 proof status and forwarding it to one or more tutors.
194 It also acts as a \ws{} requester sending
195 hints to the client as soon as they are available from the tutors.
197 With respect to tutors, the \ws{} provider role is accomplished by receiving
198 hints as soon as they are produced; as a requester, it is accomplished
199 by asking for computations (\emph{musings} in \hbugs{} terminology) on
200 status received by clients and by stopping already late but still
203 Additionally brokers keep track of available tutors and clients
206 \hbugs{} brokers act as MONET brokers implementing the following components:
207 Client Manager, Service Registry Manager (keeping track of available
208 tutors), Planning Manager (choosing the available tutors among the ones to
209 which the client is subscribed), Execution Manager. The Service Manager
210 component is not required since the session handler, that identifies
211 a session between a service and a broker, is provided to the service by
212 the broker instead of being received from the service when it is
213 initialized. In particular, a session is identified by an unique identifier
214 for the client (its URL) and an unique identifier for the broker (its
217 The MONET architecture specification does not state explicitly whether
218 the service and broker answers can be asynchronous. Nevertheless, the
219 described information flow implicitly suggests a synchronous implementation.
220 On the contrary, in \hbugs{} every request is asynchronous: the connection
221 used by an actor to issue a query is immediately closed; when a service
222 produces an answer, it gives it back to the issuer by calling the
223 appropriate actor's method.
226 Tutors are software component able to consume proof status producing hints.
227 \hbugs{} doesn't specify by which means hints should be produced: tutors can
228 use any means necessary (heuristics, external theorem prover or CAS, ...).
229 The only requirement is that there exists an agreement on the formats of
230 proof status and hints.
232 Tutors act both as \ws{} providers and requesters for the broker. As
233 providers, they wait for commands requesting to start a new \musing{} on
234 a given proof status or to stop an old, out of date, \musing{}. As
235 requesters, they signal to the broker the end of a \musing{} along with its
236 outcome (an hint in case of success or a notification of failure).
238 \hbugs{} tutors act as MONET services.
240 \section{Implementation's Highlights}
241 \label{implementation}
242 In this section we present some of the most relevant implementation details of
243 the \hbugs{} architecture.
246 \paragraph{Proof status}
247 In our implementation of the \hbugs{} architecture we used the proof
248 assistant of the \helm{} project (codename ``gTopLevel'') as an \hbugs{}
249 client. Thus we have implemented serialization/deserialization capabilities
250 for its internal status. In order to be able to describe \wss{} that
251 exchange status in WSDL using the XML Schema type system, we have chosen an
252 XML format as the target format for the serialization.
254 A schematic representation of the gTopLevel internal status is depicted in
255 Fig. \ref{status}. Each proof is represented by a tuple of four elements:
256 \emph{uri}, \emph{metasenv}, \emph{proof}, \emph{thesis}.
258 \myincludegraphics{status}{t}{8cm}{gTopLevel proof status}{gTopLevel proof
262 \item[uri]: an URI chosen by the user at the beginning of the proof
263 process. Once (and if) proved, that URI will globally identify the term
264 inside the \helm{} library (given that the user decides to save it).
265 \item[thesis]: the thesis of the ongoing proof
266 \item[proof]: the current incomplete proof tree. It can contain
267 \emph{metavariables} (holes) that stands for the parts of the proof
268 that are still to be completed. Each metavariable appearing in the
269 tree references one element of the metavariables environment
271 \item[metasenv]: the metavariables environment is a list of
272 \emph{goals} (unproved conjectures).
273 In order to complete the proof, the user has to instantiate every
274 metavariable in the proof with a proof of the corresponding goal.
275 Each goal is identified by an unique identifier and has a context
276 and a type ( the goal thesis). The context is a list of named
277 hypotheses (declarations and definitions). Thus the context and the goal
278 thesis form a sequent, which is the statement of the proof that will
279 be used to instantiate the metavariable occurrences.
282 Each of these information is represented in XML as described in
283 \cite{mowglicic}. Additionally, an \hbugs{} status carry the unique
284 identifier of the current goal, which is the goal the user is currently
285 focused on. Using this value it is possible to implement different client
286 side strategies: the user could ask the tutors to work on the goal
287 she is considering or to work on the other ``background'' goals.
290 An hint in the \hbugs{} architecture should carry enough information to
291 permit the client to progress in the current proof. In our
292 implementation each hint corresponds to either one of the tactics available
293 to the user in gTopLevel (together with its actual arguments) or a set
294 of alternative suggestions (a list of hints).
296 For tactics that don't require any particular argument (like tactics that
297 apply type constructors or decision procedures)
298 only the tactic name is represented in the hint. For tactics that need
299 terms as arguments (for example the \texttt{Apply} tactic that apply a
300 given lemma) the hint includes a textual representation of them, using the
301 same representation used by the interactive proof assistant when querying
302 user for terms. In order to be transmitted between \wss{}, hints are
305 It is also possible for a tutor to return more hints at once,
306 grouping them in a particular XML element.
307 This feature turns out to be particularly useful for the
308 \emph{searchPatternApply} tutor (see Sect. \ref{tutors}) that
309 query a lemma database and return to the client a list of all lemmas that
310 could be used to complete the proof. This particular hint is encoded as a
311 list of \texttt{Apply} hints, each of them having one of the results as term
314 We would like to stress that the \hbugs{} architecture has no dependency
315 on either the hint or the status representation: the only message parts
316 that are fixed are those representing the administrative messages
317 (the envelops in the \wss{} terminology). In particular, the broker can
318 manage at the same time several sessions working on different status/hints
319 formats. Of course, there must be an agreement between the clients
320 and the tutors on the format of the data exchanged.
322 In our implementation the client does not trust the tutors hints:
323 being encoded as references to available tactics imply
324 that an \hbugs{} client, on receipt of an hint, simply try to reply the work
325 done by a tutor on the local copy of the proof. The application of the hint
326 can even fail to type check and the client copy of the proof can be left
327 undamaged after spotting the error. Note, however, that it is still
328 possible to implement a complex tutor that looks for a proof doing
330 send back to the client an hint whose argument is a witness (a trace) of
331 the proof found: the client applies the hint reconstructing (and checking
332 the correctness of) the proof from the witness, without having to
333 re-discover the proof itself.
335 An alternative implementation where the tutors are trusted would simply
336 send back to the client a new proof-status. Upon receiving the
337 proof-status, the client would just override its current proof status with
338 the suggested one. In the case of those clients which are implemented
339 using proof-objects (as the Coq proof-assistant, for instance), it is
340 still possible for the client to type-check the proof-object and reject
341 wrong hints. The systems that are not based on proof-objects
342 (as PVS, NuPRL, etc.), instead, have to trust the new proof-status. In this
343 case the \hbugs{} architecture needs at least to be extended with
344 clients-tutors authentication.
346 \paragraph{Registries}
347 Being central in the \hbugs{} architecture, the broker is also responsible
348 of housekeeping operations both for clients and tutors. These operations are
349 implemented using three different data structures called \emph{registries}:
350 clients registry, tutors registry and \musings{} registry.
352 In order to use the suggestion engine a client should register itself to the
353 broker and subscribe to one or more tutors. The registration phase is
354 triggered by the client using the \texttt{Register\_client} method of the
355 broker to send him an unique identifier and its base URI as a
356 \ws{}. After the registration, the client can use broker's
357 \texttt{List\_tutors} method to get a list of available tutors.
358 Eventually the client can subscribe to one or more of these using broker's
359 \texttt{Subscribe} method. Clients can also unregister from brokers using
360 \texttt{Unregister\_client} method.
362 The broker keeps track of both registered clients and clients' subscriptions
363 in the clients registry.
365 In order to be advertised to clients during the subscription phase, tutors
366 should register to the broker using the broker's \texttt{Register\_tutor}
367 method. This method is really similar to \texttt{Register\_client}:
368 tutors are required to send an unique identify and a base URI for their
370 Additionally tutors are required to send an human readable description of
371 their capabilities; this information could be used by client's user to
372 decide which tutors he needs to subscribe to. Like clients, tutors can
373 unregister from brokers using \texttt{Unregister\_broker} method.
375 Each time the client status change, the status is sent to the
376 broker using its \emph{Status} method. Using both clients registry (to
377 lookup client's subscription) and tutors registry (to check if some tutors
378 has unsubscribed), the broker is able to decide to which tutors the
379 new status must be forwarded.\ednote{CSC: qui o nei lavori futuri parlare
380 della possibilit\'a di avere un vero brocker che multiplexi le richieste
381 dei client localizzando i servizi, etc.}
383 The forwarding operation is performed using the \texttt{Start\_musing}
384 method of the tutors, that is a request to start a new computation
385 (\emph{\musing{}}) on a given status. The return value of
386 \texttt{Start\_musing} is a
387 \musing{} identifier that is saved in the \musings{} registry along with
388 the identifier of the client that triggered the \musing{}.
390 As soon as a tutor completes an \musing{}, it informs the broker
391 using its \texttt{Musing\_completed} method; the broker can now remove the
392 \musing{} entry from the \musings{} registry and, depending on its outcome,
393 inform the client. In case of success one of the \texttt{Musing\_completed}
394 arguments is an hint to be sent to the client, otherwise there's no need to
395 inform him and the \texttt{Musing\_completed} method is called
396 just to update the \musings{} registry.
398 Consulting the \musings{} registry, the broker is able to know, at each
399 time, which \musings{} are in execution on which tutor. This peculiarity is
400 exploited by the broker on invocation of Status method. Receiving a new
401 status from the client implies indeed that the previous status no longer
402 exists and all \musings{} working on it should be stopped: additionally to
403 the already described behavior (i.e. starting new \musings{} on the
404 received status), the broker takes also care of stopping ongoing
405 computation invoking \texttt{Stop\_musing} tutors' method.
408 As already discussed, all \hbugs{} actors act as \wss{} offering one or more
409 services to neighbor actors. To grant as most accessibility as possible to
410 our \wss{} we have chosen to bind them using the HTTP/POST bindings
411 described in \cite{wsdlbindings}\footnote{Given that our proof assistant was
412 entirely developed in the Objective Caml language, we have chosen to
413 develop also \hbugs{} in that language in order to maximize code reuse. To
414 develop \wss{} in Objective Caml we have developed an auxiliary generic
415 library (\emph{O'HTTP}) that can be used to write HTTP 1.1 Web servers and
416 abstract over GET/POST parsing. This library supports different kinds of Web
417 servers architecture, including multi-process and multi-threaded ones.}.
420 Each tutor expose a \ws{} interface and should be able to work, not only for
421 many different clients referring to a common broker, but also for many
422 different brokers. The potential high number of concurrent clients imposes
423 a multi-threaded or multi-process architecture.
425 Our current implementation is based on a multi threaded architecture
426 exploiting the capabilities of the O'HTTP library. Each tutor is composed
427 by one thread always running plus
428 an additional thread for each running \musing{}. One thread is devoted to
429 listening for incoming \ws{} request; upon correct receiving requests it
430 pass the control to a second thread, created on the fly, to handle the
431 incoming request following the classical one-thread-per-request approach in
433 If the received request is \texttt{Start\_musing}, a new thread is
434 spawned to handle it and the thread in duty to handle the HTTP request
435 returns an HTTP response containing an identifier of the just started
436 musing. Otherwise, if the received request is \texttt{Stop\_musing},
437 it carries a \texttt{musing} identifier used to identify the thread
438 responsible for a \texttt{musing}; that thread gets killed and an HTTP
439 response is returned.
441 This architecture turns out to be scalable and allows the running threads
442 to share the cache of loaded (and type-checked) theorems.
443 As we will explain in Sect. \ref{tutors}, this feature turns out to be
444 really useful for tactics that rely on a huge but fixed set of lemmas,
445 as every reflexivite tactic.
447 The implementation of a tutor with the described architecture is not that
448 difficult having a language with good threading capabilities (as OCaml has)
449 and a pool of already implemented tactics (as gTopLevel has).
450 Still working with threads is known to be really error prone due to
451 concurrent programming intrinsic complexity. Moreover, there is a
452 non-neglectable part of code that needs to be duplicated in every tutor:
453 the code to register the tutor to the broker and to handle HTTP requests;
454 the code to manage the creation and termination of threads; and the code for
455 parsing the requests and serializing the answers. As a consequence we
456 have written a generic implementation of a tutor which is parameterized
457 over the code that actually propose the hint and some administrative
458 data (as the port the tutor will be listening to).
460 The generic tutor skeleton is really helpful in writing new tutors.
461 Nevertheless, the code obtained by converting existing tactics into tutors
462 is still quite repetitive: every tutor that wraps a tactic has to
463 instantiate its own copy of the proof-engine kernel and, for each request,
464 it has to override its status, guess the tactic arguments, apply the tactic
465 and, in case of success, send back an hint with the tactic name and the
466 chosen arguments. Of course, the complex part of the work is guessing the
467 right arguments. For the simple case of tactics that do not require
468 any argument, though, we are able to automatically generate the whole
469 tutor code given the tactic name. Concretely, we have written a
470 tactic-based tutor template and a script that parses an XML file with
471 the specification of the tutor and generates the tutor's code.
472 The XML file describes the tutor's port, the code to invoke the tactic,
473 the hint that is sent back upon successful application and a
474 human readable explanation of the tactic implemented by the tutor.
476 \section{The Implemented \hbugs Tutors}
478 To test the \hbugs{} architecture and to assess the utility of a suggestion
479 engine for the end user, we have implemented several tutors. In particular,
480 we have investigated three classes of tutors:
482 \item \emph{Tutors for beginners}. These are tutors that implement tactics
483 which are neither computationally expensive nor difficult to understand:
484 an expert user can always understand if the tactic can be applied or not
485 without having to try it. For example, the following implemented tutors
486 belong to this class:
488 \item \emph{Assumption Tutor}: it ends the proof if the thesis is
489 equivalent\footnote{In our implementation, the equivalence relation
490 imposed by the logical framework is \emph{convertibility}. Two
491 expressions are convertible when they reduce to the same normal form.
492 Two ``equal'' terms depending on free variables can be non-convertible
493 since free variables stop the reduction. For example, $2x$ is convertible
494 with $(3-1)x$ because they both reduce to the same normal form
495 $x + x + 0$; but $2x$ is not convertible to $x2$ since the latter is
496 already in normal form.}
497 to one of the hypotheses\footnote{
498 In some cases, especially when non-trivial computations are involved,
499 the user is totally unable to figure out the convertibility of two terms.
500 In these cases the tutor becomes handy also for expert users.}.
501 \item \emph{Contradiction Tutor}: it ends the proof by \emph{reductio ad
502 adsurdum} if one hypothesis is equivalent to $False$.
503 \item \emph{Symmetry Tutor}: if the goal thesis is an equality, it
504 suggests to apply the commutative property.
505 \item \emph{Left/Right/Exists/Split/Reflexivity/Constructor Tutors}:
506 the Constructor Tutor suggests to proceed in the proof by applying one
507 or more constructors when the goal thesis is an inductive type or a
508 proposition inductively defined according to the declarative
509 style\footnote{An example of a proposition that can be given in
510 declarative style is the $\le$ relation: $\le$ is the smallest relation
511 such that $n \le n$ for every $n$ and $n \le m$ for every $n,m$ such
512 that $n \le p$ where $p$ is the predecessor of $m$. Thus, a proof
513 of $n \le n$ is simply the application of the first constructor to
514 $n$ and a proof of $n \le m$ is the application of the second
515 constructor to $n,m$ and a proof of $n \le m$.}.
516 Since disjunction, conjunction, existential quantification and
517 Leibniz equality are particular cases of inductive propositions,
518 all the other tutors of this class are instantiations of the
519 the Constructor tactic. Left and Right suggest to prove a disjunction
520 by proving its left/right member; Split reduces the proof of a
521 conjunction to the two proof of its members; Exists suggests to
522 prove an existential quantification by providing a
523 witness\footnote{This task is left to the user.}; Reflexivity proves
524 an equality whenever the two sides are convertible.
526 Beginners, when first faced with a tactic-based proof-assistant, get
527 lost quite soon since the set of tactics is large and their names and
528 semantics must be remembered by heart. Tutorials are provided to guide
529 the user step-by-step in a few proofs, suggesting the tactics that must
530 be used. We believe that our beginners tutors can provide an auxiliary
531 learning tool: after the tutorial, the user is not suddenly left alone
532 with the system, but she can experiment with variations of the proof given
533 in the tutorial as much as she like, still getting useful suggestions.
534 Thus the user is allowed to focus on learning how to do a formal proof
535 instead of wasting efforts trying to remember the interface to the system.
536 \item{Tutors for Computationally Expensive Tactics}. Several tactics have
537 an unpredictable behavior, in the sense that it is unfeasible to understand
538 whether they will succeed or they will fail when applied and what will be
539 their result. Among them, there are several tactics either computationally
540 expensive or resources consuming. In the first case, the user is not
541 willing to try a tactic and wait for a long time just to understand its
542 outcome: she would prefer to keep on concentrating on the proof and
543 have the tactic applied in background and receive out-of-band notification
544 of its success. The second case is similar, but the tactic application must
545 be performed on a remote machine to avoid overloading the user host
546 with several concurrent resource consuming applications.
548 Finally, several complex tactics and in particular all the tactics based
549 on reflexive techniques depend on a pretty large set of definitions, lemmas
550 and theorems. When these tactics are applied, the system needs to retrieve
551 and load all the lemmas. Pre-loading all the material needed by every
552 tactic can quickly lead to long initialization times and to large memory
553 footstamps. A specialized tutor running on a remote machine, instead,
554 can easily pre-load the required theorems.
556 As an example of computationally expensive task, we have implemented
557 a tutor for the \emph{Ring} tactic \cite{ringboutin}.
558 The tutor is able to prove an equality over a ring by reducing both members
559 to a common normal form. The reduction, which may require some time in
561 is based on the usual commutative, associative and neutral element properties
562 of a ring. The tactic is implemented using a reflexive technique, which
563 means that the reduction trace is not stored in the proof-object itself:
564 the type-checker is able to perform the reduction on-the-fly thanks to
565 the conversion rules of the system. As a consequence, in the library there
566 must be stored both the algorithm used for the reduction and the proof of
567 correctness of the algorithm, based on the ring axioms. This big proof
568 and all of its lemmas must be retrieved and loaded in order to apply the
569 tactic. The Ring tutor loads and cache all the required theorems the
570 first time it is contacted.
571 \item{Intelligent Tutors}. Expert users can already benefit from the previous
572 class of tutors. Nevertheless, to achieve a significative production gain,
573 they need more intelligent tutors implementing domain-specific theorem
574 provers or able to perform complex computations. These tutors are not just
575 plain implementations of tactics or decision procedures, but can be
576 more complex software agents interacting with third-parties software,
577 such as proof-planners, CAS or theorem-provers.
579 To test the productivity impact of intelligent tutors, we have implemented
580 a tutor that is interfaced with the \helm{}
581 Search-Engine\footnote{\url{http://mowgli.cs.unibo.it/library.html}} and that
582 is able to look for every theorem in the distributed library that can
583 be applied to proceed in the proof. Even if the tutor deductive power
584 is extremely limited\footnote{We do not attempt to check if the new goals
585 obtained applying a lemma can be automatically proved or, even better,
586 automatically disproved to reject the lemma.}, it is not unusual for
587 the tutor to come up with precious hints that can save several minutes of
588 work that would be spent in proving again already proven results or
589 figuring out where the lemmas could have been stored in the library.
592 \section{Conclusions and Future Work}
594 In this paper we described a suggestion engine architecture for
595 proof-assistants: the client (a proof-assistant) sends the current proof
596 status to several distributed \wss{} (called tutors) that try to progress
597 in the proof and, in case of success, send back an appropriate hint
598 (a proof-plan) to the user. The user, that in the meantime was able to
599 reason and progress in the proof, is notified with the hints and can decide
600 to apply or ignore them. A broker is provided to decouple the clients and
601 the tutors and to allow the client to locate and invoke the available remote
602 services. The whole architecture is an instance of the MONET architecture
603 for Mathematical \wss{}.
605 A running prototype has been implemented as part of the
606 \helm{} project \cite{helm}
607 and we already provide several tutors. Some of them are simple tutors that
608 try to apply one or more tactics of the \helm{} Proof-Engine, which is also
609 our client. We also have a much more complex tutor that is interfaced
610 with the \helm{} Search-Engine and looks for lemmas that can be directly
613 We have many plan for further developing both the \hbugs{} architecture and
614 our prototype. Interesting results could be obtained
615 augmenting the informative content of each suggestion. We can for example
616 modify the broker so that also negative results are sent back to the client.
617 Those negative suggestions could be reflected in the user interface by
618 deactivating commands to narrow the choice of tactics available to the user.
619 This approach could be interesting especially for novice users, but require
620 the client to trust other actors a bit more than in the current approach.
622 We plan also to add some rating mechanism to the architecture. A first
623 improvement in this direction could be to distinguish between hints that, when
624 applied, are able to completely close one or more goals and
625 tactics that progress in the proof by reducing one or more goals to new goals:
626 the new goals could be false and the proof can be closed only by backtracking.
628 Other heuristics and/or measures could be added to rate
629 hints and show them to the user in a particular order: an interesting one
630 could be a measure that try to minimize the size of the generated proof,
631 privileging therefore non-overkilling solutions \cite{ring}.
633 We are also considering to follow the \OmegaAnts{} path more closely adding
634 ``recursion'' to the system so that proof status resulting from the
635 application of old hints are cached somewhere and could be used as a starting
636 point for new hint searches. The approach is interesting, but it represents
637 a big shift towards automatic theorem proving: thus we must consider if it is
638 worth the effort given the increasing availability of automation in proof
639 assistants' tactics and the ongoing development of \wss{} based on
640 already existent and well developed theorem provers.
642 Even if not strictly part of the \hbugs{} architecture, the graphical user
643 interface (GUI) of our prototype needs a lot of improvement if we would like
644 it to be really usable by novices. In particular, the user is too easily
645 distracted by the tutor's hints that are ``pushed'' to her.
647 Our \wss{} still lack a real integration in the MONET architecture,
648 since we do not provide the different ontologies to describe our problems,
649 solutions, queries and services. In the short term, completing this task
650 could provide a significative feedback to the MONET consortium and would
651 enlarge the current set of available MONET actors on the Web. In the long
652 term, new more intelligent tutors could be developed on top of already
653 existent MONET \wss{}.
655 To conclude, \hbugs{} is a nice experiment meant to understand whether the
656 current \wss{} technology is mature enough to have a concrete and useful
657 impact on the daily work of users of proof-assistants. So far, only the tutor
658 that is interfaced with the \helm{} Search-Engine has effectively increased
659 the productivity of experts users. The usefulness of the tutors developed for
660 beginners, instead, need further assessment.
662 \begin{thebibliography}{01}
664 \bibitem{ws-glossary} Web Services Glossary, W3C Working Draft, 14 May 2003.\\
665 \url{http://www.w3.org/TR/ws-gloss/}
667 \bibitem{wsdlbindings} Web Services Description Language (WSDL)
668 Version 1.2: Bindings, W3C Working Draft, 24 January 2003.\\
669 \url{http://www.w3.org/TR/wsdl12-bindings/}
671 \bibitem{ws1}A. Armando, D. Zini. Interfacing Computer Algebra and
672 Deduction Systems via the Logic Broker Architecture. In Proceedings
673 of the Eighth Calculemus symphosium, St. Andrews, Scotland, 6--7 August 2000.
675 \bibitem{ws3} O. Caprotti. Symbolic Evaluator Service. Project Report of
676 the MathBrocker Project, RISC-Linz, Johannes Kepler University, Linz,
679 \bibitem{helm} A. Asperti, F. Guidi, L. Padovani, C. Sacerdoti Coen, I. Schena.
680 Mathematical Knowledge Management in HELM. In Annals of Mathematics and
681 Artificial Intelligence, 38(1): 27--46, May 2003.
683 \bibitem{omegaants1} C. Benzm\"uller, V. Sorge. O-Ants -- An Open Approach
684 at Combining Interactive and Automated Theorem Proving. In M. Kerber and
685 M. Kohlhase (eds.), Integration of Symbolic and Mechanized Reasoning, pp.
688 \bibitem{omegaants2} C. Benzm\"uller, M. Jamnik, M. Kerber, V. Sorge.
689 Agent-based Mathematical Reasoning. In A. Armando and T. Jebelean (eds.),
690 Electronic Notes in Theoretical Computer Science, (1999) 23(3), Elsevier.
692 \bibitem{omega} C. Benzm\"uller, L. Cheikhrouhou, D. Fehrer, A. Fiedler,
693 X. Huang, M. Kerber, M. Kohlhase, K. Konrad, E. Melis, A. Meier,
694 W. Schaarschmidt, J. Siekmann, V. Sorge. OMEGA: Towards a Mathematical
695 Assistant. In W. McCune (ed), Proceedings of the 14th Conference on
696 Automated Deduction (CADE-14), Springer LNAI vol. 1249, pp. 252--255,
697 Townsville, Australia, 1997.
699 \bibitem{ringboutin} S. Boutin. Using reflection to build efficient and
700 certified decision procedures. In Martin Abadi and Takahashi Ito, editors,
701 TACS'97, volume 1281. LNCS, Springer-Verlag, 1997.
703 \bibitem{MONET-Overview} The MONET Consortium, MONET Architecture Overview,
704 Public Deliverable D04 of the MONET Project.\\
705 \url{http://monet.nag.co.uk/cocoon/monet/publicsdocs/monet-overview.pdf}
707 \bibitem{mowglicic} C. Sacerdoti Coen. Exportation Module, MoWGLI Deliverable
709 \url{http://mowgli.cs.unibo.it/html\_no\_frames/deliverables/transformation/d2a.html}
711 \bibitem{ring} C. Sacerdoti Coen. Tactics in Modern Proof-Assistants: the
712 Bad Habit of Overkilling. In Supplementary Proceedings of the 14th
713 International Conference TPHOLS 2001, pp. 352--367, Edinburgh.
715 \bibitem{zack} S. Zacchiroli. \emph{Web services per il supporto alla
716 dimostrazione interattiva}, Master Thesis, University of Bologna, 2002.
718 \bibitem{ws4} J. Zimmer and L. Dennis. Inductive Theorem Proving and
719 Computer Algebra in the MathWeb Software Bus. In Proceedings of the 10th
720 CALCULEMUS Symposium 2002, 3--5 July 2002.
722 \bibitem{ws2} R. Zippel. The MathBus. In Workshop on Internet Accessible
723 Mathematical Computation at ISSAC'99, Vancouver, Canada, July 28--31, 1999.
725 \end{thebibliography}