<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd"> <HTML> <HEAD> <META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> <META name="GENERATOR" content="hevea 1.06-7 of 2001-11-14"> <TITLE> FD variable information </TITLE> </HEAD> <BODY TEXT=black BGCOLOR=white> <A HREF="manual058.html"><IMG SRC ="previous_motif.gif" ALT="Previous"></A> <A HREF="manual054.html"><IMG SRC ="contents_motif.gif" ALT="Contents"></A> <A HREF="manual060.html"><IMG SRC ="next_motif.gif" ALT="Next"></A> <HR> <TABLE CELLPADDING=0 CELLSPACING=0 WIDTH="100%"> <TR><TD BGCOLOR="#66dbff"><DIV ALIGN=center><TABLE> <TR><TD><FONT SIZE=4><B><A NAME="htoc318">8.5</A></B></FONT></TD> <TD WIDTH="100%" ALIGN=center><FONT SIZE=4><B>FD variable information</B></FONT></TD> </TR></TABLE></DIV></TD> </TR></TABLE><UL> <LI><A HREF="manual059.html#toc261"> <TT>fd_min/2</TT>, <TT>fd_max/2</TT>, <TT>fd_size/2</TT>, <TT>fd_dom/2</TT></A> <LI><A HREF="manual059.html#toc262"> <TT>fd_has_extra_cstr/1</TT>, <TT>fd_has_vector/1</TT>, <TT>fd_use_vector/1</TT></A> </UL> These predicate allow the user to get some information about FD variables. They are not constraints, they only return the current state of a variable.<BR> <BR> <A NAME="toc261"></A><TABLE CELLPADDING=0 CELLSPACING=0 WIDTH="100%"> <TR><TD BGCOLOR="#98e7ff"><DIV ALIGN=center><TABLE> <TR><TD><B><A NAME="htoc319">8.5.1</A></B></TD> <TD WIDTH="100%" ALIGN=center><B><TT>fd_min/2</TT>, <TT>fd_max/2</TT>, <TT>fd_size/2</TT>, <TT>fd_dom/2</TT></B></TD> </TR></TABLE></DIV></TD> </TR></TABLE> <BR> <B>Templates</B> <DL COMPACT=compact><DT><DD><TT> fd_min(+fd_variable, ?integer)<BR> fd_max(+fd_variable, ?integer)<BR> fd_size(+fd_variable, ?integer)<BR> fd_dom(+fd_variable, ?integer_list)</TT></DL> <B>Description</B><BR> <BR> <TT>fd_min(X, N)</TT> succeeds if <TT>N</TT> is the minimal value of the current domain of <TT>X</TT>.<BR> <BR> <TT>fd_max(X, N)</TT> succeeds if <TT>N</TT> is the maximal value of the current domain of <TT>X</TT>.<BR> <BR> <TT>fd_size(X, N)</TT> succeeds if <TT>N</TT> is the number of elements of the current domain of <TT>X</TT>.<BR> <BR> <TT>fd_dom(X, Values)</TT> succeeds if <TT>Values</TT> is the list of values of the current domain of <TT>X</TT>.<BR> <BR> <B>Errors</B><BR> <TABLE CELLSPACING=2 CELLPADDING=0> <TR><TD BGCOLOR=black COLSPAN=3><TABLE BORDER=0 WIDTH="100%" CELLSPACING=0 CELLPADDING=1><TR><TD></TD></TR></TABLE></TD> </TR> <TR><TD VALIGN=top ALIGN=left><TT>X</TT> is a variable</TD> <TD VALIGN=top ALIGN=center NOWRAP> </TD> <TD VALIGN=top ALIGN=left><TT>instantiation_error</TT></TD> </TR> <TR><TD BGCOLOR=black COLSPAN=3><TABLE BORDER=0 WIDTH="100%" CELLSPACING=0 CELLPADDING=1><TR><TD></TD></TR></TABLE></TD> </TR> <TR><TD VALIGN=top ALIGN=left><TT>X</TT> is neither an FD variable nor an integer</TD> <TD VALIGN=top ALIGN=center NOWRAP> </TD> <TD VALIGN=top ALIGN=left><TT>type_error(fd_variable, X)</TT></TD> </TR> <TR><TD BGCOLOR=black COLSPAN=3><TABLE BORDER=0 WIDTH="100%" CELLSPACING=0 CELLPADDING=1><TR><TD></TD></TR></TABLE></TD> </TR> <TR><TD VALIGN=top ALIGN=left><TT>N</TT> is neither a variable nor an integer</TD> <TD VALIGN=top ALIGN=center NOWRAP> </TD> <TD VALIGN=top ALIGN=left><TT>type_error(integer, N)</TT></TD> </TR> <TR><TD BGCOLOR=black COLSPAN=3><TABLE BORDER=0 WIDTH="100%" CELLSPACING=0 CELLPADDING=1><TR><TD></TD></TR></TABLE></TD> </TR> <TR><TD VALIGN=top ALIGN=left>an element <TT>E</TT> of the <TT>Vars</TT> list is neither a variable nor an FD variable nor an integer</TD> <TD VALIGN=top ALIGN=center NOWRAP> </TD> <TD VALIGN=top ALIGN=left><TT>type_error(fd_variable, E)</TT></TD> </TR> <TR><TD BGCOLOR=black COLSPAN=3><TABLE BORDER=0 WIDTH="100%" CELLSPACING=0 CELLPADDING=1><TR><TD></TD></TR></TABLE></TD> </TR> <TR><TD VALIGN=top ALIGN=left><TT>Values</TT> is neither a partial list nor a list</TD> <TD VALIGN=top ALIGN=center NOWRAP> </TD> <TD VALIGN=top ALIGN=left><TT>type_error(list, Values)</TT></TD> </TR> <TR><TD BGCOLOR=black COLSPAN=3><TABLE BORDER=0 WIDTH="100%" CELLSPACING=0 CELLPADDING=1><TR><TD></TD></TR></TABLE></TD> </TR></TABLE><BR> <B>Portability</B><BR> <BR> GNU Prolog predicate.<BR> <BR> <A NAME="toc262"></A><TABLE CELLPADDING=0 CELLSPACING=0 WIDTH="100%"> <TR><TD BGCOLOR="#98e7ff"><DIV ALIGN=center><TABLE> <TR><TD><B><A NAME="htoc320">8.5.2</A></B></TD> <TD WIDTH="100%" ALIGN=center><B><TT>fd_has_extra_cstr/1</TT>, <TT>fd_has_vector/1</TT>, <TT>fd_use_vector/1</TT></B></TD> </TR></TABLE></DIV></TD> </TR></TABLE> <BR> <B>Templates</B> <DL COMPACT=compact><DT><DD><TT> fd_has_extra_cstr(+fd_variable)<BR> fd_has_vector(+fd_variable)<BR> fd_use_vector(+fd_variable)</TT></DL> <B>Description</B><BR> <BR> <TT>fd_has_extra_cstr(X)</TT> succeeds if the <TT>extra_cstr</TT> of <TT>X</TT> is currently on (section <A HREF="manual055.html#Intro-FD">8.1</A>).<BR> <BR> <TT>fd_has_vector(X)</TT> succeeds if the current domain of <TT>X</TT> uses a sparse representation (section <A HREF="manual055.html#Intro-FD">8.1</A>).<BR> <BR> <TT>fd_use_vector(X)</TT> enforces a sparse representation for the domain of <TT>X</TT> (section <A HREF="manual055.html#Intro-FD">8.1</A>).<BR> <BR> <B>Errors</B><BR> <TABLE CELLSPACING=2 CELLPADDING=0> <TR><TD BGCOLOR=black COLSPAN=3><TABLE BORDER=0 WIDTH="100%" CELLSPACING=0 CELLPADDING=1><TR><TD></TD></TR></TABLE></TD> </TR> <TR><TD VALIGN=top ALIGN=left><TT>X</TT> is a variable</TD> <TD VALIGN=top ALIGN=center NOWRAP> </TD> <TD VALIGN=top ALIGN=left><TT>instantiation_error</TT></TD> </TR> <TR><TD BGCOLOR=black COLSPAN=3><TABLE BORDER=0 WIDTH="100%" CELLSPACING=0 CELLPADDING=1><TR><TD></TD></TR></TABLE></TD> </TR> <TR><TD VALIGN=top ALIGN=left><TT>X</TT> is neither an FD variable nor an integer</TD> <TD VALIGN=top ALIGN=center NOWRAP> </TD> <TD VALIGN=top ALIGN=left><TT>type_error(fd_variable, X)</TT></TD> </TR> <TR><TD BGCOLOR=black COLSPAN=3><TABLE BORDER=0 WIDTH="100%" CELLSPACING=0 CELLPADDING=1><TR><TD></TD></TR></TABLE></TD> </TR></TABLE><BR> <B>Portability</B><BR> <BR> GNU Prolog predicates.<BR> <BR> <HR SIZE=2> Copyright (C) 1999-2002 Daniel Diaz <BR> <BR> Verbatim copying and distribution of this entire article is permitted in any medium, provided this notice is preserved. <BR> <BR> <A HREF="index.html#copyright">More about the copyright</A> <HR> <A HREF="manual058.html"><IMG SRC ="previous_motif.gif" ALT="Previous"></A> <A HREF="manual054.html"><IMG SRC ="contents_motif.gif" ALT="Contents"></A> <A HREF="manual060.html"><IMG SRC ="next_motif.gif" ALT="Next"></A> </BODY> </HTML>