Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Why3
why3
Commits
c61605e4
Commit
c61605e4
authored
Jul 20, 2010
by
Simon Cruanes
Browse files
amélioration du script de statistiques
parent
0e5d3f39
Changes
2
Hide whitespace changes
Inline
Side-by-side
comparison/lib.py
View file @
c61605e4
...
...
@@ -24,6 +24,24 @@ def diff(cursor, prover1, prover2):
return
[]
def
superior
(
cursor
,
prover1
,
prover2
):
"trouve les (file,goal) pour lesquels prover1 > prover2"
query
=
"""SELECT distinct r1.file, r1.goal
FROM runs r1 JOIN runs r2
WHERE r1.prover = "%s" AND r2.prover = "%s"
AND r1.result = "Valid"
AND r2.result = "Timeout"
AND r1.file = r2.file AND r1.goal = r2.goal
"""
%
(
prover1
,
prover2
)
try
:
result
=
cursor
.
execute
(
query
)
return
result
.
fetchall
()
except
Exception
,
e
:
print
>>
sys
.
stderr
,
"exception :"
,
repr
(
e
)
return
None
def
print_columns
(
lines
,
sep
=
"."
):
...
...
@@ -47,3 +65,10 @@ def print_columns(lines, sep = "."):
def
print_sep
():
"affiche une ligne de '-' pour séparer clairement des sections de l'affichage"
print
"---------------------------------------------------------------"
def
erase_line
(
stream
=
sys
.
stdout
):
"efface la ligne et revient au début"
stream
.
write
(
"
\033
[2K
\r
"
)
stream
.
flush
()
comparison/stats.py
View file @
c61605e4
...
...
@@ -57,3 +57,42 @@ for prover in provers:
table
.
append
(
entry
)
lib
.
print_columns
(
table
,
sep
=
" "
)
# trouver quels prouveurs sont supérieurs les uns aux autres
lib
.
print_sep
()
order
=
{}
for
p1
,
p2
in
[(
p1
,
p2
)
for
p1
in
provers
for
p2
in
provers
if
p1
!=
p2
]:
print
"compare"
,
p1
,
p2
,
sys
.
stdout
.
flush
()
sups
=
lib
.
superior
(
cursor
,
p1
,
p2
)
# effacer la ligne
lib
.
erase_line
()
order
[
(
p1
,
p2
)
]
=
len
(
sups
)
print
"
\n
"
# affiche l'ordre partiel
table
=
[
[
"prouveur1"
,
">"
,
"prouveur2"
,
"de"
,
"nombre de tasks"
]
]
for
((
p1
,
p2
),
num
)
in
order
.
iteritems
():
table
.
append
(
[
p1
,
""
,
p2
,
""
,
unicode
(
num
)]
)
def
getKey
(
x
):
try
:
return
int
(
x
[
4
])
except
:
return
0
table
.
sort
(
key
=
getKey
)
lib
.
print_columns
(
table
,
sep
=
" "
)
# TODO : afficher un tableau
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a 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