Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
inox
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
LARA
inox
Commits
5508ff4f
Commit
5508ff4f
authored
12 years ago
by
Etienne Kneuss
Browse files
Options
Downloads
Patches
Plain Diff
Add benchmarking script for CEGIS
parent
1b42b2c1
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/test/scala/leon/benchmark/SynthesisBenchmarks.scala
+102
-0
102 additions, 0 deletions
src/test/scala/leon/benchmark/SynthesisBenchmarks.scala
testcases/synthesis/PrimeHeuristic.scala.off
+0
-0
0 additions, 0 deletions
testcases/synthesis/PrimeHeuristic.scala.off
with
102 additions
and
0 deletions
src/test/scala/leon/benchmark/SynthesisBenchmarks.scala
0 → 100644
+
102
−
0
View file @
5508ff4f
package
leon.benchmark
import
leon._
import
leon.purescala.Definitions._
import
leon.purescala.Trees._
import
leon.purescala.TreeOps._
import
leon.solvers.z3._
import
leon.solvers.Solver
import
leon.synthesis._
import
leon.test.synthesis._
import
java.io.File
object
SynthesisBenchmarks
extends
App
{
private
def
forEachFileIn
(
dirName
:
String
)(
block
:
File
=>
Unit
)
{
import
scala.collection.JavaConversions._
for
(
f
<-
(
new
File
(
dirName
)).
listFiles
()
if
f
.
getPath
().
endsWith
(
".scala"
))
{
block
(
f
)
}
}
val
infoSep
:
String
=
"╟"
+
(
"┄"
*
86
)
+
"╢"
val
infoFooter
:
String
=
"╚"
+
(
"═"
*
86
)
+
"╝"
val
infoHeader
:
String
=
". ┌────────────┐\n"
+
"╔═╡ Benchmarks ╞"
+
(
"═"
*
71
)
+
"╗\n"
+
"║ └────────────┘"
+
(
" "
*
71
)
+
"║"
def
infoLine
(
file
:
String
,
f
:
String
,
ts
:
Long
,
nAlt
:
Int
,
nSuccess
:
Int
,
nInnap
:
Int
,
nDecomp
:
Int
)
:
String
=
{
"║ %-30s %-24s %3d %10s %10s ms ║"
.
format
(
file
,
f
,
nAlt
,
nSuccess
+
"/"
+
nInnap
+
"/"
+
nDecomp
,
ts
)
}
println
(
infoHeader
)
var
nSuccessTotal
,
nInnapTotal
,
nDecompTotal
,
nAltTotal
=
0
var
tTotal
:
Long
=
0
forEachFileIn
(
"testcases/synthesis/"
)
{
file
=>
val
ctx
=
LeonContext
(
settings
=
Settings
(
synthesis
=
true
,
xlang
=
false
,
verify
=
false
),
files
=
List
(
file
),
reporter
=
new
DefaultReporter
)
val
opts
=
SynthesizerOptions
()
val
pipeline
=
leon
.
plugin
.
ExtractionPhase
andThen
ExtractProblemsPhase
val
(
results
,
solver
)
=
pipeline
.
run
(
ctx
)(
file
.
getPath
::
Nil
)
val
sctx
=
SynthesisContext
(
solver
,
new
SilentReporter
)
for
((
f
,
ps
)
<-
results
;
p
<-
ps
)
{
val
ts
=
System
.
currentTimeMillis
val
rr
=
rules
.
CEGIS
.
attemptToApplyOn
(
sctx
,
p
)
val
nAlt
=
rr
.
alternatives
.
size
var
nSuccess
,
nInnap
,
nDecomp
=
0
for
(
alt
<-
rr
.
alternatives
)
{
alt
.
apply
()
match
{
case
RuleApplicationImpossible
=>
nInnap
+=
1
case
s
:
RuleDecomposed
=>
nDecomp
+=
1
case
s
:
RuleSuccess
=>
nSuccess
+=
1
}
}
val
t
=
System
.
currentTimeMillis
-
ts
nAltTotal
+=
nAlt
tTotal
+=
t
nSuccessTotal
+=
nSuccess
nInnapTotal
+=
nInnap
nDecompTotal
+=
nDecomp
println
(
infoLine
(
file
.
getName
().
toString
,
f
.
id
.
toString
,
t
,
nAlt
,
nSuccess
,
nInnap
,
nDecomp
))
}
println
(
infoSep
)
}
println
(
infoLine
(
"TOTAL"
,
""
,
tTotal
,
nAltTotal
,
nSuccessTotal
,
nInnapTotal
,
nDecompTotal
))
println
(
infoFooter
)
}
This diff is collapsed.
Click to expand it.
testcases/synthesis/PrimeHeuristic.scala
→
testcases/synthesis/PrimeHeuristic.scala
.off
+
0
−
0
View file @
5508ff4f
File moved
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment