Merge lp:~verifydtapn-contributers/verifydtapn/NoDefaultGCD into lp:verifydtapn

Proposed by Peter Gjøl Jensen
Status: Merged
Approved by: Jiri Srba
Approved revision: 296
Merged at revision: 296
Proposed branch: lp:~verifydtapn-contributers/verifydtapn/NoDefaultGCD
Merge into: lp:verifydtapn
Diff against target: 125 lines (+14/-14)
5 files modified
src/Core/ArgsParser.cpp (+3/-3)
src/Core/TAPN/TimedArcPetriNet.cpp (+2/-2)
src/Core/VerificationOptions.hpp (+5/-5)
src/DiscreteVerification/DiscreteVerification.cpp (+3/-3)
src/main.cpp (+1/-1)
To merge this branch: bzr merge lp:~verifydtapn-contributers/verifydtapn/NoDefaultGCD
Reviewer Review Type Date Requested Status
Jiri Srba Approve
Mathias Grund Sørensen Pending
Jakob Taankvist Pending
Review via email: mp+207112@code.launchpad.net

Description of the change

Made GCD opt in.

To post a comment you must log in.
Revision history for this message
Jiri Srba (srba) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'src/Core/ArgsParser.cpp'
--- src/Core/ArgsParser.cpp 2013-12-05 13:23:21 +0000
+++ src/Core/ArgsParser.cpp 2014-02-19 08:49:51 +0000
@@ -167,7 +167,7 @@
167167
168 parsers.push_back(168 parsers.push_back(
169 boost::make_shared<Switch >("c", GCD,169 boost::make_shared<Switch >("c", GCD,
170 "Disable lowering the guards by the greatest common divisor"));170 "Enable lowering the guards by the greatest common divisor"));
171 171
172 parsers.push_back(172 parsers.push_back(
173 boost::make_shared<SwitchWithArg > ("w", WORKFLOW,173 boost::make_shared<SwitchWithArg > ("w", WORKFLOW,
@@ -404,11 +404,11 @@
404404
405 405
406 assert(map.find(GCD) != map.end());406 assert(map.find(GCD) != map.end());
407 bool disableGCDLowerGuards = boost::lexical_cast<bool>(407 bool enableGCDLowerGuards = boost::lexical_cast<bool>(
408 map.find(GCD)->second);408 map.find(GCD)->second);
409 409
410 return VerificationOptions(modelFile, queryFile, search, verification, memoptimization, kbound, trace,410 return VerificationOptions(modelFile, queryFile, search, verification, memoptimization, kbound, trace,
411 xml_trace, max_constant, keep_dead, disableGCDLowerGuards, workflow);411 xml_trace, max_constant, keep_dead, enableGCDLowerGuards, workflow);
412412
413}413}
414}414}
415415
=== modified file 'src/Core/TAPN/TimedArcPetriNet.cpp'
--- src/Core/TAPN/TimedArcPetriNet.cpp 2013-12-05 13:23:21 +0000
+++ src/Core/TAPN/TimedArcPetriNet.cpp 2014-02-19 08:49:51 +0000
@@ -5,11 +5,11 @@
55
6namespace VerifyTAPN {6namespace VerifyTAPN {
7 namespace TAPN {7 namespace TAPN {
8 void TimedArcPetriNet::initialize(bool useGlobalMaxConstant, bool disableLowerGuards)8 void TimedArcPetriNet::initialize(bool useGlobalMaxConstant, bool lowerGuardsByGCD)
9 {9 {
10 10
11 // start by doing GCD if enabled11 // start by doing GCD if enabled
12 if(!disableLowerGuards){12 if(lowerGuardsByGCD){
13 GCDLowerGuards();13 GCDLowerGuards();
14 }14 }
15 15
1616
=== modified file 'src/Core/VerificationOptions.hpp'
--- src/Core/VerificationOptions.hpp 2013-12-02 14:12:28 +0000
+++ src/Core/VerificationOptions.hpp 2014-02-19 08:49:51 +0000
@@ -44,7 +44,7 @@
44 bool xml_trace,44 bool xml_trace,
45 bool useGlobalMaxConstants,45 bool useGlobalMaxConstants,
46 bool keepDeadTokens, 46 bool keepDeadTokens,
47 bool disableGCDLowerGuards,47 bool enableGCDLowerGuards,
48 WorkflowMode workflow48 WorkflowMode workflow
49 ) : inputFile(inputFile),49 ) : inputFile(inputFile),
50 queryFile(queryFile),50 queryFile(queryFile),
@@ -56,7 +56,7 @@
56 xml_trace(xml_trace),56 xml_trace(xml_trace),
57 useGlobalMaxConstants(useGlobalMaxConstants),57 useGlobalMaxConstants(useGlobalMaxConstants),
58 keepDeadTokens(keepDeadTokens), 58 keepDeadTokens(keepDeadTokens),
59 disableGCDLowerGuards(disableGCDLowerGuards),59 enableGCDLowerGuards(enableGCDLowerGuards),
60 workflow(workflow){60 workflow(workflow){
61 };61 };
6262
@@ -102,8 +102,8 @@
102 return keepDeadTokens;102 return keepDeadTokens;
103 };103 };
104104
105 inline const bool getDisableGCDLowerGuards() const {105 inline const bool getGCDLowerGuardsEnabled() const {
106 return disableGCDLowerGuards;106 return enableGCDLowerGuards;
107 }107 }
108108
109 inline const WorkflowMode getWorkflowMode() const {109 inline const WorkflowMode getWorkflowMode() const {
@@ -125,7 +125,7 @@
125 bool xml_trace;125 bool xml_trace;
126 bool useGlobalMaxConstants;126 bool useGlobalMaxConstants;
127 bool keepDeadTokens;127 bool keepDeadTokens;
128 bool disableGCDLowerGuards;128 bool enableGCDLowerGuards;
129 WorkflowMode workflow;129 WorkflowMode workflow;
130 };130 };
131131
132132
=== modified file 'src/DiscreteVerification/DiscreteVerification.cpp'
--- src/DiscreteVerification/DiscreteVerification.cpp 2014-02-17 21:36:41 +0000
+++ src/DiscreteVerification/DiscreteVerification.cpp 2014-02-19 08:49:51 +0000
@@ -97,11 +97,11 @@
97 AST::BoolResult containsDeadlock;97 AST::BoolResult containsDeadlock;
98 DeadlockVisitor deadlockVisitor = DeadlockVisitor();98 DeadlockVisitor deadlockVisitor = DeadlockVisitor();
99 deadlockVisitor.visit(*query, containsDeadlock);99 deadlockVisitor.visit(*query, containsDeadlock);
100 if(containsDeadlock.value && options.getDisableGCDLowerGuards() == false){100 if(containsDeadlock.value && options.getGCDLowerGuardsEnabled()){
101 cout << "Lowering constants by greatest common divisor is unsound for queries containing the deadlock proposition" << endl;101 cout << "Lowering constants by greatest common divisor is unsound for queries containing the deadlock proposition" << endl;
102 exit(1);102 exit(1);
103 }103 }
104 if((query->getQuantifier() == EG || query->getQuantifier() == AF) && options.getDisableGCDLowerGuards() == false){104 if((query->getQuantifier() == EG || query->getQuantifier() == AF) && options.getGCDLowerGuardsEnabled()){
105 cout << "Lowering constants by greatest common divisor is unsound for EG and AF queries" << endl;105 cout << "Lowering constants by greatest common divisor is unsound for EG and AF queries" << endl;
106 exit(1);106 exit(1);
107 }107 }
@@ -203,7 +203,7 @@
203 template<typename T> void VerifyAndPrint(TAPN::TimedArcPetriNet& tapn, Verification<T>& verifier, VerificationOptions& options, AST::Query* query) {203 template<typename T> void VerifyAndPrint(TAPN::TimedArcPetriNet& tapn, Verification<T>& verifier, VerificationOptions& options, AST::Query* query) {
204 bool result = (!options.isWorkflow() && (query->getQuantifier() == AG || query->getQuantifier() == AF)) ? !verifier.verify() : verifier.verify();204 bool result = (!options.isWorkflow() && (query->getQuantifier() == AG || query->getQuantifier() == AF)) ? !verifier.verify() : verifier.verify();
205205
206 if (!options.getDisableGCDLowerGuards()) {206 if (options.getGCDLowerGuardsEnabled()) {
207 std::cout << "Lowering all guards by greatest common divisor: " << tapn.getGCD() << std::endl;207 std::cout << "Lowering all guards by greatest common divisor: " << tapn.getGCD() << std::endl;
208 }208 }
209 std::cout << std::endl;209 std::cout << std::endl;
210210
=== modified file 'src/main.cpp'
--- src/main.cpp 2013-10-02 09:42:37 +0000
+++ src/main.cpp 2014-02-19 08:49:51 +0000
@@ -28,7 +28,7 @@
28 return 1;28 return 1;
29 }29 }
3030
31 tapn->initialize(options.getGlobalMaxConstantsEnabled(), options.getDisableGCDLowerGuards());31 tapn->initialize(options.getGlobalMaxConstantsEnabled(), options.getGCDLowerGuardsEnabled());
3232
33 std::vector<int> initialPlacement(modelParser.parseMarking(options.getInputFile(), *tapn));33 std::vector<int> initialPlacement(modelParser.parseMarking(options.getInputFile(), *tapn));
3434

Subscribers

People subscribed via source and target branches