Reindenting code.

This commit is contained in:
Cas Cremers 2011-01-25 17:33:12 +01:00
parent 68409e14ad
commit fea2bcf477
4 changed files with 22 additions and 17 deletions

View File

@ -793,10 +793,10 @@ arachne_claim_commit (const System sys, const int claim_run,
Termlist params_a; Termlist params_a;
rd_claim = roledef_shift (sys->runs[claim_run].start, claim_index); rd_claim = roledef_shift (sys->runs[claim_run].start, claim_index);
params_a = tuple_to_termlist(rd_claim->message); params_a = tuple_to_termlist (rd_claim->message);
actor_a = rd_claim->from; actor_a = rd_claim->from;
actor_b = params_a->term; actor_b = params_a->term;
partner_role = termLeft(rd_claim->claiminfo->parameter); partner_role = termLeft (rd_claim->claiminfo->parameter);
/* /*
* Iterate over all preceding events (include claim run for consistency with formal definition) * Iterate over all preceding events (include claim run for consistency with formal definition)
@ -826,24 +826,27 @@ arachne_claim_commit (const System sys, const int claim_run,
{ {
Termlist params_b; Termlist params_b;
params_b = tuple_to_termlist(rd->message); params_b = tuple_to_termlist (rd->message);
// check agent requirements // check agent requirements
if (isTermEqual(rd->from,actor_b) && isTermEqual(params_b->term,actor_a)) if (isTermEqual (rd->from, actor_b)
&& isTermEqual (params_b->term, actor_a))
{ {
// check role (also same protocol) // check role (also same protocol)
if (isTermEqual(partner_role,rd->claiminfo->rolename)) if (isTermEqual
(partner_role, rd->claiminfo->rolename))
{ {
// check parameters // check parameters
if (isTermlistEqual (params_a->next,params_b->next)) if (isTermlistEqual
(params_a->next, params_b->next))
{ {
// Claim holds // Claim holds
termlistDelete(params_b); termlistDelete (params_b);
termlistDelete(params_a); termlistDelete (params_a);
return true; return true;
} }
} }
} }
termlistDelete(params_b); termlistDelete (params_b);
} }
} }
} }
@ -851,7 +854,7 @@ arachne_claim_commit (const System sys, const int claim_run,
rd = rd->next; rd = rd->next;
} }
} }
termlistDelete(params_a); termlistDelete (params_a);
return false; return false;
} }

View File

@ -621,14 +621,15 @@ isEventIgnored (const System sys, int run, int ev)
if (rd->type == CLAIM) if (rd->type == CLAIM)
{ {
// If we are doing a reachability analysis, show all // If we are doing a reachability analysis, show all
if (isTermEqual(sys->current_claim->type, CLAIM_Reachable)) if (isTermEqual (sys->current_claim->type, CLAIM_Reachable))
{ {
return false; return false;
} }
// If the claim type is commit, we also show running claims // If the claim type is commit, we also show running claims
if (isTermEqual(sys->current_claim->type, CLAIM_Commit) || isTermEqual(sys->current_claim->type, CLAIM_Reachable)) if (isTermEqual (sys->current_claim->type, CLAIM_Commit)
|| isTermEqual (sys->current_claim->type, CLAIM_Reachable))
{ {
if (isTermEqual(rd->claiminfo->type, CLAIM_Running)) if (isTermEqual (rd->claiminfo->type, CLAIM_Running))
{ {
return false; return false;
} }

View File

@ -926,12 +926,13 @@ tuple_to_termlist (Term t)
} }
//! Get the leftmost term of a tuple (e.g. a non-tuple) //! Get the leftmost term of a tuple (e.g. a non-tuple)
Term termLeft(Term t) Term
termLeft (Term t)
{ {
t = deVar(t); t = deVar (t);
if (realTermTuple (t)) if (realTermTuple (t))
{ {
return termLeft(TermOp1 (t)); return termLeft (TermOp1 (t));
} }
return t; return t;
} }

View File

@ -77,7 +77,7 @@ int termlistOrder (Termlist tl1, Termlist tl2);
int termlist_iterate (Termlist tl, int (*func) ()); int termlist_iterate (Termlist tl, int (*func) ());
Term termlist_to_tuple (Termlist tl); Term termlist_to_tuple (Termlist tl);
Termlist tuple_to_termlist (Term t); Termlist tuple_to_termlist (Term t);
Term termLeft(Term t); Term termLeft (Term t);
Termlist termlistMinusTermlist (const Termlist tlbig, const Termlist tlsmall); Termlist termlistMinusTermlist (const Termlist tlbig, const Termlist tlsmall);
#define TERMLISTADD(l,t) l = termlistAdd (l,t) #define TERMLISTADD(l,t) l = termlistAdd (l,t)