working on smt encoding for NA

This commit is contained in:
Artur Meski
2017-01-01 18:23:02 +01:00
parent 1594659509
commit ac389b238b
4 changed files with 113 additions and 12 deletions

View File

@@ -50,6 +50,14 @@ class ExtendedContextAutomaton(ContextAutomaton):
else:
return set()
def can_produce_entity(self, entity):
"""Check if the automaton can produce an entity"""
if entity in self._actions_for_products:
return True
else:
return False
def add_transition(self, src, actions, ctx_reaction, dst):
"""Adds a transition

View File

@@ -33,6 +33,10 @@ class NetworkOfContextAutomata(object):
"""Returns the set of entities that can potentially be produced by the automata in the network"""
return self._prod_entities
@property
def automata_ids(self):
return set(range(len(self.automata)))
def sanity_check(self):
"""Performs a sanity check of the network of automata"""