From 5d1ddebcfdc372902d6b01f267b622094c2c751c Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Thu, 25 Jul 2019 15:34:25 +0200 Subject: Move trace filter from postprocessing to automata module This drastically increases performance --- test/pta.py | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'test') diff --git a/test/pta.py b/test/pta.py index 25ec20c..8ca41aa 100755 --- a/test/pta.py +++ b/test/pta.py @@ -155,6 +155,14 @@ class TestPTA(unittest.TestCase): ['init', 'set2', 'set1'], ['init', 'set2', 'set2']]) + def test_dfs_trace_filter(self): + pta = PTA(['IDLE']) + pta.add_transition('UNINITIALIZED', 'IDLE', 'init') + pta.add_transition('IDLE', 'IDLE', 'set1') + pta.add_transition('IDLE', 'IDLE', 'set2') + self.assertEqual(sorted(dfs_tran_to_name(pta.dfs(2, trace_filter=[['init', 'set1', 'set2'], ['init', 'set2', 'set1']]), False)), + [['init', 'set1', 'set2'], ['init', 'set2', 'set1']]) + def test_dfs_accepting(self): pta = PTA(['IDLE', 'TX'], accepting_states = ['IDLE']) pta.add_transition('UNINITIALIZED', 'IDLE', 'init') -- cgit v1.2.3