1
/* Copyright (C) 2006, 2007 William McCune
3
This file is part of the LADR Deduction Library.
5
The LADR Deduction Library is free software; you can redistribute it
6
and/or modify it under the terms of the GNU General Public License,
9
The LADR Deduction Library is distributed in the hope that it will be
10
useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
11
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
GNU General Public License for more details.
14
You should have received a copy of the GNU General Public License
15
along with the LADR Deduction Library; if not, write to the Free Software
16
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
27
This is a simple package that can be used when you need a pair
28
of indexes (Mindexes), one for positive literals, and one for negative
29
literals. The name Lindex means "literal index".
31
When you allocate the Lindex (lindex_init()), you
32
specify the parameters as you would for two separate Mindexes.
33
When you insert into or delete from the Lindex, you give a clause,
34
and each literal of the clause is indexed: positive literals
35
go into the positive component of the Lindex, and negative literals
36
go into the negative component.
38
There are no retrieval operations in this package. Instead, use
39
the retrieval operations from the Mindex package on the appropriate
40
member (positive or negative) of the pair.
42
See the package "mindex" for information on the initialization
43
parameters and retrieval operations.
46
/* Public definitions */
48
typedef struct lindex * Lindex;
51
Mindex pos; /* index for positive literals */
52
Mindex neg; /* index for negative literals */
53
Lindex next; /* for avail list */
56
/* End of public definitions */
58
/* Public function prototypes from lindex.c */
60
void fprint_lindex_mem(FILE *fp, BOOL heading);
64
Lindex lindex_init(Mindextype pos_mtype, Uniftype pos_utype, int pos_fpa_depth,
65
Mindextype neg_mtype, Uniftype neg_utype, int neg_fpa_depth);
67
void lindex_destroy(Lindex ldx);
69
void lindex_update(Lindex ldx, Topform c, Indexop op);
71
void lindex_update_first(Lindex ldx, Topform c, Indexop op);
73
BOOL lindex_empty(Lindex idx);
75
BOOL lindex_backtrack(Lindex idx);
77
#endif /* conditional compilation of whole file */