- Added '--remove-claims' switch to cut off all existing claims.
This commit is contained in:
parent
ca4c5674ac
commit
ccc4c34823
@ -463,6 +463,8 @@ commEvent (int event, Tac tc)
|
|||||||
|
|
||||||
break;
|
break;
|
||||||
case CLAIM:
|
case CLAIM:
|
||||||
|
if (!switches.removeclaims)
|
||||||
|
{
|
||||||
/* now parse tuple info */
|
/* now parse tuple info */
|
||||||
if (trip == NULL || trip->next == NULL)
|
if (trip == NULL || trip->next == NULL)
|
||||||
{
|
{
|
||||||
@ -489,7 +491,7 @@ commEvent (int event, Tac tc)
|
|||||||
}
|
}
|
||||||
if (!inTermlist (claim->stype, TERM_Claim))
|
if (!inTermlist (claim->stype, TERM_Claim))
|
||||||
{
|
{
|
||||||
printf ("ERROR: unknown claim type ");
|
printf ("error: unknown claim type ");
|
||||||
termPrint (claim);
|
termPrint (claim);
|
||||||
errorTac (trip->next->lineno);
|
errorTac (trip->next->lineno);
|
||||||
}
|
}
|
||||||
@ -516,7 +518,8 @@ commEvent (int event, Tac tc)
|
|||||||
|
|
||||||
if (label == NULL)
|
if (label == NULL)
|
||||||
{
|
{
|
||||||
error ("Claim should have label on line %i.", trip->next->lineno);
|
error ("Claim should have label on line %i.",
|
||||||
|
trip->next->lineno);
|
||||||
}
|
}
|
||||||
// First check whether label is unique
|
// First check whether label is unique
|
||||||
cl = sys->claimlist;
|
cl = sys->claimlist;
|
||||||
@ -539,7 +542,8 @@ commEvent (int event, Tac tc)
|
|||||||
cl->rolename = fromrole;
|
cl->rolename = fromrole;
|
||||||
cl->role = thisRole;
|
cl->role = thisRole;
|
||||||
if (!isTermEqual (fromrole, thisRole->nameterm))
|
if (!isTermEqual (fromrole, thisRole->nameterm))
|
||||||
error ("Claim role does not correspond to execution role at line %i.",
|
error
|
||||||
|
("Claim role does not correspond to execution role at line %i.",
|
||||||
tc->lineno);
|
tc->lineno);
|
||||||
cl->roledef = NULL;
|
cl->roledef = NULL;
|
||||||
cl->count = 0;
|
cl->count = 0;
|
||||||
@ -615,10 +619,11 @@ commEvent (int event, Tac tc)
|
|||||||
|
|
||||||
/* hmm, no handler yet */
|
/* hmm, no handler yet */
|
||||||
|
|
||||||
printf ("ERROR: No know handler for this claim type: ");
|
printf ("error: No know handler for this claim type: ");
|
||||||
termPrint (claim);
|
termPrint (claim);
|
||||||
printf (" ");
|
printf (" ");
|
||||||
errorTac (trip->next->lineno);
|
errorTac (trip->next->lineno);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
/* and make that event */
|
/* and make that event */
|
||||||
@ -670,7 +675,7 @@ roleCompile (Term nameterm, Tac tc)
|
|||||||
}
|
}
|
||||||
if (thisRole == NULL)
|
if (thisRole == NULL)
|
||||||
{
|
{
|
||||||
printf ("ERROR: undeclared role name ");
|
printf ("error: undeclared role name ");
|
||||||
termPrint (nameterm);
|
termPrint (nameterm);
|
||||||
printf (" in line ");
|
printf (" in line ");
|
||||||
errorTac (tc->lineno);
|
errorTac (tc->lineno);
|
||||||
@ -710,7 +715,7 @@ roleCompile (Term nameterm, Tac tc)
|
|||||||
default:
|
default:
|
||||||
if (!normalDeclaration (tc))
|
if (!normalDeclaration (tc))
|
||||||
{
|
{
|
||||||
printf ("ERROR: illegal command %i in role ", tc->op);
|
printf ("error: illegal command %i in role ", tc->op);
|
||||||
termPrint (thisRole->nameterm);
|
termPrint (thisRole->nameterm);
|
||||||
printf (" ");
|
printf (" ");
|
||||||
errorTac (tc->lineno);
|
errorTac (tc->lineno);
|
||||||
@ -812,7 +817,7 @@ protocolCompile (Symbol prots, Tac tc, Tac tcroles)
|
|||||||
|
|
||||||
if (levelFind (prots, level) != NULL)
|
if (levelFind (prots, level) != NULL)
|
||||||
{
|
{
|
||||||
printf ("ERROR: Double declaration of protocol ");
|
printf ("error: Double declaration of protocol ");
|
||||||
symbolPrint (prots);
|
symbolPrint (prots);
|
||||||
printf (" ");
|
printf (" ");
|
||||||
errorTac (tc->lineno);
|
errorTac (tc->lineno);
|
||||||
@ -871,7 +876,7 @@ protocolCompile (Symbol prots, Tac tc, Tac tcroles)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
printf ("ERROR: undeclared role ");
|
printf ("error: undeclared role ");
|
||||||
symbolPrint (tc->t1.sym);
|
symbolPrint (tc->t1.sym);
|
||||||
printf (" in protocol ");
|
printf (" in protocol ");
|
||||||
termPrint (pr->nameterm);
|
termPrint (pr->nameterm);
|
||||||
@ -881,7 +886,7 @@ protocolCompile (Symbol prots, Tac tc, Tac tcroles)
|
|||||||
default:
|
default:
|
||||||
if (!normalDeclaration (tc))
|
if (!normalDeclaration (tc))
|
||||||
{
|
{
|
||||||
printf ("ERROR: illegal command %i in protocol ", tc->op);
|
printf ("error: illegal command %i in protocol ", tc->op);
|
||||||
termPrint (thisProtocol->nameterm);
|
termPrint (thisProtocol->nameterm);
|
||||||
errorTac (tc->lineno);
|
errorTac (tc->lineno);
|
||||||
}
|
}
|
||||||
@ -915,7 +920,7 @@ tacProcess (Tac tc)
|
|||||||
default:
|
default:
|
||||||
if (!normalDeclaration (tc))
|
if (!normalDeclaration (tc))
|
||||||
{
|
{
|
||||||
printf ("ERROR: illegal command %i at the global level.\n",
|
printf ("error: illegal command %i at the global level.\n",
|
||||||
tc->op);
|
tc->op);
|
||||||
errorTac (tc->lineno);
|
errorTac (tc->lineno);
|
||||||
}
|
}
|
||||||
|
@ -74,6 +74,7 @@ switchesInit (int argc, char **argv)
|
|||||||
// Misc
|
// Misc
|
||||||
switches.switchP = 0; // multi-purpose parameter
|
switches.switchP = 0; // multi-purpose parameter
|
||||||
switches.experimental = 0; // experimental stuff defaults to 0, whatever that means.
|
switches.experimental = 0; // experimental stuff defaults to 0, whatever that means.
|
||||||
|
switches.removeclaims = false; // default: leave claims from spdl file
|
||||||
|
|
||||||
// Output
|
// Output
|
||||||
switches.output = SUMMARY; // default is to show a summary
|
switches.output = SUMMARY; // default is to show a summary
|
||||||
@ -378,6 +379,22 @@ switcher (const int process, int index)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (detect (' ', "remove-claims", 0))
|
||||||
|
{
|
||||||
|
if (!process)
|
||||||
|
{
|
||||||
|
/* discourage:
|
||||||
|
*
|
||||||
|
* Causes all existing claims in the specification to be skipped.
|
||||||
|
*/
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
switches.removeclaims = true;
|
||||||
|
return index;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* ==================
|
/* ==================
|
||||||
* Bounding options
|
* Bounding options
|
||||||
*/
|
*/
|
||||||
|
@ -53,6 +53,7 @@ struct switchdata
|
|||||||
// Misc
|
// Misc
|
||||||
int switchP; //!< A multi-purpose integer parameter, passed to the partial order reduction method selected.
|
int switchP; //!< A multi-purpose integer parameter, passed to the partial order reduction method selected.
|
||||||
int experimental; //!< Experimental stuff goes here until it moves into main stuff.
|
int experimental; //!< Experimental stuff goes here until it moves into main stuff.
|
||||||
|
int removeclaims; //!< Remove any claims in the spdl file
|
||||||
|
|
||||||
// Output
|
// Output
|
||||||
int output; //!< From enum outputs: what should be produced. Default ATTACK.
|
int output; //!< From enum outputs: what should be produced. Default ATTACK.
|
||||||
|
Loading…
Reference in New Issue
Block a user