Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Spot
Spot
Commits
302bafc4
Commit
302bafc4
authored
Feb 14, 2013
by
Elie Abi Saad
Committed by
Alexandre Duret-Lutz
Apr 15, 2013
Browse files
* bench/ltl2tgba/sum.py: Adjust.
parent
2e5e5d1e
Changes
1
Hide whitespace changes
Inline
Side-by-side
bench/ltl2tgba/sum.py
View file @
302bafc4
...
...
@@ -46,11 +46,13 @@ def process_file(filename):
data
=
json
.
load
(
open
(
filename
))
ncols
=
len
(
data
[
'fields'
])
ntools
=
len
(
data
[
'tool
s
'
])
ntools
=
len
(
data
[
'tool'
])
datacols
=
range
(
2
,
ncols
)
fields
=
{
name
:
index
for
index
,
name
in
enumerate
(
data
[
"fields"
])
}
toolcol
=
fields
[
'tool'
]
inputcol
=
fields
[
'input'
]
inputcol
=
fields
[
'formula'
]
inputs
=
data
[
"inputs"
]
# Index results by tool, then input
results
=
{
t
:{}
for
t
in
range
(
0
,
ntools
)
}
...
...
@@ -59,9 +61,9 @@ def process_file(filename):
for
i
in
range
(
0
,
ntools
):
# Remove any leading directory, and trailing %...
name
=
data
[
"tool
s
"
][
i
]
name
=
data
[
"tool"
][
i
]
name
=
name
[
name
.
rfind
(
'/'
,
0
,
name
.
find
(
' '
))
+
1
:]
data
[
"tool
s
"
][
i
]
=
latex_escape
(
name
[
0
:
name
.
find
(
'%'
)])
data
[
"tool"
][
i
]
=
latex_escape
(
name
[
0
:
name
.
find
(
'%'
)])
print
(
r
'''
\section*{\texttt{%s}}
...
...
@@ -76,7 +78,7 @@ def process_file(filename):
(
sum
([
x
[
j
]
for
x
in
results
[
i
].
values
()]))
for
j
in
datacols
]
print
(
"
\\
texttt{%-18s} & %3d & "
%
(
data
[
"tool
s
"
][
i
],
len
(
results
[
i
])),
" & "
.
join
(
sums
),
"
\\\\
"
)
%
(
data
[
"tool"
][
i
],
len
(
results
[
i
])),
" & "
.
join
(
sums
),
"
\\\\
"
)
print
(
r
'\end{tabular}'
)
print
(
r
'''\subsection*{Cross comparison}
...
...
@@ -88,7 +90,7 @@ states and more transitions.
'''
)
header
=
'
\\
begin{tabular}{l'
for
i
in
data
[
"tool
s
"
]:
for
i
in
data
[
"tool"
]:
header
+=
'c'
header
+=
'}'
...
...
@@ -96,11 +98,11 @@ states and more transitions.
transcol
=
fields
[
'transitions'
]
print
(
header
)
for
left
in
data
[
"tool
s
"
]:
for
left
in
data
[
"tool"
]:
print
(
"&"
,
rot
(
"
\\
texttt{%s}"
%
left
),
end
=
' '
)
print
(
r
'\\'
)
for
left
in
range
(
0
,
ntools
):
print
(
"
\\
texttt{%-18s}"
%
data
[
"tool
s
"
][
left
],
end
=
' '
)
print
(
"
\\
texttt{%-18s}"
%
data
[
"tool"
][
left
],
end
=
' '
)
for
top
in
range
(
0
,
ntools
):
x
=
0
for
k
,
ct
in
results
[
top
].
items
():
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment