From 1f3dc5fab0ccdb98c1c77fdb2f96f662ea3e45a2 Mon Sep 17 00:00:00 2001 From: Marion Guthmuller Date: Tue, 23 Aug 2011 18:46:29 +0200 Subject: [PATCH] model-checker : ddfs stateless and stateful fixed --- examples/msg/mc/CMakeLists.txt | 10 +- examples/msg/mc/automatonparse_promela.c | 12 +- examples/msg/mc/bugged3.c | 2 +- examples/msg/mc/deploy_mutex.xml | 2 +- .../msg/mc/example2_liveness_without_cycle.c | 111 ++++++ .../msg/mc/example2_liveness_without_cycle.h | 14 + ...ton.c => example_liveness_without_cycle.c} | 4 +- ...ton.h => example_liveness_without_cycle.h} | 0 examples/msg/mc/result_parse | 17 - examples/msg/mc/result_parse2 | 28 -- src/mc/mc_global.c | 4 +- src/mc/mc_liveness.c | 356 ++++++------------ src/mc/private.h | 2 +- 13 files changed, 273 insertions(+), 289 deletions(-) create mode 100644 examples/msg/mc/example2_liveness_without_cycle.c create mode 100644 examples/msg/mc/example2_liveness_without_cycle.h rename examples/msg/mc/{example_automaton.c => example_liveness_without_cycle.c} (92%) rename examples/msg/mc/{example_automaton.h => example_liveness_without_cycle.h} (100%) delete mode 100644 examples/msg/mc/result_parse delete mode 100644 examples/msg/mc/result_parse2 diff --git a/examples/msg/mc/CMakeLists.txt b/examples/msg/mc/CMakeLists.txt index d8ac83f5cd..3a9eb3e15b 100644 --- a/examples/msg/mc/CMakeLists.txt +++ b/examples/msg/mc/CMakeLists.txt @@ -9,7 +9,12 @@ add_executable(bugged2_stateful bugged2_stateful.c) add_executable(bugged2 bugged2.c) add_executable(bugged3 bugged3.c) add_executable(random_test random_test.c) -add_executable(example_automaton automaton.c automatonparse_promela.c example_automaton.c) +add_executable(example_liveness_without_cycle automaton.c +automatonparse_promela.c example_liveness_without_cycle.c) +add_executable(example2_liveness_without_cycle automaton.c +automatonparse_promela.c +example2_liveness_without_cycle.c) + target_link_libraries(centralized simgrid m ) target_link_libraries(bugged1 simgrid m ) @@ -18,4 +23,5 @@ target_link_libraries(bugged2_stateful simgrid m) target_link_libraries(bugged2 simgrid m ) target_link_libraries(bugged3 simgrid m ) target_link_libraries(random_test simgrid m ) -target_link_libraries(example_automaton simgrid m ) \ No newline at end of file +target_link_libraries(example_liveness_without_cycle simgrid m ) +target_link_libraries(example2_liveness_without_cycle simgrid m ) \ No newline at end of file diff --git a/examples/msg/mc/automatonparse_promela.c b/examples/msg/mc/automatonparse_promela.c index 00678abc35..857ff0e53c 100644 --- a/examples/msg/mc/automatonparse_promela.c +++ b/examples/msg/mc/automatonparse_promela.c @@ -10,10 +10,16 @@ void new_state(char* id, int src){ char* id_state = strdup(id); char* first_part = strtok(id,"_"); - int type = 0 ; // -1=état initial, 0=état intermédiaire, 1=état final + int type = 0 ; // -1=état initial, 0=état intermédiaire, 1=état final, 2=état initial/final if(strcmp(first_part,"accept")==0){ - type = 1; + char* second_part = strtok(NULL,"_"); + if(strcmp(second_part,"init")==0){ + type = 2; + }else{ + type = 1; + } + }else{ char* second_part = strtok(NULL,"_"); if(strcmp(second_part,"init")==0){ @@ -27,7 +33,7 @@ void new_state(char* id, int src){ state = xbt_automaton_new_state(automaton, type, id_state); } - if(type==-1) + if(type==-1 || type==2) automaton->current_state = state; if(src) diff --git a/examples/msg/mc/bugged3.c b/examples/msg/mc/bugged3.c index 8e33b31fa1..a398f0fa8a 100644 --- a/examples/msg/mc/bugged3.c +++ b/examples/msg/mc/bugged3.c @@ -29,7 +29,7 @@ int server(int argc, char *argv[]) val1 = (long) MSG_task_get_data(task1); XBT_INFO("Received %lu", val1); - MC_assert(val1 == 2); + //MC_assert(val1 == 2); XBT_INFO("OK"); return 0; diff --git a/examples/msg/mc/deploy_mutex.xml b/examples/msg/mc/deploy_mutex.xml index 1afcee4b17..68c3234813 100644 --- a/examples/msg/mc/deploy_mutex.xml +++ b/examples/msg/mc/deploy_mutex.xml @@ -14,7 +14,7 @@ -