LeoPARD (Leo’s Parallel ARchitecture and Datastructures) is designed as a generic system platform for implementing higher-order (HO) logic based knowledge representation, and reasoning tools. In particular, LeoPARD provides the base layer of the new HO automated theorem prover (ATP) Leo-III, the successor of the well known provers LEO-I  and LEO-II .
Previous experiments with LEO-I and the OAnts mechanism  indicate a flexible, multi-agent blackboard architecture is well-suited for automating HO logic . However, (due to project constraints) such an approach has not been realized in LEO-II. Instead, the focus has been on the proof search layer in combination with a simple, sequential collaboration with an external first-order (FO) ATP. LEO-II also provides improved term data structures, term indexing, and term sharing mechanisms, which unfortunately have not been optimally exploited at the clause and the proof search layer. For the development of Leo-III the philosophy therefore has been to allocate sufficient resources for the initial development of a flexible and reusable system platform. The goal has been to bundle, improve, and extend the features with the highest potential of the predecessor systems LEO-I, LEO-II and OAnts.
The result of this initiative is LeoPARD111LeoPARD can be download at: https://github.com/cbenzmueller/LeoPARD.git., which is written in Scala and currently consists of approx. 13000 lines of code. LeoPARD combines a sophisticated data structure layer  (polymorphically typed -calculus with nameless spine notation, explicit substitutions, and perfect term sharing), with a multi-agent blackboard architecture  (supporting prover parallelism at the term, clause, and search level) and further tools including a parser for all TPTP [22, 23] syntax dialects, generic support for interfacing with external reasoners, and a command line interpreter. Such a combination of features and support tools is, up to the authors knowledge, not matched in related HO reasoning frameworks.
The intended users of the LeoPARD package are implementors of HO knowledge representation and reasoning systems, including novel ATPs and model finders. In addition, we advocate the system as a platform for the integration and coordination of heterogeneous (external) reasoning tools.
2 Term Data Structure
Data structure choices are a critical part of a theorem prover and permit reliable increases of overall performance when implemented and exploited properly. Key aspects for efficient theorem proving have been an intensive research topic and have reached maturity within FO-ATPs [19, 20]
. Naturally, one would expect an even higher impact of the data structure choices in HO-ATPs. However, in the latter context, comparably little effort has been invested yet – probably also because of the inherently more complex nature of HO logic.
The LeoPARD term language extends the simply typed -calculus with parametric polymorphism, yielding the second-order polymorphically typed -calculus (corresponding to 2 in Barendregt’s -cube ). In particular, the system under consideration was independently developed by Reynolds  and Girard  and is commonly called System F today. Further extensions, for example to admit dependent types, are future work.
Thus, LeoPARD supports the following type and term language:
An example term of this language is:
Internally, LeoPARD employs a locally nameless representation (both at the type and term level), that extends de-Bruijn indices to (bound) type variables . The definition of de-Bruijn indices  for type variables is analogous to the one for term variables. Thus, the above example term is represented namelessly as
where de-Bruijn indices for type variables are underlined.
Spine Notation and Explicit Substitutions.
On top of nameless terms, LeoPARD employs spine notation  and explicit substitutions . The first technique allows quick head symbol queries, and efficient left-to-right traversal, e.g. for unification algorithms. The latter augments the calculus with substitution closures that admit efficient (partial) -normalization runs. Internally, the above example reads
where combines function heads to argument lists (spines) in which denotes concatenation of arguments.
Terms are perfectly shared within LeoPARD, meaning that each term is only constructed once and then reused between different occurrences. This does not only reduce memory consumption in large knowledge bases, but also allows constant-time term comparison for syntactic equality using the term’s pointer to its unique physical representation. For fast (sub-)term retrieval based on syntactical criteria (e.g. head symbols, subterm occurrences, etc.) from the term indexing mechanism, terms are kept in -normal -long form.
Suite of Normalization Strategies.
comes with a number of different (heuristic)-normalization strategies that adjust the standard leftmost-outermost strategy with different combinations of strict and lazy substitution composition resp. normalization and closure construction. -normalization is invariant wrt. -normalization of spine terms and hence -normalization (to long form) is applied only once for each freshly created term.
Evaluation and Findings.
A recent empirical evaluation  has shown that there is no single best reduction strategy
for HO-ATPs. More precisely, for different TPTP problem categories this study identified different best reduction strategies. This motivates future work in which machine learning techniques could be used to suggest suitable strategies.
3 Multi-agent Blackboard Architecture
In addition to supporting classical, sequential theorem proving procedures, LeoPARD offers means for breaking the global ATP loop down into a set of subtasks that can be computed in parallel. This also includes support for subprover parallelism as successfully employed, for example, in Isabelle/HOL’s Sledgehammer tool . More generally, LeoPARD is construed to enable parallalism at various levels inside an ATP, including the term, clause, and search level . For this, LeoPARD provides a flexible multi-agent blackboard architecture.
Process communication in LeoPARD is realized indirectly via a blackboard architecture . The LeoPARD blackboard  is a collection of globally shared and accessible data structures which any process, i.e. agent, can query and manipulate at any time in parallel. From the blackboard’s perspective each process is a specialist responsible for exactly one kind of problem. The blackboard is generic in the data structures, i.e. it allows the programmer to add various kinds data structures for any kind of data. Insertion into the data structures is handled by the blackboard. Hence, each specialist can indeed by specialized on a single data structure.
The LeoPARD blackboard mechanism and associated data structures provide specific support for nested and-or search trees, meaning that sets of formulae can be split into (nested) and-or contexts. Moreover, for each supercontext respective TPTP SZS status  information is automatically inferred from the statuses of its subcontexts.
The perception of LeoPARD agents is trigger-based, meaning that each agent is notified by a change in the blackboard. LeoPARD agents are to be seen as homomorphisms on the blackboard data together with a filter when to apply an action. Depending on the perceived change of the resp. state of the blackboard an agent decides on an action it wants to execute.
Action execution in LeoPARD is coordinated by an auction based scheduler, which implements an own approximation algorithm  for combinatorical auctions . More precisely, each LeoPARD agent computes and places a bid for the execution of its action(s). The auction based scheduler then tries to maximize the global benefit of the particular set of actions to choose.
This selection mechanism works uniformly for all agents that can be implemented in LeoPARD. Balancing the value of the actions is therefore crucial for the performance and the termination of the overall system. A possible generic solution for the agents bidding is to apply machine learning techniques to optimize the bids for the best overall performance. This is future work.
Note that the use of advanced agent technology in LeoPARD is optional. A traditional ATP can still be implemented, for example, as a single, sequential reasoner instantiating exactly one agent in the LeoPARD framework.
Agent Implementation Examples.
For illustration purposes, some agent implementations have been exemplarily included in the LeoPARD package. For example, simple agents for simplification, skolemization, prenex-form, negation-normal-form and paramodulation are provided. Moreover, the agent-based integration of external ATPs is demonstrated and their parallelization is enabled by the LeoPARD agent framework. This includes agents embodying LEO-II and Satallax  running remotely on the SystemOnTPTP  servers in Miami. These example agents can be easily adapted for other TPTP compliant ATPs.
Each example agent comes with an applicability filter, an action definition and an auction value computation. The provided agents suffice to illustrate the working principles of the LeoPARD multi-agent blackboard architecture to interested implementors. After the official release of Leo-III, further, more sophisticated agents will be included and offered for academic reuse.
4 Other Components
The LeoPARD framework provides useful further components. For example, a generic parser is provided that supports all TPTP syntax dialects. Moreover, a command line interpreter supports fine grained interaction with the system. This is useful not only for debugging but also for training and demonstration purposes. As pointed at above, useful support is also provided for the integration of external reasoners based on the TPTP infrastructure. This also includes comprehensive support for the TPTP SZS result ontology. Moreover, ongoing and future work aims at generic means for the transformation and integration of (external) proof protocols, ideally by exploiting results of projects such as ProofCert222See https://team.inria.fr/parsifal/proofcert/.
5 Related work
There is comparably little related work to LeoPARD, since higher-order theorem provers typically implement their own data structures. Related systems (mostly concerning term representation) include Prolog and Teyjus , the Abella interactive theorem prover , and the logical framework Twelf .
We thank the reviewers for their valuable feedback. Moreover, we thank Tomer Libal and the students of the Leo-III project for their contributions to LeoPARD.
-  M. Abadi, L. Cardelli, P.-L. Curien, and J.-J. Levy. Explicit substitutions. In Proc. of the 17th ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, POPL ’90, pages 31–46, New York, NY, USA, 1990. ACM.
-  K.J. Arrow. Social Choice and Individual Values. Wiley, New York, 1951.
-  H. P. Barendregt. Introduction to Generalized Type Systems.. In J. of Functional Programming, 1(2):125–154, 1991.
-  C. Benzmüller and M. Kohlhase. LEO – A Higher-Order Theorem Prover. In Proc. of CADE-15, number 1421 in LNCS, pages 139–143. Springer, 1998.
C. Benzmüller and V. Sorge.
OANTS – Combining Interactive and Automated Theorem Proving.
In M. Kerber and M. Kohlhase, editors,
Symbolic Computation and Automated Reasoning, pages 81–97. A.K.Peters, 2001.
-  C. Benzmüller, V. Sorge, M. Jamnik, and M. Kerber. Combined Reasoning by Automated Cooperation. J. of Applied Logic, 6(3):318–342, 2008.
-  C. Benzmüller, F. Theiss, L. Paulson, and A. Fietzke. LEO-II - A Cooperative Automatic Theorem Prover for Higher-Order Logic (system description). In Proc. of IJCAR 2008, volume 5195 of LNCS, pages 162–170. Springer, 2008.
-  J. Blanchette, S. Böhme, and L. Paulson. Extending Sledgehammer with SMT Solvers. Journal of Automated Reasoning, 51(1):109–128, 2013.
A Taxonomy of Parallel Strategies for Deduction.
Annals of Mathematics and Artificial Intelligence, 29(1–4):223–257, 2000.
-  C.E. Brown. Satallax: An Automatic Higher-Order Prover. In Automated Reasoning, volume 7364 of LNCS, pages 111–117. Springer Berlin Heidelberg, 2012.
-  N.G. De Bruijn. Lambda calculus notation with nameless dummies, a tool for automatic formula manipulation, with application to the Church-Rosser theorem. INDAG. MATH, 34:381–392, 1972.
-  I. Cervesato and F. Pfenning. A linear spine calculus. J. Logic and Computation, 13(5):639–688, 2003.
-  A. Gacek. The Abella interactive theorem prover (system description). In Proc. Automated Reasoning, IJCAR 2008, Sydney, Australia. pp. 154–161 (2008)
-  J.Y. Girard. Interprétation fonctionnelle et élimination des coupures de l’arithmétique d’ordre supérieur. PhD thesis, Paris VII, 1972.
-  A. J. Kfoury, S. Ronchi Della Rocca, J. Tiuryn, and P. Urzyczyn. Alpha-conversion and typability. Inf. Comput., 150(1):1–21, 1999.
-  J. C. Reynolds. Towards a theory of type structure. In Symposium on Programming, volume 19 of LNCS, pages 408–423. Springer, 1974.
-  C. Liang, D. Mitchell. System Description: Teyjus - A Compiler and Abstract Machine Based Implementation of Prolog. In Automated Deduction CADE-16, LNCS, vol. 1632, pp. 287–291. Springer Berlin Heidelberg (1999)
-  F. Pfenning, C. Schürmann. System description: Twelf — A Meta-Logical Framework for Deductive Systems. In Automated Deduction, CADE-16, Trento, Italy, July 7-10, 1999, Proceedings. pp. 202–206 (1999)
-  A. Riazanov. Implementing an efficient theorem prover. PhD thesis, University of Manchester, 2003.
-  R. Sekar, I. V. Ramakrishnan, and A. Voronkov. Term Indexing. In Handbook of Automated Reasoning, pages 1853–1964. Elsevier Science Publishers B. V., Amsterdam, The Netherlands, 2001.
-  A. Steen. Efficient Data Structures for Automated Theorem Proving in Expressive Higher-Order Logics. Master’s thesis, Freie Universität Berlin, 2014. http://userpage.fu-berlin.de/$∼$lex/drop/steen_datastructures.pdf.
-  G. Sutcliffe. The TPTP Problem Library and Associated Infrastructure. J. Automated Reasoning, 43(4):337–362, 2009.
-  G. Sutcliffe and C. Benzmüller. Automated Reasoning in Higher-Order Logic using the TPTP THF Infrastructure. J. Formalized Reasoning, 3(1):1–27, 2010.
-  Gerhard Weiss, editor. Multiagent Systems. MIT Press, 2013.
-  M. Wisniewski. Agent-based Blackboard Architecture for a Higher-Order Theorem Prover. Master’s thesis, Freie Universität Berlin, 2014. http://userpage.fu-berlin.de/$∼$lex/drop/wisniewski_architecture.pdf.