[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
A simple sample
From: |
address@hidden |
Subject: |
A simple sample |
Date: |
Fri, 31 Jan 2003 18:35:11 +0800 |
Hello,
I'm using GNU Prolog for my research. But there some problem with my program,
which puzzled me for a long time. Here is the source code of my program, after
compiled to executable file, the result is " user directive failed". Can anyone
help me locate the error in my program? Thanks!
q(OUTPUTS):-
get_fd_labeling(Lab),
statistics(runtime, _),
temp(Lab,INPUTS,OUTPUTS),
statistics(runtime, [_,Y]),
write(OUTPUTS), nl,
write(INPUTS), nl,
write('time: '), write(Y), nl.
/*----------- Model definition -----------*/
temp(Lab, INPUTS, OUTPUTS):-
OUTPUTS = [out],
INPUTS = [a, b],
/*---- Domains for integers ----*/
fd_domain(a, 0, 1),
fd_domain(b, 0, 1),
fd_domain(out, 0, 1),
out #<=> a #= b,
lab(Lab, INPUTS).
/*----------- End of model definition -----------*/
lab(normal,L):-
fd_labeling(L).
lab(ff,L):-
fd_labelingff(L).
get_fd_labeling(Lab):-
argument_counter(C),
get_labeling1(C,Lab).
get_labeling1(1,normal).
get_labeling1(2,Lab):-
argument_value(1,Lab).
:-initialization(q([1])).
- A simple sample,
address@hidden <=