Constrained Horn Clauses
   HOME

TheInfoList



OR:

Constrained Horn clauses (CHCs) are a fragment of
first-order logic First-order logic, also called predicate logic, predicate calculus, or quantificational logic, is a collection of formal systems used in mathematics, philosophy, linguistics, and computer science. First-order logic uses quantified variables over ...
with applications to program verification and
synthesis Synthesis or synthesize may refer to: Science Chemistry and biochemistry *Chemical synthesis, the execution of chemical reactions to form a more complex molecule from chemical precursors **Organic synthesis, the chemical synthesis of organi ...
. Constrained Horn clauses can be seen as a form of
constraint logic programming Constraint logic programming is a form of constraint programming, in which logic programming is extended to include concepts from constraint satisfaction. A constraint logic program is a logic program that contains constraints in the body of claus ...
.


Definition

A constrained Horn clause is a
formula In science, a formula is a concise way of expressing information symbolically, as in a mathematical formula or a ''chemical formula''. The informal use of the term ''formula'' in science refers to the general construct of a relationship betwe ...
of the form \phi\land P_1(\mathbf_1)\land \ldots\land P_n(\mathbf)\to P(\mathbf) where \phi is a ''constraint'' in some first-order theory, P_i are predicates, and \mathbf_i are universally-quantified variables. The addition of constraint makes it a generalization of the plain
Horn clause In mathematical logic and logic programming, a Horn clause is a logical formula of a particular rule-like form that gives it useful properties for use in logic programming, formal specification, universal algebra and model theory. Horn clauses are ...
.


Decidability

The satisfiability of constrained Horn clauses with constraints from linear integer arithmetic is undecidable.


Solvers

There are several automated solvers for CHCs, including the SPACER engine of Z3. CHC-COMP is an annual competition of CHC solvers. CHC-COMP has run every year since 2018.


Applications

Constrained Horn clauses are a convenient language in which to specify problems in program verification. The SeaHorn verifier for
LLVM LLVM, also called LLVM Core, is a target-independent optimizer and code generator. It can be used to develop a Compiler#Front end, frontend for any programming language and a Compiler#Back end, backend for any instruction set architecture. LLVM i ...
represents verification conditions as constrained Horn clauses, as does the JayHorn verifier for
Java Java is one of the Greater Sunda Islands in Indonesia. It is bordered by the Indian Ocean to the south and the Java Sea (a part of Pacific Ocean) to the north. With a population of 156.9 million people (including Madura) in mid 2024, proje ...
.


References

{{reflist Formal logic