- Reindent script was improved (and consequences added)

This commit is contained in:
ccremers 2006-02-21 21:35:14 +00:00
parent 5d2d836d07
commit d3f2971181
3 changed files with 122 additions and 116 deletions

View File

@ -19,18 +19,21 @@ protocolHidelevel (const System sys, const Term t)
int itsends (const System sys, const Protocol p, const Role r)
{
int sends(Roledef rd)
int sends (Roledef rd)
{
if (rd->type == SEND)
{
unsigned int l;
l = termHidelevel (t, rd->from);
if (l < minlevel) minlevel = l;
if (l < minlevel)
minlevel = l;
l = termHidelevel (t, rd->to);
if (l < minlevel) minlevel = l;
if (l < minlevel)
minlevel = l;
l = termHidelevel (t, rd->message);
if (l < minlevel) minlevel = l;
if (l < minlevel)
minlevel = l;
}
return true;
}
@ -83,7 +86,7 @@ hidelevelCompute (const System sys)
while (tl != NULL)
{
unsigned int l1,l2,l;
unsigned int l1, l2, l;
l1 = knowledgeHidelevel (sys, tl->term);
l2 = protocolHidelevel (sys, tl->term);
@ -112,7 +115,7 @@ hidelevelCompute (const System sys)
#ifdef DEBUG
eprintf ("Added possibly interesting term: ");
termPrint (tl->term);
eprintf ("; know %i, prot %i\n", l1,l2);
eprintf ("; know %i, prot %i\n", l1, l2);
#endif
}
@ -122,7 +125,8 @@ hidelevelCompute (const System sys)
//! Given a term, iterate over all factors
int iterate_interesting (const System sys, const Term goalterm, int (*func) ())
int
iterate_interesting (const System sys, const Term goalterm, int (*func) ())
{
Hiddenterm ht;
@ -147,9 +151,11 @@ int iterate_interesting (const System sys, const Term goalterm, int (*func) ())
}
//! Determine whether a goal might be interesting from the viewpoint of hide levels (the highest minimum is best)
int hidelevelInteresting (const System sys, const Term goalterm)
int
hidelevelInteresting (const System sys, const Term goalterm)
{
int uninteresting (unsigned int l, unsigned int lmin, unsigned int lprot, unsigned int lknow)
int uninteresting (unsigned int l, unsigned int lmin, unsigned int lprot,
unsigned int lknow)
{
if (lmin > 0)
{
@ -163,9 +169,11 @@ int hidelevelInteresting (const System sys, const Term goalterm)
}
//! Determine whether a goal is impossible to satisfy because of the hidelevel lemma.
int hidelevelImpossible (const System sys, const Term goalterm)
int
hidelevelImpossible (const System sys, const Term goalterm)
{
int possible (unsigned int l, unsigned int lmin, unsigned int lprot, unsigned int lknow)
int possible (unsigned int l, unsigned int lmin, unsigned int lprot,
unsigned int lknow)
{
if (l < lmin)
{
@ -177,4 +185,3 @@ int hidelevelImpossible (const System sys, const Term goalterm)
return !iterate_interesting (sys, goalterm, possible);
}

View File

@ -13,4 +13,3 @@ int hidelevelInteresting (const System sys, const Term goalterm);
int hidelevelImpossible (const System sys, const Term goalterm);
#endif

View File

@ -2,4 +2,4 @@
#
# Indent any changed files, ending in .c or .h
#
svn st | grep "^M.*\.[ch]$"| awk '{print $2}' | xargs indent
svn st | grep "^[MA].*\.[ch]$"| awk '{print $2}' | xargs indent