Shih-Hsi writes:
small :# fuzzy_predicate([(0,1),(0,1),(0.5,0),(1,0)]).
If I want to show X value in small(0.2,X) , how to solve it?
Because if I use write(X) ,then it show _xxx.
Those "fuzzy" variables get values via constraints, and the classical write and similar predicates are not able to print constraints, they only print values the variables are bound to. In this case, the variable is not bound to a value, although it might be constrained.
Getting a handle on the constraints of a variable is kind of weird. One possible solution is as follows:
:- use_module(library('clpr/clp_dump')). :- use_module(library(write),[write_list1/1]).
:- multifile dump/3.
... :- ... small(0.2,X), dump(X,X,Constraints), write_list1(Constraints), ...
You will then get printed something like:
.=.(_685,1.0)
which tells you that variable _685 is constrained to have value 1.0
Or, in other cases, you may get things like:
.>.(_685,0.62) .<.(_685,1.0)
which tells you that variable _685 is constrained to have a value in between 0.62 and 1.0.
Francisco Bueno CLIP group - CS Dept. - FIM - UPM ============================================================================== Message: Address: Action: help majordomo(a)clip.dia.fi.upm.es Info. on useful commands subscribe ciao-users-request(a)clip.dia.fi.upm.es Subscribe to this list unsubscribe ciao-users-request(a)clip.dia.fi.upm.es Unsubscribe from this list <whatever> ciao-users(a)clip.dia.fi.upm.es Send message to list ----------------------------------------------------------------------------- Archived messages: http://www.clip.dia.fi.upm.es/Mail/ciao-users/ -----------------------------------------------------------------------------