users-prolog
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: A simple sample


From: Daniel Diaz
Subject: Re: A simple sample
Date: Fri, 31 Jan 2003 14:39:57 +0100
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.0.2) Gecko/20021120 Netscape/7.01

Hi,

Recall that variables in Prolog begin with a upper case. So, you have to replace out by Out, a by A and b by B....

See you

address@hidden wrote:
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])).
--
Ce message a subi une analyse antivirus par MailScanner ; il est vraisemblablement
sans danger.



------------------------------------------------------------------------

_______________________________________________
Users-prolog mailing list
address@hidden
http://mail.gnu.org/mailman/listinfo/users-prolog



--
Ce message a subi une analyse antivirus par MailScanner ; il est vraisemblablement
sans danger.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]