11 #include "timed_automaton.hh"
12 #include "timed_word.hh"
13 #include "equivalence_oracle.hh"
14 #include "timed_automaton_runner.hh"
21 std::vector<TimedWord> words;
33 for (
const auto &word: words) {
35 hypothesisRunner.
pre();
36 for (std::size_t i = 0; i < word.wordSize(); ++i) {
37 if (runner.
step(word.getDurations().at(i)) != hypothesisRunner.
step(word.getDurations().at(i))) {
39 auto cex =
TimedWord{word.getWord().substr(0, i),
40 std::vector<double>{word.getDurations().begin(), word.getDurations().begin() + i + 1}};
41 BOOST_LOG_TRIVIAL(debug) <<
"EquivalenceOracleByTest found a counter example: " << cex;
44 if (runner.
step(word.getWord().at(i)) != hypothesisRunner.
step(word.getWord().at(i))) {
46 auto durations = std::vector<double>{word.getDurations().begin(), word.getDurations().begin() + i + 1};
47 durations.push_back(0);
48 auto cex =
TimedWord{word.getWord().substr(0, i + 1), durations};
49 BOOST_LOG_TRIVIAL(debug) <<
"EquivalenceOracleByTest found a counter example: " << cex;
53 if (runner.
step(word.getDurations().at(word.wordSize())) !=
54 hypothesisRunner.
step(word.getDurations().at(word.wordSize()))) {
55 BOOST_LOG_TRIVIAL(debug) <<
"EquivalenceOracleByTest found a counter example: " << word;
64 words.push_back(std::move(word));
Interface of the equivalence oracle.
Definition: equivalence_oracle_by_test.hh:20
std::optional< TimedWord > findCounterExample(const TimedAutomaton &hypothesis) override
Make an equivalence query.
Definition: equivalence_oracle_by_test.hh:29
Interface of the equivalence oracle.
Definition: equivalence_oracle.hh:17
Class to execute a timed automaton.
Definition: timed_automaton_runner.hh:22
bool step(char action) override
Feed a discrete action.
Definition: timed_automaton_runner.hh:80
void pre() override
Reset the configuration.
Definition: timed_automaton_runner.hh:41
A timed word.
Definition: timed_word.hh:25
Definition: experiment_runner.hh:23
A timed automaton.
Definition: timed_automaton.hh:213