updates to UDI package

This commit is contained in:
Vitor Santos Costa 2009-04-02 17:34:42 +01:00
parent cc7ff82275
commit 9e8db82391
6 changed files with 10 additions and 32 deletions

View File

@ -56,7 +56,7 @@ p_new_udi(void)
Atom udi_t;
void *info;
fprintf(stderr,"new pred babe\n");
/* fprintf(stderr,"new pred babe\n");*/
/* get the predicate from the spec, copied from cdmgr.c */
if (IsVarTerm(spec)) {
Yap_Error(INSTANTIATION_ERROR,spec,"new user index/1");

7
packages/udi/README Normal file
View File

@ -0,0 +1,7 @@
This directory contains support for user defined indexers, currently:
- RTrees
For Examples and Tests proceed as follows:
git clone git://yap.dcc.fc.up.pt/udi-examples

Binary file not shown.

View File

@ -79,9 +79,9 @@ control_t *RtreeUdiInit (Term spec,
}
}
for (i = 0; i < NARGS; i++)
/* for (i = 0; i < NARGS; i++)
printf("%d,%p\t",(*control)[i].arg,(*control)[i].tree);
printf("\n");
printf("\n"); */
return control;
}

View File

@ -1,15 +0,0 @@
:- nogc.
%% {A,B} :-
%% {A},{B}.
overlap(A,B) :-
attributes:get_all_atts(A,C),
attributes:put_att_term(A,overlap(C,B)).
:- udi(rect(+,-)).
rect([0,0,2,2],1).
rect([5,5,7,7],2).
rect([8, 5, 9, 6],3).
rect([7, 1, 9, 2],4).
%:- overlap(R,[6, 4, 10, 6]), rect(R,ID).

View File

@ -1,14 +0,0 @@
:- nogc.
overlap(A,B) :-
attributes:get_all_atts(A,C),
attributes:put_att_term(A,overlap(C,B)).
:- udi(rect(-,+)).
:- ['roads.yap'].
r(ID1,ID2) :-
rect(ID1,R1),
overlap(R2,R1),
rect(ID2,R2).