- Layout improvements accross the board of the MSCs.
This commit is contained in:
parent
e93a6cd462
commit
47a96937ac
@ -2,6 +2,11 @@
|
||||
\usepackage{a4wide}
|
||||
\usepackage{msc}
|
||||
|
||||
\setlength{\instwidth}{3.0cm}
|
||||
\setlength{\instdist}{4cm}
|
||||
\setlength{\actionwidth}{3.6cm}
|
||||
\setlength{\conditionoverlap}{1.9cm}
|
||||
|
||||
\begin{document}
|
||||
|
||||
\input{attack}
|
||||
|
81
src/latex.c
81
src/latex.c
@ -279,19 +279,52 @@ latexMSCEnd ()
|
||||
/*
|
||||
* Declare the MSC stick for a single instance of a run participating in an
|
||||
* attack.
|
||||
*
|
||||
* This involves layout of the partners roles, and the agent etc.
|
||||
*/
|
||||
|
||||
void
|
||||
latexDeclInst (const System sys, int run)
|
||||
{
|
||||
Term bar = NULL;
|
||||
Term myAgent;
|
||||
Term myRole;
|
||||
Termlist roles;
|
||||
int first;
|
||||
|
||||
myAgent = agentOfRun (sys, run);
|
||||
myRole = sys->runs[run].role->nameterm;
|
||||
printf ("\\declinst{run%i}{", run);
|
||||
|
||||
/* display above assumptions */
|
||||
roles = sys->runs[run].protocol->rolenames;
|
||||
printf ("assumes $");
|
||||
first = 1;
|
||||
while (roles != NULL)
|
||||
{
|
||||
if (!isTermEqual (myRole, roles->term))
|
||||
{
|
||||
if (!first)
|
||||
printf (", ");
|
||||
else
|
||||
first = 0;
|
||||
termPrint (agentOfRunRole(sys,run,roles->term));
|
||||
printf(": ");
|
||||
termPrint (roles->term);
|
||||
}
|
||||
roles = roles->next;
|
||||
}
|
||||
printf ("$}{$");
|
||||
|
||||
/* display agent and role */
|
||||
printf ("\\mathbf{");
|
||||
termPrint (myAgent);
|
||||
printf("}: ");
|
||||
termPrint (myRole);
|
||||
|
||||
bar = agentOfRun (sys, run);
|
||||
printf ("\\declinst{run%d}{$", run);
|
||||
termPrint (bar);
|
||||
printf ("\\sharp%i$}{$", run);
|
||||
agentsOfRunPrint (sys, run);
|
||||
printf ("$}\n");
|
||||
|
||||
/* cleanup */
|
||||
termDelete (myAgent);
|
||||
}
|
||||
|
||||
/*
|
||||
@ -908,9 +941,43 @@ attackDisplayLatex (System sys)
|
||||
latexDeclInst (sys, i);
|
||||
}
|
||||
/* Add the intruder instance */
|
||||
printf ("\\declinst{eve}{Eve}{Intruder}\n");
|
||||
printf ("\\declinst{eve}{}{{\\bf Eve}: Intruder}\n");
|
||||
printf ("\n\n");
|
||||
|
||||
/* Print the local constants for each instance */
|
||||
|
||||
for (i = 0; i < width; i++)
|
||||
{
|
||||
if (runPosition[i] > 0)
|
||||
{
|
||||
Termlist tl = sys->runs[i].locals;
|
||||
int first = 1;
|
||||
while (tl != NULL)
|
||||
{
|
||||
/* detect whether it's really local to this run */
|
||||
Term t = deVar (tl->term);
|
||||
if (isTermLeaf (t) && t->runid == i)
|
||||
{
|
||||
if (first)
|
||||
{
|
||||
printf ("\\action{creates $");
|
||||
first = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
printf (", ");
|
||||
}
|
||||
termPrint (tl->term);
|
||||
}
|
||||
tl = tl->next;
|
||||
}
|
||||
if (!first)
|
||||
{
|
||||
printf ("$}{run%i}\n", i);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Print the initial intruder knowledge */
|
||||
|
||||
printf ("\\action{knows $");
|
||||
|
@ -511,7 +511,7 @@ roleInstance (const System sys, const Protocol protocol, const Role role,
|
||||
rd = rd->next;
|
||||
}
|
||||
termlistDelete (fromlist);
|
||||
termlistDelete (tolist);
|
||||
runs[rid].locals = tolist;
|
||||
}
|
||||
|
||||
Roledef
|
||||
|
@ -65,6 +65,7 @@ struct run
|
||||
Roledef index;
|
||||
Roledef start;
|
||||
Knowledge know;
|
||||
Termlist locals;
|
||||
};
|
||||
|
||||
typedef struct run *Run;
|
||||
|
Loading…
Reference in New Issue
Block a user