39348
|
1 |
(* ========================================================================= *)
|
|
2 |
(* NORMALIZING FORMULAS *)
|
72004
|
3 |
(* Copyright (c) 2001 Joe Leslie-Hurd, distributed under the BSD License *)
|
39348
|
4 |
(* ========================================================================= *)
|
|
5 |
|
|
6 |
signature Normalize =
|
|
7 |
sig
|
|
8 |
|
|
9 |
(* ------------------------------------------------------------------------- *)
|
|
10 |
(* Negation normal form. *)
|
|
11 |
(* ------------------------------------------------------------------------- *)
|
|
12 |
|
|
13 |
val nnf : Formula.formula -> Formula.formula
|
|
14 |
|
|
15 |
(* ------------------------------------------------------------------------- *)
|
|
16 |
(* Conjunctive normal form derivations. *)
|
|
17 |
(* ------------------------------------------------------------------------- *)
|
|
18 |
|
|
19 |
type thm
|
|
20 |
|
|
21 |
datatype inference =
|
|
22 |
Axiom of Formula.formula
|
|
23 |
| Definition of string * Formula.formula
|
|
24 |
| Simplify of thm * thm list
|
|
25 |
| Conjunct of thm
|
|
26 |
| Specialize of thm
|
|
27 |
| Skolemize of thm
|
|
28 |
| Clausify of thm
|
|
29 |
|
|
30 |
val mkAxiom : Formula.formula -> thm
|
|
31 |
|
|
32 |
val destThm : thm -> Formula.formula * inference
|
|
33 |
|
|
34 |
val proveThms :
|
|
35 |
thm list -> (Formula.formula * inference * Formula.formula list) list
|
|
36 |
|
|
37 |
val toStringInference : inference -> string
|
|
38 |
|
|
39 |
val ppInference : inference Print.pp
|
|
40 |
|
|
41 |
(* ------------------------------------------------------------------------- *)
|
|
42 |
(* Conjunctive normal form. *)
|
|
43 |
(* ------------------------------------------------------------------------- *)
|
|
44 |
|
|
45 |
type cnf
|
|
46 |
|
|
47 |
val initialCnf : cnf
|
|
48 |
|
|
49 |
val addCnf : thm -> cnf -> (Thm.clause * thm) list * cnf
|
|
50 |
|
|
51 |
val proveCnf : thm list -> (Thm.clause * thm) list
|
|
52 |
|
|
53 |
val cnf : Formula.formula -> Thm.clause list
|
|
54 |
|
|
55 |
end
|