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
7fbb9a55
Commit
7fbb9a55
authored
13 years ago
by
Régis Blanc
Browse files
Options
Downloads
Patches
Plain Diff
add WayPoint expr
parent
2b4481f0
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/main/scala/leon/CallGraph.scala
+39
-0
39 additions, 0 deletions
src/main/scala/leon/CallGraph.scala
src/main/scala/leon/purescala/Trees.scala
+4
-0
4 additions, 0 deletions
src/main/scala/leon/purescala/Trees.scala
with
43 additions
and
0 deletions
src/main/scala/leon/CallGraph.scala
+
39
−
0
View file @
7fbb9a55
...
@@ -26,5 +26,44 @@ class CallGraph(val program: Program) {
...
@@ -26,5 +26,44 @@ class CallGraph(val program: Program) {
null
null
}
}
// def hoistIte(expr: Expr): Expr = expr match {
// case ite@IfExpr(c, t, e) => IfExpr(c, hoistIte(t), hoistIte(e)).setType(ite.getType)
// case BinaryOperator(t1, t2) =>
//
// }
//def analyse(program: Program) {
// z3Solver.setProgram(program)
// reporter.info("Running test generation")
// val allFuns = program.definedFunctions
// allFuns.foreach(fd => {
// val testcases = generateTestCases(fd)
// reporter.info("Running " + fd.id + " with the following testcases:\n")
// reporter.info(testcases.mkString("\n"))
// })
//}
//private def generatePathConditions(funDef: FunDef): Seq[Expr] = if(!funDef.hasImplementation) Seq() else {
// val body = funDef.body.get
// val cleanBody = expandLets(matchToIfThenElse(body))
// collectWithPathCondition(cleanBody)
//}
//// prec: there should be no lets and no pattern-matching in this expression
// private def collectWithPathCondition(expression: Expr): Seq[Expr] = {
// var allPaths: Seq[Expr] = Seq()
// def rec(expr: Expr, path: Expr): Seq[Expr] = expr match {
// case IfExpr(cond, then, elze) =>
// (if(!containsIfExpr(then)) Seq(And(path, cond)) else rec(then, And(cond, path))) ++
// (if(!containsIfExpr(elze)) Seq(And(path, Not(cond))) else rec(then, And(cond, path)))
// case NAryOperator(args, _) => args.flatMap(arg => rec(arg, path))
// case BinaryOperator(t1, t2, _) => rec(t1, path) ++ rec(t2, path)
// case UnaryOperator(t, _) => rec(t, path)
// case t : Terminal => Seq()
// case _ => scala.sys.error("Unhandled tree in collectWithPathCondition : " + expr)
// }
// rec(expression, BooleanLiteral(true)).distinct
//}
}
}
This diff is collapsed.
Click to expand it.
src/main/scala/leon/purescala/Trees.scala
+
4
−
0
View file @
7fbb9a55
...
@@ -85,6 +85,8 @@ object Trees {
...
@@ -85,6 +85,8 @@ object Trees {
}
}
case
class
TupleSelect
(
tuple
:
Expr
,
index
:
Int
)
extends
Expr
case
class
TupleSelect
(
tuple
:
Expr
,
index
:
Int
)
extends
Expr
case
class
WayPoint
(
expr
:
Expr
)
extends
Expr
object
MatchExpr
{
object
MatchExpr
{
def
apply
(
scrutinee
:
Expr
,
cases
:
Seq
[
MatchCase
])
:
MatchExpr
=
{
def
apply
(
scrutinee
:
Expr
,
cases
:
Seq
[
MatchCase
])
:
MatchExpr
=
{
scrutinee
.
getType
match
{
scrutinee
.
getType
match
{
...
@@ -154,6 +156,7 @@ object Trees {
...
@@ -154,6 +156,7 @@ object Trees {
case
class
TuplePattern
(
binder
:
Option
[
Identifier
],
subPatterns
:
Seq
[
Pattern
])
extends
Pattern
case
class
TuplePattern
(
binder
:
Option
[
Identifier
],
subPatterns
:
Seq
[
Pattern
])
extends
Pattern
/* Propositional logic */
/* Propositional logic */
object
And
{
object
And
{
def
apply
(
l
:
Expr
,
r
:
Expr
)
:
Expr
=
(
l
,
r
)
match
{
def
apply
(
l
:
Expr
,
r
:
Expr
)
:
Expr
=
(
l
,
r
)
match
{
...
@@ -439,6 +442,7 @@ object Trees {
...
@@ -439,6 +442,7 @@ object Trees {
case
ArrayLength
(
a
)
=>
Some
((
a
,
ArrayLength
))
case
ArrayLength
(
a
)
=>
Some
((
a
,
ArrayLength
))
case
ArrayClone
(
a
)
=>
Some
((
a
,
ArrayClone
))
case
ArrayClone
(
a
)
=>
Some
((
a
,
ArrayClone
))
case
ArrayMake
(
t
)
=>
Some
((
t
,
ArrayMake
))
case
ArrayMake
(
t
)
=>
Some
((
t
,
ArrayMake
))
case
WayPoint
(
t
)
=>
Some
((
t
,
WayPoint
))
case
e
@Epsilon
(
t
)
=>
Some
((
t
,
(
expr
:
Expr
)
=>
Epsilon
(
expr
).
setType
(
e
.
getType
).
setPosInfo
(
e
)))
case
e
@Epsilon
(
t
)
=>
Some
((
t
,
(
expr
:
Expr
)
=>
Epsilon
(
expr
).
setType
(
e
.
getType
).
setPosInfo
(
e
)))
case
_
=>
None
case
_
=>
None
}
}
...
...
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