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
64b75637
Commit
64b75637
authored
8 years ago
by
Mikaël Mayer
Committed by
Ravi
8 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Added the function invocation coverage.
parent
936eed24
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/main/scala/leon/synthesis/disambiguation/InputCoverage.scala
+19
-8
19 additions, 8 deletions
...n/scala/leon/synthesis/disambiguation/InputCoverage.scala
with
19 additions
and
8 deletions
src/main/scala/leon/synthesis/disambiguation/InputCoverage.scala
+
19
−
8
View file @
64b75637
...
@@ -17,8 +17,8 @@ import bonsai.enumerators.MemoizedEnumerator
...
@@ -17,8 +17,8 @@ import bonsai.enumerators.MemoizedEnumerator
import
solvers.Model
import
solvers.Model
import
solvers.ModelBuilder
import
solvers.ModelBuilder
import
scala.collection.mutable.ListBuffer
import
scala.collection.mutable.ListBuffer
import
leon.LeonContext
import
leon.LeonContext
import
leon.purescala.Definitions.TypedFunDef
/**
/**
* @author Mikael
* @author Mikael
...
@@ -63,6 +63,7 @@ class InputCoverage(fd: FunDef, fds: Set[FunDef])(implicit c: LeonContext, p: Pr
...
@@ -63,6 +63,7 @@ class InputCoverage(fd: FunDef, fds: Set[FunDef])(implicit c: LeonContext, p: Pr
}).
unzip
// TODO: Check for unapply with function pattern ?
}).
unzip
// TODO: Check for unapply with function pattern ?
(
MatchExpr
(
c1
,
new_cases
).
copiedFrom
(
e
),
variables
.
flatten
)
(
MatchExpr
(
c1
,
new_cases
).
copiedFrom
(
e
),
variables
.
flatten
)
case
Operator
(
lhsrhs
,
builder
)
=>
case
Operator
(
lhsrhs
,
builder
)
=>
// The exprBuilder adds variable definitions needed to compute the arguments.
val
(
exprBuilder
,
children
,
ids
)
=
(((
e
:
Expr
)
=>
e
,
List
[
Expr
](),
ListBuffer
[
Identifier
]())
/:
lhsrhs
)
{
val
(
exprBuilder
,
children
,
ids
)
=
(((
e
:
Expr
)
=>
e
,
List
[
Expr
](),
ListBuffer
[
Identifier
]())
/:
lhsrhs
)
{
case
((
exprBuilder
,
children
,
ids
),
arg
)
=>
case
((
exprBuilder
,
children
,
ids
),
arg
)
=>
val
(
arg1
,
argv1
)
=
markBranches
(
arg
)
val
(
arg1
,
argv1
)
=
markBranches
(
arg
)
...
@@ -75,13 +76,23 @@ class InputCoverage(fd: FunDef, fds: Set[FunDef])(implicit c: LeonContext, p: Pr
...
@@ -75,13 +76,23 @@ class InputCoverage(fd: FunDef, fds: Set[FunDef])(implicit c: LeonContext, p: Pr
(
exprBuilder
,
arg
::
children
,
ids
)
(
exprBuilder
,
arg
::
children
,
ids
)
}
}
}
}
if
(
e
.
isInstanceOf
[
FunctionInvocation
])
{
e
match
{
// Should be different.
case
FunctionInvocation
(
TypedFunDef
(
fd
,
targs
),
args
)
=>
}
else
if
(
ids
.
isEmpty
)
{
// Should be different since functions will return a boolean as well.
(
e
,
Seq
.
empty
)
val
res_id
=
FreshIdentifier
(
"res"
,
fd
.
returnType
)
}
else
{
val
res_b
=
FreshIdentifier
(
"b"
,
BooleanType
)
val
body
=
tupleWrap
(
Seq
(
builder
(
children
).
copiedFrom
(
e
),
or
(
ids
.
map
(
Variable
)
:
_
*
)))
val
finalIds
=
(
ids
:+
res_b
)
(
exprBuilder
(
body
),
ids
)
val
finalExpr
=
tupleWrap
(
Seq
(
Variable
(
res_id
),
or
(
finalIds
.
map
(
Variable
(
_
))
:
_
*
)))
val
funCall
=
letTuple
(
Seq
(
res_id
,
res_b
),
builder
(
children
).
copiedFrom
(
e
),
finalExpr
)
(
exprBuilder
(
funCall
),
finalIds
)
case
_
=>
if
(
ids
.
isEmpty
)
{
(
e
,
Seq
.
empty
)
}
else
{
val
finalExpr
=
tupleWrap
(
Seq
(
builder
(
children
).
copiedFrom
(
e
),
or
(
ids
.
map
(
Variable
)
:
_
*
)))
(
exprBuilder
(
finalExpr
),
ids
)
}
}
}
}
}
...
...
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