~ubuntu-branches/ubuntu/saucy/ladr/saucy

« back to all changes in this revision

Viewing changes to ladr/fpa.h.bak

  • Committer: Package Import Robot
  • Author(s): Frank Lichtenheld
  • Date: 2013-05-25 11:43:32 UTC
  • mfrom: (5.1.5 sid)
  • Revision ID: package-import@ubuntu.com-20130525114332-lkzco1dti2hwrf7v
Tags: 0.0.200911a-2
* QA upload.
* Upload to unstable.
* Change maintainer to QA group.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*  Copyright (C) 2006, 2007 William McCune
2
 
 
3
 
    This file is part of the LADR Deduction Library.
4
 
 
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,
7
 
    version 2.
8
 
 
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.
13
 
 
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.
17
 
*/
18
 
 
19
 
#ifndef TP_FPA_H
20
 
#define TP_FPA_H
21
 
 
22
 
#include "unify.h"
23
 
#include "index.h"
24
 
#include "fpalist.h"
25
 
 
26
 
/* INTRODUCTION
27
 
This package implements FPA/Path indexing for first-order terms.
28
 
It is used to retrieive terms that are likely to unify (in various
29
 
ways) with a query term.  The answers are not guaranteed to unify,
30
 
and the caller must call some kind of unification routine to
31
 
check and to construct a substitution.
32
 
<P>
33
 
The unification types are
34
 
FPA_UNIFY, FPA_INSTANCE, FPA_GENERALIZATION, FPA_VARIANT, and FPA_IDENTICAL.
35
 
Performance is very good for
36
 
FPA_INSTANCE, FPA_VARIANT, and FPA_IDENTICAL,
37
 
fair for FPA_UNIFY, and
38
 
poor for FPA_GENERALIZATION.
39
 
(Use Discrimination indexing for FPA_GENERALIZATION, e.g.,
40
 
forward demodulation and forward subsumption.)
41
 
<P>
42
 
Associative-commutative (AC) function symbols are handled
43
 
by simply ignoring all subterms of AC symbols (which can give
44
 
bad performance).
45
 
Commutative/symmetric (C) operations are handled.
46
 
*/
47
 
 
48
 
/* Public definitions */
49
 
 
50
 
/* #define FPA_DEBUG */
51
 
 
52
 
typedef struct fpa_index * Fpa_index;
53
 
typedef struct fpa_state * Fpa_state;
54
 
 
55
 
/* End of public definitions */
56
 
 
57
 
/* Public function prototypes from fpa.c */
58
 
 
59
 
void fprint_fpa_mem(FILE *fp, BOOL heading);
60
 
 
61
 
void p_fpa_mem();
62
 
 
63
 
void fprint_path(FILE *fp, Ilist p);
64
 
 
65
 
void p_path(Ilist p);
66
 
 
67
 
void fprint_fpa_index(FILE *fp, Fpa_index idx);
68
 
 
69
 
void p_fpa_index(Fpa_index idx);
70
 
 
71
 
Fpa_index fpa_init_index(int depth);
72
 
 
73
 
void fpa_update(Term t, Fpa_index idx, Indexop op);
74
 
 
75
 
void fprint_fpa_state(FILE *fp, Fpa_state q, int depth);
76
 
 
77
 
void p_fpa_state(Fpa_state q);
78
 
 
79
 
void p_fpa_query(Term t, Querytype query_type, Fpa_index idx);
80
 
 
81
 
Term fpa_next_answer(Fpa_state q);
82
 
 
83
 
Term fpa_first_answer(Term t, Context c, Querytype query_type,
84
 
                      Fpa_index idx, Fpa_state *ppos);
85
 
 
86
 
void fpa_cancel(Fpa_state q);
87
 
 
88
 
void zap_fpa_index(Fpa_index idx);
89
 
 
90
 
BOOL fpa_empty(Fpa_index idx);
91
 
 
92
 
void p_fpa_density(Fpa_index idx);
93
 
 
94
 
unsigned mega_next_calls(void);
95
 
 
96
 
#endif  /* conditional compilation of whole file */