39348
|
1 |
(* ========================================================================= *)
|
|
2 |
(* MATCHING AND UNIFICATION FOR SETS OF FIRST ORDER LOGIC LITERALS *)
|
39349
|
3 |
(* Copyright (c) 2001-2006 Joe Hurd, distributed under the BSD License *)
|
39348
|
4 |
(* ========================================================================= *)
|
|
5 |
|
|
6 |
signature LiteralNet =
|
|
7 |
sig
|
|
8 |
|
|
9 |
(* ------------------------------------------------------------------------- *)
|
|
10 |
(* A type of literal sets that can be efficiently matched and unified. *)
|
|
11 |
(* ------------------------------------------------------------------------- *)
|
|
12 |
|
|
13 |
type parameters = {fifo : bool}
|
|
14 |
|
|
15 |
type 'a literalNet
|
|
16 |
|
|
17 |
(* ------------------------------------------------------------------------- *)
|
|
18 |
(* Basic operations. *)
|
|
19 |
(* ------------------------------------------------------------------------- *)
|
|
20 |
|
|
21 |
val new : parameters -> 'a literalNet
|
|
22 |
|
|
23 |
val size : 'a literalNet -> int
|
|
24 |
|
|
25 |
val profile : 'a literalNet -> {positive : int, negative : int}
|
|
26 |
|
|
27 |
val insert : 'a literalNet -> Literal.literal * 'a -> 'a literalNet
|
|
28 |
|
|
29 |
val fromList : parameters -> (Literal.literal * 'a) list -> 'a literalNet
|
|
30 |
|
|
31 |
val filter : ('a -> bool) -> 'a literalNet -> 'a literalNet
|
|
32 |
|
|
33 |
val toString : 'a literalNet -> string
|
|
34 |
|
|
35 |
val pp : 'a Print.pp -> 'a literalNet Print.pp
|
|
36 |
|
|
37 |
(* ------------------------------------------------------------------------- *)
|
|
38 |
(* Matching and unification queries. *)
|
|
39 |
(* *)
|
|
40 |
(* These function return OVER-APPROXIMATIONS! *)
|
|
41 |
(* Filter afterwards to get the precise set of satisfying values. *)
|
|
42 |
(* ------------------------------------------------------------------------- *)
|
|
43 |
|
|
44 |
val match : 'a literalNet -> Literal.literal -> 'a list
|
|
45 |
|
|
46 |
val matched : 'a literalNet -> Literal.literal -> 'a list
|
|
47 |
|
|
48 |
val unify : 'a literalNet -> Literal.literal -> 'a list
|
|
49 |
|
|
50 |
end
|