|  | @ -3,6 +3,7 @@ | 
		
	
		
			
				|  |  | //
 |  |  | //
 | 
		
	
		
			
				|  |  | 
 |  |  | 
 | 
		
	
		
			
				|  |  | #include <iostream>
 |  |  | #include <iostream>
 | 
		
	
		
			
				|  |  |  |  |  | #include <fstream>
 | 
		
	
		
			
				|  |  | #include "Lattice.h"
 |  |  | #include "Lattice.h"
 | 
		
	
		
			
				|  |  | namespace storm { |  |  | namespace storm { | 
		
	
		
			
				|  |  |     namespace analysis { |  |  |     namespace analysis { | 
		
	
	
		
			
				|  | @ -100,36 +101,37 @@ namespace storm { | 
		
	
		
			
				|  |  |             addBetween(state, top, bottom); |  |  |             addBetween(state, top, bottom); | 
		
	
		
			
				|  |  |         } |  |  |         } | 
		
	
		
			
				|  |  | 
 |  |  | 
 | 
		
	
		
			
				|  |  |         void Lattice::addRelation(storm::analysis::Lattice::Node *above, storm::analysis::Lattice::Node *between, |  |  |  | 
		
	
		
			
				|  |  |                                   storm::analysis::Lattice::Node *below) { |  |  |  | 
		
	
		
			
				|  |  |             above->below.insert(between); |  |  |  | 
		
	
		
			
				|  |  |             between->above.insert(above); |  |  |  | 
		
	
		
			
				|  |  |             between->below.insert(below); |  |  |  | 
		
	
		
			
				|  |  |             below->above.insert(between); |  |  |  | 
		
	
		
			
				|  |  |         } |  |  |  | 
		
	
		
			
				|  |  | 
 |  |  |  | 
		
	
		
			
				|  |  |         void Lattice::addRelationNodes(storm::analysis::Lattice::Node *above, storm::analysis::Lattice::Node * below) { |  |  |         void Lattice::addRelationNodes(storm::analysis::Lattice::Node *above, storm::analysis::Lattice::Node * below) { | 
		
	
		
			
				|  |  |  |  |  |             if (above != below) { | 
		
	
		
			
				|  |  |                 above->below.insert(below); |  |  |                 above->below.insert(below); | 
		
	
		
			
				|  |  |                 below->above.insert(above); |  |  |                 below->above.insert(above); | 
		
	
		
			
				|  |  |             } |  |  |             } | 
		
	
		
			
				|  |  |  |  |  |         } | 
		
	
		
			
				|  |  | 
 |  |  | 
 | 
		
	
		
			
				|  |  |         int Lattice::compare(uint_fast64_t state1, uint_fast64_t state2) { |  |  |         int Lattice::compare(uint_fast64_t state1, uint_fast64_t state2) { | 
		
	
		
			
				|  |  |             Node *node1 = getNode(state1); |  |  |             Node *node1 = getNode(state1); | 
		
	
		
			
				|  |  |             Node *node2 = getNode(state2); |  |  |             Node *node2 = getNode(state2); | 
		
	
		
			
				|  |  | 
 |  |  | 
 | 
		
	
		
			
				|  |  |             // TODO: Wat als above(node1, node2) en above(node2, node1), dan moeten ze samengevoegd?
 |  |  |  | 
		
	
		
			
				|  |  |  |  |  |             return compare(node1, node2); | 
		
	
		
			
				|  |  |  |  |  |         } | 
		
	
		
			
				|  |  |  |  |  | 
 | 
		
	
		
			
				|  |  |  |  |  |         int Lattice::compare(Node* node1, Node* node2) { | 
		
	
		
			
				|  |  |             if (node1 != nullptr && node2 != nullptr) { |  |  |             if (node1 != nullptr && node2 != nullptr) { | 
		
	
		
			
				|  |  |                 if (node1 == node2) { |  |  |                 if (node1 == node2) { | 
		
	
		
			
				|  |  |                     return SAME; |  |  |                     return SAME; | 
		
	
		
			
				|  |  |                 } |  |  |                 } | 
		
	
		
			
				|  |  | 
 |  |  | 
 | 
		
	
		
			
				|  |  |                 std::set<Node*>* seen1 = new std::set<Node*>({}); |  |  |  | 
		
	
		
			
				|  |  |                 if (above(node1, node2, seen1)) { |  |  |  | 
		
	
		
			
				|  |  |  |  |  |                 bool isAbove = above(node1, node2, new std::set<Node*>({})); | 
		
	
		
			
				|  |  |  |  |  |                 bool isBelow = above(node2, node1, new std::set<Node*>({})); | 
		
	
		
			
				|  |  |  |  |  |                 if (isAbove && isBelow) { | 
		
	
		
			
				|  |  |  |  |  |                     return SAME; | 
		
	
		
			
				|  |  |  |  |  |                 } | 
		
	
		
			
				|  |  |  |  |  | 
 | 
		
	
		
			
				|  |  |  |  |  |                 if (isAbove) { | 
		
	
		
			
				|  |  |                     return ABOVE; |  |  |                     return ABOVE; | 
		
	
		
			
				|  |  |                 } |  |  |                 } | 
		
	
		
			
				|  |  | 
 |  |  | 
 | 
		
	
		
			
				|  |  |                 std::set<Node*>* seen2 = new std::set<Node*>({}); |  |  |  | 
		
	
		
			
				|  |  |                 if (above(node2, node1, seen2)) { |  |  |  | 
		
	
		
			
				|  |  |  |  |  |                 if (isBelow) { | 
		
	
		
			
				|  |  |                     return BELOW; |  |  |                     return BELOW; | 
		
	
		
			
				|  |  |                 } |  |  |                 } | 
		
	
		
			
				|  |  |             } |  |  |             } | 
		
	
	
		
			
				|  | @ -137,6 +139,7 @@ namespace storm { | 
		
	
		
			
				|  |  |             return UNKNOWN; |  |  |             return UNKNOWN; | 
		
	
		
			
				|  |  |         } |  |  |         } | 
		
	
		
			
				|  |  | 
 |  |  | 
 | 
		
	
		
			
				|  |  |  |  |  | 
 | 
		
	
		
			
				|  |  |         Lattice::Node *Lattice::getNode(uint_fast64_t stateNumber) { |  |  |         Lattice::Node *Lattice::getNode(uint_fast64_t stateNumber) { | 
		
	
		
			
				|  |  |             return nodes.at(stateNumber); |  |  |             return nodes.at(stateNumber); | 
		
	
		
			
				|  |  |         } |  |  |         } | 
		
	
	
		
			
				|  | @ -153,7 +156,6 @@ namespace storm { | 
		
	
		
			
				|  |  |             return nodes; |  |  |             return nodes; | 
		
	
		
			
				|  |  |         } |  |  |         } | 
		
	
		
			
				|  |  | 
 |  |  | 
 | 
		
	
		
			
				|  |  | 
 |  |  |  | 
		
	
		
			
				|  |  |         storm::storage::BitVector Lattice::getAddedStates() { |  |  |         storm::storage::BitVector Lattice::getAddedStates() { | 
		
	
		
			
				|  |  |             return addedStates; |  |  |             return addedStates; | 
		
	
		
			
				|  |  |         } |  |  |         } | 
		
	
	
		
			
				|  | @ -216,7 +218,6 @@ namespace storm { | 
		
	
		
			
				|  |  |         } |  |  |         } | 
		
	
		
			
				|  |  | 
 |  |  | 
 | 
		
	
		
			
				|  |  |         void Lattice::toDotFile(std::ostream &out) { |  |  |         void Lattice::toDotFile(std::ostream &out) { | 
		
	
		
			
				|  |  |             // TODO: op de een of andere manier ontstaan er nodes die nergens eindigen/beginnen
 |  |  |  | 
		
	
		
			
				|  |  |             out << "digraph \"Lattice\" {" << std::endl; |  |  |             out << "digraph \"Lattice\" {" << std::endl; | 
		
	
		
			
				|  |  | 
 |  |  | 
 | 
		
	
		
			
				|  |  |             // print all nodes
 |  |  |             // print all nodes
 | 
		
	
	
		
			
				|  | @ -255,7 +256,6 @@ namespace storm { | 
		
	
		
			
				|  |  |             out << "}" << std::endl; |  |  |             out << "}" << std::endl; | 
		
	
		
			
				|  |  |         } |  |  |         } | 
		
	
		
			
				|  |  | 
 |  |  | 
 | 
		
	
		
			
				|  |  | 
 |  |  |  | 
		
	
		
			
				|  |  |         bool Lattice::above(Node *node1, Node *node2, std::set<Node *>* seenNodes) { |  |  |         bool Lattice::above(Node *node1, Node *node2, std::set<Node *>* seenNodes) { | 
		
	
		
			
				|  |  |             bool result = !node1->below.empty() && std::find(node1->below.begin(), node1->below.end(), node2) != node1->below.end(); |  |  |             bool result = !node1->below.empty() && std::find(node1->below.begin(), node1->below.end(), node2) != node1->below.end(); | 
		
	
		
			
				|  |  |             for (auto itr = node1->below.begin(); !result && node1->below.end() != itr; ++itr) { |  |  |             for (auto itr = node1->below.begin(); !result && node1->below.end() != itr; ++itr) { | 
		
	
	
		
			
				|  | 
 |