39348
|
1 |
(* ========================================================================= *)
|
|
2 |
(* CLAUSE = ID + THEOREM *)
|
39502
|
3 |
(* Copyright (c) 2002 Joe Hurd, distributed under the BSD License *)
|
39348
|
4 |
(* ========================================================================= *)
|
|
5 |
|
|
6 |
signature Clause =
|
|
7 |
sig
|
|
8 |
|
|
9 |
(* ------------------------------------------------------------------------- *)
|
|
10 |
(* A type of clause. *)
|
|
11 |
(* ------------------------------------------------------------------------- *)
|
|
12 |
|
|
13 |
datatype literalOrder =
|
|
14 |
NoLiteralOrder
|
|
15 |
| UnsignedLiteralOrder
|
|
16 |
| PositiveLiteralOrder
|
|
17 |
|
|
18 |
type parameters =
|
|
19 |
{ordering : KnuthBendixOrder.kbo,
|
|
20 |
orderLiterals : literalOrder,
|
|
21 |
orderTerms : bool}
|
|
22 |
|
|
23 |
type clauseId = int
|
|
24 |
|
|
25 |
type clauseInfo = {parameters : parameters, id : clauseId, thm : Thm.thm}
|
|
26 |
|
|
27 |
type clause
|
|
28 |
|
|
29 |
(* ------------------------------------------------------------------------- *)
|
|
30 |
(* Basic operations. *)
|
|
31 |
(* ------------------------------------------------------------------------- *)
|
|
32 |
|
|
33 |
val default : parameters
|
|
34 |
|
|
35 |
val newId : unit -> clauseId
|
|
36 |
|
|
37 |
val mk : clauseInfo -> clause
|
|
38 |
|
|
39 |
val dest : clause -> clauseInfo
|
|
40 |
|
|
41 |
val id : clause -> clauseId
|
|
42 |
|
|
43 |
val thm : clause -> Thm.thm
|
|
44 |
|
|
45 |
val equalThms : clause -> clause -> bool
|
|
46 |
|
|
47 |
val literals : clause -> Thm.clause
|
|
48 |
|
|
49 |
val isTautology : clause -> bool
|
|
50 |
|
|
51 |
val isContradiction : clause -> bool
|
|
52 |
|
|
53 |
(* ------------------------------------------------------------------------- *)
|
|
54 |
(* The term ordering is used to cut down inferences. *)
|
|
55 |
(* ------------------------------------------------------------------------- *)
|
|
56 |
|
|
57 |
val largestLiterals : clause -> LiteralSet.set
|
|
58 |
|
|
59 |
val largestEquations :
|
|
60 |
clause -> (Literal.literal * Rewrite.orient * Term.term) list
|
|
61 |
|
|
62 |
val largestSubterms :
|
|
63 |
clause -> (Literal.literal * Term.path * Term.term) list
|
|
64 |
|
|
65 |
val allSubterms : clause -> (Literal.literal * Term.path * Term.term) list
|
|
66 |
|
|
67 |
(* ------------------------------------------------------------------------- *)
|
|
68 |
(* Subsumption. *)
|
|
69 |
(* ------------------------------------------------------------------------- *)
|
|
70 |
|
|
71 |
val subsumes : clause Subsume.subsume -> clause -> bool
|
|
72 |
|
|
73 |
(* ------------------------------------------------------------------------- *)
|
|
74 |
(* Simplifying rules: these preserve the clause id. *)
|
|
75 |
(* ------------------------------------------------------------------------- *)
|
|
76 |
|
|
77 |
val freshVars : clause -> clause
|
|
78 |
|
|
79 |
val simplify : clause -> clause option
|
|
80 |
|
|
81 |
val reduce : Units.units -> clause -> clause
|
|
82 |
|
|
83 |
val rewrite : Rewrite.rewrite -> clause -> clause
|
|
84 |
|
|
85 |
(* ------------------------------------------------------------------------- *)
|
|
86 |
(* Inference rules: these generate new clause ids. *)
|
|
87 |
(* ------------------------------------------------------------------------- *)
|
|
88 |
|
|
89 |
val factor : clause -> clause list
|
|
90 |
|
|
91 |
val resolve : clause * Literal.literal -> clause * Literal.literal -> clause
|
|
92 |
|
|
93 |
val paramodulate :
|
|
94 |
clause * Literal.literal * Rewrite.orient * Term.term ->
|
|
95 |
clause * Literal.literal * Term.path * Term.term -> clause
|
|
96 |
|
|
97 |
(* ------------------------------------------------------------------------- *)
|
|
98 |
(* Pretty printing. *)
|
|
99 |
(* ------------------------------------------------------------------------- *)
|
|
100 |
|
|
101 |
val showId : bool ref
|
|
102 |
|
|
103 |
val pp : clause Print.pp
|
|
104 |
|
|
105 |
val toString : clause -> string
|
|
106 |
|
|
107 |
end
|