Skip to content

Commit

Permalink
add explicit post to all eq. oracles
Browse files Browse the repository at this point in the history
  • Loading branch information
emuskardin committed May 11, 2021
1 parent 4d09f63 commit 91593a2
Show file tree
Hide file tree
Showing 9 changed files with 12 additions and 1 deletion.
1 change: 1 addition & 0 deletions aalpy/oracles/BreadthFirstExplorationEqOracle.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ def find_cex(self, hypothesis):
self.num_steps += 1

if out_hyp != out_sul:
self.sul.post()
return seq[:ind + 1]

return None
2 changes: 1 addition & 1 deletion aalpy/oracles/CacheBasedEqOracle.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ def find_cex(self, hypothesis):
if out_sul != out_hyp:
if self.reset_after_cex:
self.num_walks_done = 0

self.sul.post()
return inputs

return None
Expand Down
3 changes: 3 additions & 0 deletions aalpy/oracles/RandomWalkEqOracle.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ def find_cex(self, hypothesis: Automaton):
if self.reset_after_cex:
self.random_steps_done = 0

self.sul.post()
return inputs

return None
Expand Down Expand Up @@ -114,12 +115,14 @@ def find_cex(self, hypothesis):
self.random_steps_done = 0

if isinstance(hypothesis, Onfsm):
self.sul.post()
return inputs, outputs
else:
# hypothesis is MDP or SMM
cex = [hypothesis.initial_state.output] if isinstance(hypothesis, Mdp) else []
for i, o in zip(inputs, outputs):
cex.extend([i, o])
self.sul.post()
return cex

return None
1 change: 1 addition & 0 deletions aalpy/oracles/RandomWordEqOracle.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ def find_cex(self, hypothesis):
if self.reset_after_cex:
self.num_walks_done = 0

self.sul.post()
return inputs

return None
Expand Down
1 change: 1 addition & 0 deletions aalpy/oracles/StatePrefixEqOracle.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ def find_cex(self, hypothesis):
self.num_steps += 1

if out_sul != out_hyp:
self.sul.post()
return prefix + suffix

return None
1 change: 1 addition & 0 deletions aalpy/oracles/TransitionFocusOracle.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ def find_cex(self, hypothesis):
self.num_steps += 1

if out_sul != out_hyp:
self.sul.post()
return inputs

return None
1 change: 1 addition & 0 deletions aalpy/oracles/UserInputEqOracle.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ def find_cex(self, hypothesis):
continue
if inp == 'cex':
if inputs:
self.sul.post()
return inputs
if inp == 'end':
return None
Expand Down
2 changes: 2 additions & 0 deletions aalpy/oracles/WMethodEqOracle.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ def find_cex(self, hypothesis):

outputs.append(out_sul)
if out_hyp != out_sul:
self.sul.post()
return seq[:ind + 1]
self.cache.add(seq)

Expand Down Expand Up @@ -114,6 +115,7 @@ def find_cex(self, hypothesis):
self.num_steps += 1

if output_sul != output_hyp:
self.sul.post()
return test_case[:ind + 1]

return None
1 change: 1 addition & 0 deletions aalpy/oracles/kWayStateCoverageEqOracle.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ def find_cex(self, hypothesis):
self.num_steps += 1

if out_sul != out_hyp:
self.sul.post()
return path[:i + 1]

return None

0 comments on commit 91593a2

Please sign in to comment.