Refactored first_origination code.

This commit is contained in:
Cas Cremers 2012-05-01 14:46:01 +02:00
parent 49e34e5167
commit 5608b29dc0
3 changed files with 94 additions and 92 deletions

View File

@ -516,21 +516,13 @@ unique_origination ()
}
//! Prune invalid state w.r.t. <=C minimal requirement
//! Check for first-origination points
/**
* Intuition says this can be done a lot more efficient. Luckily this is the prototype.
*
*@returns True, if it's okay. If false, it needs to be pruned.
*/
int
bindings_c_minimal ()
first_origination ()
{
if (!unique_origination ())
{
return false;
}
{
List bl;
// For all goals
@ -567,8 +559,7 @@ bindings_c_minimal ()
if (switches.intruder)
{
// intruder: interm bindings should cater for the first occurrence
occursthere =
termInTerm (rd->message, b->term);
occursthere = termInTerm (rd->message, b->term);
}
else
{
@ -611,10 +602,21 @@ bindings_c_minimal ()
}
bl = bl->next;
}
}
return true;
}
//! Determine if pattern is redundant or not
/**
* Intuition says this can be done a lot more efficient. Luckily this is the prototype.
*
*@returns True, if it's okay. If false, it needs to be pruned.
*/
int
non_redundant ()
{
return (unique_origination () && first_origination ());
}
//! Count the number of bindings that are done.
int
countBindingsDone ()

View File

@ -70,7 +70,7 @@ int iterate_bindings (int (*func) (Binding b));
int iterate_preceding_bindings (const int run, const int ev,
int (*func) (Binding b));
int bindings_c_minimal ();
int non_redundant ();
int countBindingsDone ();
#endif

View File

@ -355,7 +355,7 @@ so technically this is a bug. Don't use.
// Check for c-minimality
{
if (!bindings_c_minimal ())
if (!non_redundant ())
{
if (switches.output == PROOF)
{