This repository has been archived on 2023-08-20. You can view files and clone it, but cannot push or open issues or pull requests.
yap-6.3/packages/cuda/test.yap
Vítor Santos Costa 490b7cd40a small fixes
2013-10-07 18:34:29 +01:00

45 lines
715 B
Prolog

:- use_module(library(cuda)).
:- use_module(library(lists)).
:- initialization(main).
main :-
Rule = ( db(Y, Z), db(X, Z), db(1, Z), X = Y ),
setof(a(X,Y), Z^Rule, L0), reverse(L0, RL0), writeln(RL0),
cuda_rule((a(X, Y) :- Rule ), Q),
cuda_eval(Q, L),
cuda_erase( Q ),
writeln(L).
main2 :-
Rule = ( db(Y, Z), db(X, Z), db(1, Z), X \= Y ),
setof(a(X,Y), Z^Rule, L0), reverse(L0, RL0), writeln(RL0),
cuda_rule((a(X, Y) :- Rule ), Q),
cuda_eval(Q, L),
cuda_erase( Q ),
writeln(L).
db(1,a).
db(2,a).
db(5,b).
db(4,q).
db(6,w).
db(10,s).
/*
db(11,a).
db(12,a).
db(15,b).
db(14,q).
db(16,w).
db(110,s).
db(21,a).
db(22,a).
db(25,b).
db(24,q).
db(26,w).
db(210,s).
*/
:- cuda_extensional(db/2, _X).