Our logic initially has seven modules, one for each of the logical operators. Each module has an interface defined in a .mli file, and an implementation defined in a .ml file. The interface defines the syntax, and the implementation provides the rules, display, and tactics that implement the module.
First, define the interface for the false operator in the module Fol_false.
1. Create the file fol_false.mli, containing the line:
declare "false"
The declaration defines a term "false" to represent the false operator. Next, compile the interface.
2. Compile the interface:
% prlc -c fol_false.mli
This command produces two files. The fol_false.cmi file contains the ML signature, and fol_false.ml contains the logical signature for the module.
The implementation for false contains the same syntax declaration, it includes a display form, and it defines the basic rules for falsehood.
3. Create the file fol_false.ml, containing the following lines:
extends Fol_type declare "false" dform false_df : "false" = `"false" prim false_type 'H : : sequent ['ext] { 'H >- "type"{."false"} } = trivial prim false_elim 'H 'J : : sequent ['ext] { 'H; x: "false"; 'J['x] >- 'C['x] } = trivial
The extends directive establishes the dependency of the Fol_false module on the Fol_type module, which is used in the well-formedness rule false_type. The display form for false is the string literal "false." The first inference rule, false_type, declares that false is a well-formed formula, and the second rule, false_elim, states that anything can be derived from a false assumption.
The rules are declared as primitive, since they are axioms in the first-order logic. There is no computational content to either rule, and the proof terms are the trivial proof trivial.
The module defining true is similar to the false module. Try defining it yourself (the distribution contains example files in the fol directory). The Fol_true module should declare a new term for true, and it should also include an inhabitant for true called it:
declare "true" declare it
and it should define the well-formedness of the true term, and the introduction rule stating that the term true is provable.
prim true_type 'H : :
sequent ['ext] { 'H >- "type"{."true"} } = trivial
prim true_intro 'H : :
sequent ['ext] { 'H >- "true" } = it
You should also define a display form for the true term.