Add isTermlistSetEqual code to compare sets that are encoded as lists.

This commit is contained in:
Cas Cremers 2011-04-26 11:49:40 +02:00
parent 8ec1908306
commit 9f60184ba7
2 changed files with 18 additions and 0 deletions

View File

@ -762,6 +762,23 @@ termlistContained (const Termlist tlbig, Termlist tlsmall)
return 1;
}
//! Check whether the element sets corresponding to two termlist are equal
/**
* Currently this is a classical two-way containment test, but probably it can be done smarter.
*/
int
isTermlistSetEqual (const Termlist tl1, const Termlist tl2)
{
if (termlistContained (tl1, tl2))
{
if (termlistContained (tl2, tl1))
{
return true;
}
}
return false;
}
//! Yield the result of f(x)
/**
* This function interpretes two termlists as the domain and range of a function,

View File

@ -71,6 +71,7 @@ Term termLocal (const Term t, Termlist fromlist, Termlist tolist);
Termlist termlistLocal (Termlist tl, const Termlist fromlist,
const Termlist tolist);
int termlistContained (const Termlist tlbig, Termlist tlsmall);
int isTermlistSetEqual (const Termlist tl1, const Termlist tl2);
Term termFunction (Termlist fromlist, Termlist tolist, Term tx);
Termlist termlistForward (Termlist tl);
int termlistOrder (Termlist tl1, Termlist tl2);