- Added "Empty" claim type, which is ignored.

Syntax example:   claim_x(I, Empty);
This commit is contained in:
ccremers 2005-06-16 11:59:44 +00:00
parent f8a91d744d
commit db18b203a9
4 changed files with 121 additions and 96 deletions

View File

@ -36,6 +36,8 @@
extern Term CLAIM_Secret; extern Term CLAIM_Secret;
extern Term CLAIM_Nisynch; extern Term CLAIM_Nisynch;
extern Term CLAIM_Niagree; extern Term CLAIM_Niagree;
extern Term CLAIM_Empty;
extern Term TERM_Agent; extern Term TERM_Agent;
extern Term TERM_Hidden; extern Term TERM_Hidden;
extern Term TERM_Function; extern Term TERM_Function;
@ -3309,12 +3311,17 @@ arachne ()
/** /**
* Check each claim * Check each claim
*/ */
Protocol p;
Role r;
if (switches.filterClaim == NULL || switches.filterClaim == cl->type) // Skip the dummy claims
if (!isTermEqual (cl->type, CLAIM_Empty))
{
// Any other claims might be filterered
if (switches.filterClaim == NULL
|| switches.filterClaim == cl->type)
{ {
int run; int run;
Protocol p;
Role r;
sys->current_claim = cl; sys->current_claim = cl;
attack_length = INT_MAX; attack_length = INT_MAX;
@ -3342,7 +3349,8 @@ arachne ()
* Add specific goal info * Add specific goal info
*/ */
add_claim_specifics (cl, add_claim_specifics (cl,
roledef_shift (sys->runs[run].start, cl->ev)); roledef_shift (sys->runs[run].start,
cl->ev));
#ifdef DEBUG #ifdef DEBUG
if (DEBUGL (5)) if (DEBUGL (5))
{ {
@ -3371,6 +3379,7 @@ arachne ()
eprintf ("Proof complete for this claim.\n"); eprintf ("Proof complete for this claim.\n");
} }
} }
}
// next // next
cl = cl->next; cl = cl->next;
} }

View File

@ -64,6 +64,7 @@ Term TERM_Claim;
Term CLAIM_Secret; Term CLAIM_Secret;
Term CLAIM_Nisynch; Term CLAIM_Nisynch;
Term CLAIM_Niagree; Term CLAIM_Niagree;
Term CLAIM_Empty;
/* /*
* Global stuff * Global stuff
@ -108,6 +109,7 @@ compilerInit (const System mysys)
langcons (CLAIM_Secret, "Secret", TERM_Claim); langcons (CLAIM_Secret, "Secret", TERM_Claim);
langcons (CLAIM_Nisynch, "Nisynch", TERM_Claim); langcons (CLAIM_Nisynch, "Nisynch", TERM_Claim);
langcons (CLAIM_Niagree, "Niagree", TERM_Claim); langcons (CLAIM_Niagree, "Niagree", TERM_Claim);
langcons (CLAIM_Empty, "Empty", TERM_Claim);
} }
//! Make a global constant //! Make a global constant
@ -593,6 +595,10 @@ commEvent (int event, Tac tc)
} }
break; break;
} }
if (claim == CLAIM_Empty)
{
break;
}
/* hmm, no handler yet */ /* hmm, no handler yet */

View File

@ -65,6 +65,7 @@ System sys;
extern struct tacnode *spdltac; extern struct tacnode *spdltac;
extern Term TERM_Claim; extern Term TERM_Claim;
extern Term CLAIM_Empty;
extern int mgu_match; extern int mgu_match;
void scanner_cleanup (void); void scanner_cleanup (void);
@ -365,6 +366,8 @@ timersPrint (const System sys)
cl_scan = sys->claimlist; cl_scan = sys->claimlist;
anyclaims = 0; anyclaims = 0;
while (cl_scan != NULL) while (cl_scan != NULL)
{
if (!isTermEqual (cl_scan->type, CLAIM_Empty))
{ {
anyclaims = 1; anyclaims = 1;
@ -426,6 +429,7 @@ timersPrint (const System sys)
eprintf ("\tcorrect: does_not_occur"); eprintf ("\tcorrect: does_not_occur");
} }
eprintf ("\n"); eprintf ("\n");
}
cl_scan = cl_scan->next; cl_scan = cl_scan->next;
} }
if (!anyclaims) if (!anyclaims)

View File

@ -30,6 +30,7 @@
extern Term CLAIM_Secret; extern Term CLAIM_Secret;
extern Term CLAIM_Nisynch; extern Term CLAIM_Nisynch;
extern Term CLAIM_Niagree; extern Term CLAIM_Niagree;
extern Term CLAIM_Empty;
/* /*
Some forward declarations. Some forward declarations.
@ -1404,7 +1405,7 @@ executeTry (const System sys, int run)
termlistDelete (sys->secrets); termlistDelete (sys->secrets);
sys->secrets = oldsecrets; sys->secrets = oldsecrets;
} }
if (runPoint->to == CLAIM_Nisynch) else if (runPoint->to == CLAIM_Nisynch)
{ {
/* /*
* NISYNCH * NISYNCH
@ -1422,7 +1423,7 @@ executeTry (const System sys, int run)
flag = explorify (sys, run); flag = explorify (sys, run);
} }
} }
if (runPoint->to == CLAIM_Niagree) else if (runPoint->to == CLAIM_Niagree)
{ {
/* /*
* NIAGREE * NIAGREE
@ -1440,6 +1441,11 @@ executeTry (const System sys, int run)
flag = explorify (sys, run); flag = explorify (sys, run);
} }
} }
else // if (runPoint->to == CLAIM_Empty)
{
// Skip other claim types
flag = explorify (sys, run);
}
} }
/* a claim always succeeds */ /* a claim always succeeds */
flag = 1; flag = 1;