We present a generic congruence closure algorithm for
deciding ground formulas in the combination of the theory of
equality with uninterpreted symbols and an arbitrary built-in
solvable theory X. Our algorithm CC(X) is reminiscent of
Shostak combination: it maintains a union-find data-structure
modulo X from which maximal information about implied
equalities can be directly used for congruence closure. CC(X)
diverges from Shostak's approach by the use of semantical
values for class representatives instead of canonized
terms. Using semantical values truly reflects the actual
implementation of the decision procedure for . It also
enforces to entirely rebuild the algorithm since global
canonization, which is at the heart of Shostak combination, is
no longer feasible with semantical values. CC(X) has been
implemented in Ocaml and is at the core of Ergo, a new
automated theorem prover dedicated to program verification.
In an attempt to improve automation capabilities in the Coq proof
assistant, we develop a tactic for the propositional fragment based
on the DPLL procedure. Although formulas naturally arising in
interactive proofs do not require a state-of-the-art SAT solver, the
conversion to clausal form required by DPLL strongly damages the
performance of the procedure. In this paper, we present a reflexive
DPLL algorithm formalized in Coq which outperforms the existing
tactics. It is tightly coupled with a lazy CNF conversion scheme
which, unlike Tseitin-style approaches, does not disrupt the
procedure. This conversion relies on a lazy mechanism which requires
slight adaptations of the original DPLL. As far as we know, this is
the first formal proof of this mechanism and its Coq implementation
raises interesting challenges.
Faire bonne figure avec Mlpost. Romain Bardou, Jean-Christophe Filliâtre, Johannes Kanig and Stéphane Lescuyer. In Vingtièmes Journées Francophones des Langages
Applicatifs (JFLA ),
Saint-Quentin-sur-Isère, France, 2009.
Cet article présente Mlpost, une bibliothèque Ocaml de dessin
scientifique. Elle s'appuie sur METAPOST, qui permet notamment
d'inclure des fragments LaTeX dans les figures. Ocaml offre une
alternative séduisante aux langages de macros LaTeX, aux langages
spécialisés ou même aux outils graphiques. En particulier,
l'utilisateur de Mlpost bénéficie de toute l'expressivité
d'Ocaml et de son typage statique. Enfin Mlpost propose un style
déclaratif qui diffèere de celui, souvent impératif, des outils existants.
A Reflexive Formalization of a SAT Solver in Coq. Stéphane Lescuyer and Sylvain Conchon. In Emerging Trends of the 21st International Conference on
Theorem Proving in Higher Order Logics (TPHOLs), 2008.
We present a Coq formalization of an algorithm deciding the
satisfiability of propositional formulas (SAT). This SAT solver
is described as a set of inference rules in a manner that
is independent of the actual representation of propositional
variables and formulas. We prove soundness and completeness for this
system, and instantiate our solver directly on the propositional
fragment of Coq's logic in order to obtain a fully reflexive tactic.
Such a tactic represents a first and important step towards our
ultimate goal of embedding an automated theorem prover inside the
Coq system. We also extract a certified OCaml implementation of
the algorithm.
Implementing Polymorphism in SMT solvers. François Bobot, Sylvain Conchon, Evelyne Contejean and Stéphane Lescuyer. In Clark
Barrett and Leonardo de Moura, editors, SMT 2008: 6th
International Workshop on Satisfiability Modulo, 2008.
Based on our experience with the
development of Alt-Ergo, we show a small number of
modifications needed to bring parametric polymorphism to our
SMT solver. The first one occurs in the typing module where
unification is now necessary for solving polymorphic
constraints over types. The second one consists in extending
triggers' definition in order to deal with both term and type
variables. Last, the matching module must be modified to
account for the instantiation of type variables. We hope that
this experience is convincing enough to raise interest for
polymorphism in the SMT community.
SAT-Micro : petit mais costaud ! Sylvain Conchon, Johannes Kanig and Stéphane Lescuyer.
In Dix-neuvièmes Journées Francophones des Langages
Applicatifs (JFLA ),
Etretat, France, 2008.
Le problème SAT, qui consiste à déterminer si une formule booléenne
est satisfaisable, est un des problèmes NP-complets les plus
célèbres et aussi un des plus étudiés. Basés initialement sur la
procédure DPLL, les SAT-solvers modernes ont connu des
progrès spectaculaires ces dix dernières années dans leurs
performances, essentiellement grâce à deux optimisations: le retour
en arrière non-chronologique et l'apprentissage par analyse des
clauses conflits. Nous proposons dans cet article une étude formelle
du fonctionnement de ces techniques ainsi qu'une réalisation en OCaml
d'un SAT-solver, baptisé SAT-Micro, intégrant ces
optimisations. Le fonctionnement de SAT-Micro est décrit par un
ensemble de règles d'inférence et la taille de son code, 70 lignes
au total, permet d'envisager sa certification complète.
Ergo is a little engine of proof dedicated to program
verification. It fully supports quantifiers and directly handles
polymorphic sorts. Its core component is CC(X), a new
combination scheme for the theory of uninterpreted symbols
parameterized by a built-in theory X. In order to make a sound
integration in a proof assistant possible, Ergo is capable of
generating proof traces for CC(X). Alternatively, Ergo can also
be called interactively as a simple oracle without further
verification. It is currently used to prove correctness of C and
Java programs as part of the Why platform.
Polymorphism has become a common way of designing short and reusable
programs by abstracting generic definitions from type-specific ones.
Such a convenience is valuable in logic as well, because it unburdens
the specifier from writing redundant declarations of logical
symbols. However,
top shelf automated theorem provers (ATP), such as
Simplify, Yices or other SMT-LIB ones do not handle polymorphism. To
this end, we present
efficient reductions of polymorphism in both unsorted and many-sorted
first order logics.
For each encoding, we show that the formulas and their encoded
counterparts are logically equivalent in the context of automated
theorem proving. The efficiency keynote is to disturb the prover as
little as possible, especially the decision procedures used for
special sorts, e.g. integer linear arithmetic, to which we apply a
special treatment.
The corresponding implementations are presented in the Why/Caduceus
toolkit, used as a proof obligations generator.
Our goal is to be able to use automated provers to certify
programs. Provers often work on monomorphic or untyped logics whereas
certification involves more complicated logics. To this end, we
present an encoding of multisorted polymorphic first-order logic to
unsorted first-order logic where the typing information is encoded
directly into terms. Unlike formulae translated with the more
natural encoding based on typing predicates, formulae translated
with our encoding can be dealt with efficiently by automated theorem
provers. We show that translated formulae are logically equivalent
to their typed original counterparts, and we describe an
implementation of this encoding in the Why program certification
tool. This implementation also illustrates the issue of dealing with
provers that have built-in decision procedures, e.g. arithmetic in
Simplify. We finally present the results we obtained on certifying a
significant number of real C programs with Why and Simplify.