umaudemc 0.12.1__py3-none-any.whl → 0.13.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- umaudemc/__init__.py +1 -1
- umaudemc/__main__.py +7 -1
- umaudemc/api.py +3 -3
- umaudemc/backend/_spot.py +7 -8
- umaudemc/backend/bmcalc.py +8 -8
- umaudemc/backend/ltsmin.py +1 -1
- umaudemc/backend/nusmv.py +1 -1
- umaudemc/backend/prism.py +3 -3
- umaudemc/backend/spin.py +1 -1
- umaudemc/command/acheck.py +21 -0
- umaudemc/command/graph.py +31 -3
- umaudemc/command/scheck.py +1 -1
- umaudemc/command/test.py +28 -10
- umaudemc/common.py +0 -24
- umaudemc/counterprint.py +12 -4
- umaudemc/data/smcgraph.js +3 -0
- umaudemc/data/smcview.js +42 -29
- umaudemc/formatter.py +20 -25
- umaudemc/formulae.py +4 -4
- umaudemc/grapher.py +6 -5
- umaudemc/gtk.py +88 -499
- umaudemc/kleene.py +156 -0
- umaudemc/mproc.py +1 -1
- umaudemc/opsem.py +1 -1
- umaudemc/probabilistic.py +13 -10
- umaudemc/pyslang.py +320 -186
- umaudemc/quatex.py +3 -3
- umaudemc/resources.py +25 -9
- umaudemc/webui.py +37 -34
- umaudemc/wrappers.py +44 -2
- {umaudemc-0.12.1.dist-info → umaudemc-0.13.0.dist-info}/METADATA +6 -7
- umaudemc-0.13.0.dist-info/RECORD +59 -0
- {umaudemc-0.12.1.dist-info → umaudemc-0.13.0.dist-info}/WHEEL +1 -1
- umaudemc-0.12.1.dist-info/RECORD +0 -57
- {umaudemc-0.12.1.dist-info → umaudemc-0.13.0.dist-info}/LICENSE +0 -0
- {umaudemc-0.12.1.dist-info → umaudemc-0.13.0.dist-info}/entry_points.txt +0 -0
- {umaudemc-0.12.1.dist-info → umaudemc-0.13.0.dist-info}/top_level.txt +0 -0
umaudemc/formatter.py
CHANGED
|
@@ -89,23 +89,18 @@ def parse_state_format(sformat, strategy):
|
|
|
89
89
|
tused > 0, sused > 0))
|
|
90
90
|
|
|
91
91
|
|
|
92
|
-
def apply_edge_format(
|
|
92
|
+
def apply_edge_format(stmt, eformat):
|
|
93
93
|
"""
|
|
94
94
|
Edge label generator using a prebuilt format string.
|
|
95
95
|
|
|
96
|
-
:param
|
|
97
|
-
:type
|
|
98
|
-
:param origin: Index of the origin state within the graph.
|
|
99
|
-
:type origin: int
|
|
100
|
-
:param dest: Index of the destination state within the graph.
|
|
101
|
-
:type dest: int
|
|
96
|
+
:param stmt: Rule that caused the transition
|
|
97
|
+
:type stmt: Rule
|
|
102
98
|
:param eformat: Prebuilt format string.
|
|
103
99
|
:type eformat: str
|
|
104
100
|
:returns: Formatted edge label.
|
|
105
101
|
:rtype str
|
|
106
102
|
"""
|
|
107
103
|
|
|
108
|
-
stmt = graph.getRule(origin, dest)
|
|
109
104
|
label = stmt.getLabel()
|
|
110
105
|
line = stmt.getLineNumber()
|
|
111
106
|
opaque = ''
|
|
@@ -116,9 +111,8 @@ def apply_edge_format(graph, origin, dest, eformat):
|
|
|
116
111
|
return eformat.format(stmt=stmt, label=label, line=line, opaque=opaque)
|
|
117
112
|
|
|
118
113
|
|
|
119
|
-
def apply_edge_format_strat(
|
|
114
|
+
def apply_edge_format_strat(trans, eformat):
|
|
120
115
|
"""Edge label generator for strategy-controlled using a prebuilt format string"""
|
|
121
|
-
trans = graph.getTransition(origin, dest)
|
|
122
116
|
opaque, label, stmt, line = '', '', '', ''
|
|
123
117
|
|
|
124
118
|
if trans.getType() == maude.StrategyRewriteGraph.SOLUTION:
|
|
@@ -150,9 +144,9 @@ def parse_edge_format(eformat, strategy):
|
|
|
150
144
|
eformat = re.sub(r'%(.\d+)?n', r'{line:\1}', eformat)
|
|
151
145
|
|
|
152
146
|
if strategy:
|
|
153
|
-
return lambda
|
|
147
|
+
return lambda trans: apply_edge_format_strat(trans, eformat)
|
|
154
148
|
else:
|
|
155
|
-
return lambda
|
|
149
|
+
return lambda stmt: apply_edge_format(stmt, eformat)
|
|
156
150
|
|
|
157
151
|
|
|
158
152
|
#
|
|
@@ -165,29 +159,30 @@ def print_term(graph, index):
|
|
|
165
159
|
return graph.getStateTerm(index)
|
|
166
160
|
|
|
167
161
|
|
|
168
|
-
def print_transition(
|
|
162
|
+
def print_transition(stmt):
|
|
169
163
|
"""Default edge-label printing function"""
|
|
170
|
-
return
|
|
164
|
+
return stmt
|
|
171
165
|
|
|
172
166
|
|
|
173
|
-
def print_transition_strat(
|
|
167
|
+
def print_transition_strat(trans):
|
|
174
168
|
"""Default edge-label printing function with strategies"""
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
169
|
+
ttype = trans.getType()
|
|
170
|
+
|
|
171
|
+
if ttype == maude.StrategyRewriteGraph.RULE_APPLICATION:
|
|
172
|
+
return trans.getRule()
|
|
173
|
+
elif ttype == maude.StrategyRewriteGraph.OPAQUE_STRATEGY:
|
|
174
|
+
return trans.getStrategy()
|
|
175
|
+
else:
|
|
176
|
+
return ''
|
|
181
177
|
|
|
182
178
|
|
|
183
|
-
def print_transition_label(
|
|
179
|
+
def print_transition_label(stmt):
|
|
184
180
|
"""Alternative edge-label printing function (only rule label)"""
|
|
185
|
-
return
|
|
181
|
+
return stmt.getLabel()
|
|
186
182
|
|
|
187
183
|
|
|
188
|
-
def print_transition_strat_label(
|
|
184
|
+
def print_transition_strat_label(trans):
|
|
189
185
|
"""Alternative edge-label printing function with strategies (only rule/strategy label)"""
|
|
190
|
-
trans = graph.getTransition(origin, dest)
|
|
191
186
|
ttype = trans.getType()
|
|
192
187
|
|
|
193
188
|
if ttype == maude.StrategyRewriteGraph.RULE_APPLICATION:
|
umaudemc/formulae.py
CHANGED
|
@@ -22,7 +22,7 @@ def collect_aprops(form, aprops):
|
|
|
22
22
|
|
|
23
23
|
|
|
24
24
|
def _add_path_premise_ctl(form, premise):
|
|
25
|
-
"""Add a premise to every path quantification in CTL* formulae"""
|
|
25
|
+
"""Add a premise to every path quantification in CTL* formulae"""
|
|
26
26
|
head, *rest = form
|
|
27
27
|
|
|
28
28
|
if head == 'A_' or head == 'E_':
|
|
@@ -102,7 +102,7 @@ def _actionSpecParse(acspec, labels):
|
|
|
102
102
|
|
|
103
103
|
|
|
104
104
|
def _formula2List(form, *extra_args):
|
|
105
|
-
"""Convert the formula parsed by Maude into
|
|
105
|
+
"""Convert the formula parsed by Maude into a pure Python list"""
|
|
106
106
|
prop_sort, variable_sort, labels = extra_args
|
|
107
107
|
|
|
108
108
|
if form.getSort() <= prop_sort:
|
|
@@ -170,7 +170,7 @@ def _boundSpecParse(bound):
|
|
|
170
170
|
|
|
171
171
|
|
|
172
172
|
def _probFormula2List(form, prop_sort, aprops):
|
|
173
|
-
"""Convert the probabilistic formula parsed by Maude into
|
|
173
|
+
"""Convert the probabilistic formula parsed by Maude into a pure Python list"""
|
|
174
174
|
|
|
175
175
|
if form.getSort() <= prop_sort:
|
|
176
176
|
aprops.add(str(form))
|
|
@@ -269,7 +269,7 @@ class BaseParser:
|
|
|
269
269
|
self.templog.parseTerm('tokenize("{}")'.format(formula.replace('"', '\"'))),
|
|
270
270
|
self.templog.parseTerm(label_list)
|
|
271
271
|
)
|
|
272
|
-
|
|
272
|
+
|
|
273
273
|
extmod = maude.downModule(parser_metamod)
|
|
274
274
|
|
|
275
275
|
formula_kind = extmod.findSort('Formula').kind()
|
umaudemc/grapher.py
CHANGED
|
@@ -43,8 +43,8 @@ class DOTGrapher:
|
|
|
43
43
|
if bound == 0:
|
|
44
44
|
return
|
|
45
45
|
|
|
46
|
-
for next_state in graph.
|
|
47
|
-
elabel = self.elabel(
|
|
46
|
+
for next_state, edge in graph.getTransitions(stateNr):
|
|
47
|
+
elabel = self.elabel(edge) if self.elabel else None
|
|
48
48
|
self.write_transition(stateNr, next_state, elabel)
|
|
49
49
|
|
|
50
50
|
if next_state not in self.visited:
|
|
@@ -67,7 +67,8 @@ class PDOTGrapher(DOTGrapher):
|
|
|
67
67
|
num, den = Fraction(p).limit_denominator().as_integer_ratio()
|
|
68
68
|
|
|
69
69
|
# Standard labels are used too
|
|
70
|
-
|
|
70
|
+
stmt = graph.getTransition(start, end) if graph.strategyControlled else graph.getRule(start, end)
|
|
71
|
+
elabel = self.elabel(stmt)
|
|
71
72
|
|
|
72
73
|
return f'{num}/{den} {elabel}' if p != 1.0 else elabel
|
|
73
74
|
|
|
@@ -123,14 +124,14 @@ class TikZGrapher:
|
|
|
123
124
|
if bound == 0:
|
|
124
125
|
return
|
|
125
126
|
|
|
126
|
-
for next_state in graph.
|
|
127
|
+
for next_state, edge in graph.getTransitions(stateNr):
|
|
127
128
|
print(f'\t{self.printState(graph, stateNr)}', file=self.outfile, end='')
|
|
128
129
|
next_visited = next_state in self.visited
|
|
129
130
|
|
|
130
131
|
if self.elabel is None:
|
|
131
132
|
print(f' -> ', file=self.outfile, end='')
|
|
132
133
|
else:
|
|
133
|
-
label = str(self.elabel(
|
|
134
|
+
label = str(self.elabel(edge)).replace('"', '""')
|
|
134
135
|
print(f' ->["{label}"] ', file=self.outfile, end='')
|
|
135
136
|
|
|
136
137
|
print(f'{self.printState(graph, next_state)};', file=self.outfile)
|