From b74567b2e0b9546aaba2b756f08f23805479537f Mon Sep 17 00:00:00 2001 From: ccremers Date: Wed, 11 Aug 2004 11:22:20 +0000 Subject: [PATCH] - Added more outlining for the arachne system. --- src/arachne.c | 56 +++++++++++++++++++++++++++++++++++++++++++++++++++ src/arachne.h | 2 ++ src/main.c | 9 +++++++++ 3 files changed, 67 insertions(+) diff --git a/src/arachne.c b/src/arachne.c index 2aa6316..14934f9 100644 --- a/src/arachne.c +++ b/src/arachne.c @@ -9,8 +9,64 @@ #include "system.h" #include "arachne.h" +//! Init Arachne engine +void +arachneInit (const System sys) +{ + /* + * Add intruder protocol roles + */ + return; +} + +//! Close Arachne engine +void +arachneDone (const System sys) +{ + return; +} + +//! Prune determination +/** + *@returns true iff this state is invalid for some reason + */ +int +prune (const System sys) +{ + return 0; +} + //! Main recursive procedure for Arachne int +iterate (const System sys) +{ + /** + * Possibly prune this state + */ + + if (prune (sys)) + return 0; + + /** + * If not pruned, check whether its a final state (i.e. all goals bound) + * - Yes: check whether property holds + * - No: iterate further + */ +} + +//! Main code for Arachne +/** + * For this test, we manually set up some stuff. + */ +int arachne (const System sys) { + /* + * set up claim role(s) + */ + + /* + * iterate + */ + iterate (sys); } diff --git a/src/arachne.h b/src/arachne.h index 410f3f5..52a1c10 100644 --- a/src/arachne.h +++ b/src/arachne.h @@ -3,6 +3,8 @@ #include "system.h" +void arachneInit (const System sys); +void arachneDone (const System sys); int arachne (const System sys); #endif diff --git a/src/main.c b/src/main.c index cb6932f..7db70cd 100644 --- a/src/main.c +++ b/src/main.c @@ -539,6 +539,11 @@ main (int argc, char **argv) #ifdef DEBUG warning ("Selected output method is %i", sys->output); #endif + + if (sys->engine == ARACHNE_ENGINE) + { + arachneInit (); + } /* * --------------------------------------- * Start real stuff @@ -620,6 +625,10 @@ main (int argc, char **argv) * Now we clean up any memory that was allocated. */ + if (sys->engine == ARACHNE_ENGINE) + { + arachneDone (); + } knowledgeDestroy (sys->know); systemDone (sys); compilerDone ();