[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
negative numbers
From: |
Alexandre Saidi |
Subject: |
negative numbers |
Date: |
Tue, 27 Mar 2007 19:43:02 +0200 |
User-agent: |
Mozilla Thunderbird 1.0.2 (X11/20050317) |
Hello all,
I know that Gprolog does not handle negative intergers.
However, someone could tell me why gprolog rejects vilently this :
?- fd_domain(I,1,4), fd_element(I,[12, 5, -7,9], X).
Fatal Error: Segmentation Violation
Ok, she does not like my -7.
But with :
X #= -1.
I get just (gently)
no.
PS : the original resuest was :
?- fd_domain([S1, S2], 1, 7), S1 #=S2 +X, fd_domain(I,1,4),
fd_element(I,[-1,-2,1,2], X), fd_labeling([S1,S2]).
I'm trying to get S1 and S2 (2 days of a week) being two consecutive
days or with a difference of 2 .
An elegant way to this in gprolog (a short one is wellcome : I'm trying
to illustratre CLP power in an introduction).
Thanks.
Alex
--
Aleksander S. Saidi
Maître de Conférences
Ecole Centrale de Lyon
Département Mathématiques-Informatique
Mél : address@hidden
Tél : 04.72.18.65.30, Fax : 04.78.33.16.15
Alexandre.Saidi.vcf
Description: Vcard
- negative numbers,
Alexandre Saidi <=