- Added a new selector that picks goals that are local variables.

This commit is contained in:
ccremers 2004-12-29 16:05:32 +00:00
parent d425bdb850
commit 54ccd5179e
4 changed files with 75 additions and 38 deletions

View File

@ -1291,6 +1291,7 @@ termBindConsequences (Term t)
* 1: constrain level of term
* 2: key or not
* 4: consequences determination
* 8: select also single variables (that are not role variables)
*/
Binding
select_goal ()
@ -1319,8 +1320,34 @@ select_goal ()
b = (Binding) bl->data;
// Ignore singular variables
if (!b->done && !realTermVariable (deVar (b->term)))
//if (!b->done)
if (!b->done)
{
int allow;
Term gterm;
allow = 0;
gterm = deVar (b->term);
if (mode & 8)
{
// check for singular variable
if (realTermVariable (gterm))
{
// singular variable only if it is not a role name variable
allow = !gterm->roleVar;
}
else
{
// not a singular variable, allow
allow = 1;
}
}
else
{
// Normally (mode & 8 == 0) we ignore any singular variables
allow = !realTermVariable (gterm);
}
if (allow)
{
float buf_constrain;
int buf_weight;
@ -1363,6 +1390,7 @@ select_goal ()
}
}
}
}
bl = bl->next;
}
if (sys->output == PROOF)

View File

@ -704,7 +704,12 @@ roleInstanceArachne (const System sys, const Protocol protocol,
if (isTermVariable (newt))
{
// It is a protocol role name, maybe add choose?
// It is a protocol role name
// Flag this
newt->roleVar = 1;
// maybe add choose?
// Note that for anything but full type flaws, this is not an issue.
// In the POR reduction, force choose was the default. Here it is not.
if (not_read_first (rd, oldt) && sys->match == 2)

View File

@ -111,6 +111,7 @@ makeTermTuple (Term t1, Term t2)
tt = makeTerm ();
tt->type = TUPLE;
tt->stype = NULL;
tt->roleVar = 0;
TermOp1 (tt) = t1;
TermOp2 (tt) = t2;
return tt;
@ -127,6 +128,7 @@ makeTermType (const int type, const Symbol symb, const int runid)
Term term = makeTerm ();
term->type = type;
term->stype = NULL;
term->roleVar = 0;
term->subst = NULL;
TermSymb (term) = symb;
TermRunid (term) = runid;

View File

@ -27,6 +27,8 @@ struct term
//! Data Type termlist (e.g. agent or nonce)
/** Only for leaves. */
void *stype;
int roleVar; // only for leaf, arachne engine: role variable flag
//! Substitution term.
/**
* If this is non-NULL, this leaf term is apparently substituted by