Specification and Integration of Theorem Provers and Computer Algebra Systems P.G. Bertoli1 , J. Calmet2 , F. Giunchiglia3 , and K. Homann4 1
[email protected] - ITC-IRST - Trento (Italy)
[email protected] - University of Karlsruhe (Germany)
[email protected] - ITC-IRST - Trento and DISA - University of Trento (Italy)
[email protected] - Siemens Corporation - Munich (Germany) 2
3 4
Abstract. Computer algebra systems (CASs) and automated theorem provers (ATPs) exhibit complementary abilities. CASs focus on efficiently solving domain-specific problems. ATPs are designed to allow for the formalization and solution of wide classes of problems within some logical framework. Integrating CASs and ATPs allows for the solution of problems of a higher complexity than those confronted by each class alone. However, most experiments conducted so far followed an ad-hoc approach, resulting in tailored solutions to specific problems. A structured and principled approach is necessary to allow for the sound integration of systems in a modular way. The Open Mechanized Reasoning Systems (OMRS) framework was introduced for the specification and implementation of mechanized reasoning systems, e.g. ATPs. The approach was recasted to the domain of computer algebra systems. In this paper, we introduce a generalization of OMRS, named OMSCS (Open Mechanized Symbolic Computation Systems). We show how OMSCS can be used to soundly express CASs, ATPs, and their integration, by formalizing a combination between the Isabelle prover and the Maple algebra system. We show how the integrated system solves a problem which could not be tackled by each single system alone. Topics: Integration of Logical Reasoning and Computer Algebra, Computer Algebra Systems and Automated Theorem Provers. Keywords: Computer Algebra Systems, Theorem Provers, Integration, Formal Frameworks.
1
Introduction
Automated theorem provers (ATPs) are used in the formal verification and validation of systems, protocols, and mathematical statements. These systems are complex software packages, designed in a stand-alone way, and each implementing a certain fixed logic which must be adopted to formalize and solve problems. Computer Algebra Systems (CASs) have become a standard support tool for performing complex computations, or for representing functions. Similarly to Jacques Calmet and Jan Plaza (Eds.): AISC’98, LNAI 1476, pp. 94–106, 1998. c Springer-Verlag Berlin Heidelberg 1998
Specification and Integration of Theorem Provers
95
ATPs, these tools have been designed in a stand-alone way, and implement customary syntaxes; the user may only perceive them as black boxes, and is forced to trust them “blindly”. ATPs and CASs exploit complementary abilities. ATPs implement heuristic search procedures; their underlying logics are designed to express wide varieties of problems. CASs can be perceived as extensive libraries of very complex and efficient procedures, tailored to the solution of specific problems within specific domains. Thus, by coupling the efficiency of CASs and the generality of ATPs, it should be possible to obtain systems which are able to solve problems of a higher complexity than those that have been confronted with by stand-alone CASs and ATPs. Several approaches can be followed to combine these two paradigms, e.g. integrating external algorithms into proof structures as oracles or untrusted steps, or extending CASs by reasoning components. These approaches have led to design and implement several integrations between ATPs and CASs. [4] reports an experiment of integration between the Isabelle prover and the Maple algebra system; [7] describes the implementation of an ATP within the Mathematica environment; [9] defines an extension of the HOL prover to reason about real numbers. However, all the previous attempts are ad-hoc solutions, tailored to solving specific problems. On the opposite, it is desirable to be able to make ATPs and CASs cooperate in a more principled and generic way. This cooperation can only be achieved by formally defining provers and algebra systems as symbolic mathematical services. By symbolic mathematical service we mean a software able to engage in useful and semantically meaningful two-way interactions with the environment. A symbolic mathematical service should be structurally organized as an open architecture able to provide services like, e.g., proving that a formula is a theorem, or computing a definite symbolic integral, and to be able, if and when necessary, to rely on similar services provided by other tools. In [8], the Open Mechanized Reasoning System (OMRS) architecture was introduced as a mean to specify and implement reasoning systems (e.g., theorem provers) as logical services. In [5], this approach has been recasted to symbolic computer algebra systems. In this paper, we show a generalization of this architecture, OMSCS (Open Mechanized Symbolic Computation Systems), which can be used to specify both ATPs and CASs, and to formally represent their integration. Section 2 summarizes the ideas which are at the base of the OMSCS architecture, and provides the formal descriptions of its components. Section 3 describes the specification of an integration between the Isabelle prover and the Maple algebra system. We highlight the synergic effects of the integration by showing how the resulting system solves a problem none of the starting systems could tackle alone. Section 4 is devoted to conclusions and future work.
2
The OMSCS Framework
In the OMRS framework, reasoning systems are presented as logical services. The specification of a service must be performed at various levels. At the lower
96
P.G. Bertoli et al.
level, it is necessary to formally define the objects involved in the service, and the basic operations upon them. E.g., for a theorem prover, one must define the kind of assertions it manipulates, and the basic inference rules that can be applied upon them. On top of this “object level”, a control level provides a means to define the implementation of the computational capabilities defined at the object level, and to combine them. The control level must include some sort of “programming language” which is used to describe a strategy in the applications of modules implementing basic operations, therefore to actually define the behaviour of the complex system implementing the service. Finally, the way the service is perceived by the environment, e.g. the naming of services and the protocols implementing them, is defined within a further level, called the interaction level. This leads to the following OMRS architectural structure: Reasoning Theory = Sequents + Rules Reasoning System = Reasoning Theory + Control Logical Service = Reasoning System + Interaction Analogously, as shown in [5], CASs can be presented as algorithmic services, based upon a definition of computation system and computation theory: Computation Theory = Objects + Algorithms Computation System = Computation Theory + Control Algorithmic Service = Computation System + Interaction In order to allow for a unified description of both classes of systems, we synthesize these definitions into that of Symbolic Mathematical Service. It is based upon definitions of symbolic entities and operations which include the previous definitions of sequents and objects, and of rules and algorithms respectively. Symbolic Computation Theory = Symbolic Entities + Operations Symbolic Computation System = Symbolic Computation Theory + Control Symbolic Mathematical Service = Symbolic Computation System + Interaction We call this architecture Open Mechanized Symbolic Computation Systems (OMSCS). The following two subsections deal with the formal description of the object and control layers. The interaction layer is the object of ongoing research. In this document, we will consider one single service, namely, asking the system to apply some computation strategy over some mathematical entity. This amounts to the possibility of asking an ATP for a proof of a conjecture, or a CAS for a computation over some algebraic structure. A naive functional perception of this service will be sufficient to our purposes. 2.1
The Object Level
Actual systems implement a variety of computation paradigms, based on a wide spectrum of classes of entities. The object level of the OMSCS framework is designed to allow for the representation of this variety of objects and behaviours. The notion of domain is extended by defining a system of symbolic entities as a
Specification and Integration of Theorem Provers
97
mean to represent the entities manipulated by a symbolic computation system, and the basic relationships governing them. A system of entities includes a set of symbolic objects, a system of symbolic instantiations and a system of symbolic constraints. Objects, constraints and instantiations are taken as primitive sorts. Objects and constraints may be schematic, to allow for the representation of schematic computations via the instantiation system. The constraint system allows for the representation of provisional computations. Thus a system of symbolic entities is a triple as follows: Esys = O is the set of symbolic objects. Csys is a constraint system , where C is a set of constraints, and |=⊆ (Pω (C )×C ) is a consequence relation on constraints. Isys is an instantiation system , where I is the set of instantiation maps (or instantiations), and _[_] is the operation for application of instantiations to objects and to constraints, that is _[_] : [O × I → O ] and _[_] : [C × I → C ]. In order to qualify as a system of symbolic entities, Esys, and more specifically |=, I , and _[_] must meet certain requirements, which can be lifted from [8]. The basic operations which can be performed over a system of symbolic entities are defined in a set-theoretic way, as relations between single entities and tuples of entities, instantiations and constraints. These relations are required to be closed w.r.t. instantiation. Namely, let Esys = be a symbolic computation system, where Csys = , Isys = . Then the set of operations Op[Esys] over Esys is defined as follows: Op[Esys] = o , o, e c > ∈ Op : ∀ι ∈ I : [ι] ∈ Op} {Op ⊆ (Pω (O ) × O × Pω (C )) ∀ SCth = represents IsThe symbolic computation theory SCthI = represents The symbolic computation theory SCthM = and SCth2 = via bridge operations Op gb with results in a new symbolic computation theory SCthg = SCN th =