forked from zlorb/PyModel
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpma.py
More file actions
executable file
·24 lines (21 loc) · 786 Bytes
/
pma.py
File metadata and controls
executable file
·24 lines (21 loc) · 786 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/usr/bin/env python
"""
PyModel Analyzer - generate FSM from product model program
"""
from pymodel import Analyzer
from pymodel import AnalyzerOptions
from pymodel.ProductModelProgram import ProductModelProgram
def main():
(options, args) = AnalyzerOptions.parse_args()
if not args:
AnalyzerOptions.print_help()
exit()
else:
mp = ProductModelProgram(options, args)
Analyzer.explore(mp, options.maxTransitions)
print('%s states, %s transitions, %s accepting states, %s unsafe states' % \
(len(Analyzer.states),len(Analyzer.graph),len(Analyzer.accepting),len(Analyzer.unsafe)))
mname = options.output if options.output else '%sFSM' % args[0]
Analyzer.save(mname)
if __name__ == '__main__':
main ()