<!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> Term unification </TITLE> </HEAD> <BODY TEXT=black BGCOLOR=white> <A HREF="manual024.html"><IMG SRC ="previous_motif.gif" ALT="Previous"></A> <A HREF="manual023.html"><IMG SRC ="contents_motif.gif" ALT="Contents"></A> <A HREF="manual026.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="htoc68">7.2</A></B></FONT></TD> <TD WIDTH="100%" ALIGN=center><FONT SIZE=4><B>Term unification</B></FONT></TD> </TR></TABLE></DIV></TD> </TR></TABLE><UL> <LI><A HREF="manual025.html#toc45"> <TT>(=)/2</TT> - Prolog unification</A> <LI><A HREF="manual025.html#toc46"> <TT>unify_with_occurs_check/2</TT></A> <LI><A HREF="manual025.html#toc47"> <TT>(\=)/2</TT> - not Prolog unifiable</A> </UL> <BR> <A NAME="toc45"></A><TABLE CELLPADDING=0 CELLSPACING=0 WIDTH="100%"> <TR><TD BGCOLOR="#98e7ff"><DIV ALIGN=center><TABLE> <TR><TD><B><A NAME="htoc69">7.2.1</A></B></TD> <TD WIDTH="100%" ALIGN=center><B><TT>(=)/2</TT> - Prolog unification</B></TD> </TR></TABLE></DIV></TD> </TR></TABLE> <BR> <B>Templates</B> <DL COMPACT=compact><DT><DD><TT> =(?term, ?term)</TT></DL> <B>Description</B><BR> <BR> <TT>Term1 = Term2</TT> unifies <TT>Term1</TT> and <TT>Term2</TT>. No occurs check is done, i.e. this predicate does not check if a variable is unified with a compound term containing this variable (this can lead to an infinite loop).<BR> <BR> <TT>=</TT> is a predefined infix operator (section <A HREF="manual037.html#op/3:(Term-input/output)">7.14.10</A>).<BR> <BR> <B>Errors</B><BR> <BR> None.<BR> <BR> <B>Portability</B><BR> <BR> ISO predicate.<BR> <BR> <A NAME="toc46"></A><TABLE CELLPADDING=0 CELLSPACING=0 WIDTH="100%"> <TR><TD BGCOLOR="#98e7ff"><DIV ALIGN=center><TABLE> <TR><TD><B><A NAME="htoc70">7.2.2</A></B></TD> <TD WIDTH="100%" ALIGN=center><TT><B>unify_with_occurs_check/2</B></TT></TD> </TR></TABLE></DIV></TD> </TR></TABLE> <BR> <B>Templates</B> <DL COMPACT=compact><DT><DD><TT> unify_with_occurs_check(?term, ?term) </TT></DL> <B>Description</B><BR> <BR> <TT>unify_with_occurs_check(Term1, Term2)</TT> unifies <TT>Term1</TT> and <TT>Term2</TT>. The occurs check test is done (i.e. the unification fails if a variable is unified with a compound term containing this variable).<BR> <BR> <B>Errors</B><BR> <BR> None.<BR> <BR> <B>Portability</B><BR> <BR> ISO predicate.<BR> <BR> <A NAME="toc47"></A><TABLE CELLPADDING=0 CELLSPACING=0 WIDTH="100%"> <TR><TD BGCOLOR="#98e7ff"><DIV ALIGN=center><TABLE> <TR><TD><B><A NAME="htoc71">7.2.3</A></B></TD> <TD WIDTH="100%" ALIGN=center><B><TT>(\=)/2</TT> - not Prolog unifiable</B></TD> </TR></TABLE></DIV></TD> </TR></TABLE> <BR> <B>Templates</B> <DL COMPACT=compact><DT><DD><TT> \=(?term, ?term) </TT></DL> <B>Description</B><BR> <BR> <TT>Term1 \= Term2</TT> succeeds if <TT>Term1</TT> and <TT>Term2</TT> are not unifiable (no occurs check is done). <TT><BR> <BR> \=</TT> is a predefined infix operator (section <A HREF="manual037.html#op/3:(Term-input/output)">7.14.10</A>).<BR> <BR> <B>Errors</B><BR> <BR> None.<BR> <BR> <B>Portability</B><BR> <BR> ISO predicate.<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="manual024.html"><IMG SRC ="previous_motif.gif" ALT="Previous"></A> <A HREF="manual023.html"><IMG SRC ="contents_motif.gif" ALT="Contents"></A> <A HREF="manual026.html"><IMG SRC ="next_motif.gif" ALT="Next"></A> </BODY> </HTML>