Add isTermlistSetEqual code to compare sets that are encoded as lists.
This commit is contained in:
parent
8ec1908306
commit
9f60184ba7
@ -762,6 +762,23 @@ termlistContained (const Termlist tlbig, Termlist tlsmall)
|
|||||||
return 1;
|
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)
|
//! Yield the result of f(x)
|
||||||
/**
|
/**
|
||||||
* This function interpretes two termlists as the domain and range of a function,
|
* This function interpretes two termlists as the domain and range of a function,
|
||||||
|
@ -71,6 +71,7 @@ Term termLocal (const Term t, Termlist fromlist, Termlist tolist);
|
|||||||
Termlist termlistLocal (Termlist tl, const Termlist fromlist,
|
Termlist termlistLocal (Termlist tl, const Termlist fromlist,
|
||||||
const Termlist tolist);
|
const Termlist tolist);
|
||||||
int termlistContained (const Termlist tlbig, Termlist tlsmall);
|
int termlistContained (const Termlist tlbig, Termlist tlsmall);
|
||||||
|
int isTermlistSetEqual (const Termlist tl1, const Termlist tl2);
|
||||||
Term termFunction (Termlist fromlist, Termlist tolist, Term tx);
|
Term termFunction (Termlist fromlist, Termlist tolist, Term tx);
|
||||||
Termlist termlistForward (Termlist tl);
|
Termlist termlistForward (Termlist tl);
|
||||||
int termlistOrder (Termlist tl1, Termlist tl2);
|
int termlistOrder (Termlist tl1, Termlist tl2);
|
||||||
|
Loading…
Reference in New Issue
Block a user