Skip to content

Commit

Permalink
testing
Browse files Browse the repository at this point in the history
  • Loading branch information
sillydan1 committed Apr 16, 2023
1 parent 4653220 commit ac361e0
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 4 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -43,5 +43,6 @@ test/**/results.txt
# neovim autogenerated files
compile_commands.json
Debug/
Release/
.cache/

3 changes: 2 additions & 1 deletion src/util/warnings.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ namespace aaltitoad {
overlap_idem,
plugin_load_failed,
unsupported_query,
parser_warning
parser_warning,
already_visited
};

class warnings {
Expand Down
6 changes: 3 additions & 3 deletions src/verification/forward_reachability.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ namespace aaltitoad {
for(auto& l : s0.tock()) {
auto sp = s0 + l;
if(!P.contains(sp))
W.add(s0_it, sp);
W.add_if_not_contains(s0_it, sp);
}
while(!W.empty()) {
spdlog::trace("len(W)={0} | len(P)={1}", W.size(), P.size());
Expand All @@ -54,7 +54,7 @@ namespace aaltitoad {
auto sn_tocks = sn.tock();
/// if nothing interesting is possible, just add tick-space state to W
if(sn_tocks.empty()) {
W.add(s_it, sn);
W.add_if_not_contains(s_it, sn);
continue;
}
/// Add tock-space states to W
Expand All @@ -65,7 +65,7 @@ namespace aaltitoad {
for(auto& so : sn_tocks) {
auto sp = sn + so;
if(!P.contains(sp))
W.add(sn_it, sp);
W.add_if_not_contains(sn_it, sp);
}
}
}
Expand Down
6 changes: 6 additions & 0 deletions src/verification/traceable_multimap.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
#include "pick_strategy.h"
#include "util/exceptions/not_implemented_yet_exception.h"
#include "util/random.h"
#include "util/warnings.h"

namespace aaltitoad {
template<typename T>
Expand Down Expand Up @@ -57,6 +58,11 @@ namespace aaltitoad {
auto add(size_t key, const std::optional<iterator_t>& parent, const T& v) {
return data.insert({key, {parent, v}});
}
void add_if_not_contains(const std::optional<iterator_t>& parent, const T& v) {
if(contains(v))
return;
add(parent, v);
}
auto contains(const T& v) const -> bool {
return contains(std::hash<T>{}(v), v);
}
Expand Down

0 comments on commit ac361e0

Please sign in to comment.