Determining whether a state is new from the equivalence oracle's perspective. #68
-
I'm studying the implementation of the class StatePrefixEqOracle(Oracle):
"""
Equivalence oracle that achieves guided exploration by starting random walks from each state a walk_per_state
times. Starting the random walk ensures that all states are reached at least walk_per_state times and that their
surrounding is randomly explored. Note that each state serves as a root of random exploration of maximum length
rand_walk_len exactly walk_per_state times during learning. Therefore excessive testing of initial states is
avoided.
"""
def __init__(self, alphabet: list, sul: SUL, walks_per_state=10, walk_len=12, depth_first=False):
"""
Args:
alphabet: input alphabet
sul: system under learning
walks_per_state:individual walks per state of the automaton over the whole learning process
walk_len:length of random walk
depth_first:first explore newest states
""" I noticed that to achieve this, the list of states to be explored is sorted based on the length of the access sequence, as showcased in the following snippet: if self.depth_first:
# reverse sort the states by length of their access sequences
# first do the random walk on the state with longest access sequence
states_to_cover.sort(key=lambda x: len(x.prefix), reverse=True)
else:
random.shuffle(states_to_cover) Does greater length of access sequence imply that a state is newer? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
Hi, in general yes, but not necessarily*. I will explain in a bit why. This * I like to think of L* as a BFS exploration of underlying/hidden state space, while KV is more depth-first. So, in L*, shorter prefixes are generally identified early on, while in KV this is not necessarily the case. TLDR: |
Beta Was this translation helpful? Give feedback.
Hi,
in general yes, but not necessarily*. I will explain in a bit why. This
self.depth_first
is a small heuristic that I have added when developing this oracle, tbh, it would have the same guarantees and everything without it, I just liked the idea that you first try to find counterexamples for states with the longer prefix. In the end, it does not matter as much, as all states will serve as an origin for a test case exactlywalks_per_state
times.* I like to think of L* as a BFS exploration of underlying/hidden state space, while KV is more depth-first. So, in L*, shorter prefixes are generally identified early on, while in KV this is not necessarily the case.
TLDR:
The heuristic I liked…