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
fa1fbd18
Commit
fa1fbd18
authored
9 years ago
by
Viktor Kuncak
Browse files
Options
Downloads
Patches
Plain Diff
small changes to demo
parent
87907e45
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
testcases/web/demos/001_Tutorial-Max.scala
+8
-2
8 additions, 2 deletions
testcases/web/demos/001_Tutorial-Max.scala
testcases/web/demos/003_Tutorial-Sort.scala
+1
-10
1 addition, 10 deletions
testcases/web/demos/003_Tutorial-Sort.scala
with
9 additions
and
12 deletions
testcases/web/demos/001_Tutorial-Max.scala
+
8
−
2
View file @
fa1fbd18
import
leon.lang._
import
leon.lang.synthesis._
import
leon.annotation._
object
Max
{
...
...
@@ -42,7 +41,8 @@ object Max {
max(x,y) == max(y,x) &&
max(x,max(y,z)) == max(max(x,y), z) &&
max(x,y) + z == max(x + z, y + z)
} holds
} ensuring(_ == true)
// holds
*/
/*
...
...
@@ -54,4 +54,10 @@ object Max {
} ensuring (res =>
x <= res && y <= res && (res == x || res == y))
*/
/*
def max(x: BigInt, y: BigInt): BigInt = {
???[BigInt]
} ensuring(res => (res == x || res == y) && x <= res && y <= res)
*/
}
This diff is collapsed.
Click to expand it.
testcases/web/demos/003_Tutorial-Sort.scala
+
1
−
10
View file @
fa1fbd18
import
leon.lang.
_
import
leon.lang.
Set
import
leon.lang.synthesis._
import
leon.annotation._
object
Sort
{
sealed
abstract
class
List
case
object
Nil
extends
List
case
class
Cons
(
head
:
BigInt
,
tail
:
List
)
extends
List
def
size
(
l
:
List
)
:
BigInt
=
(
l
match
{
case
Nil
=>
0
case
Cons
(
x
,
rest
)
=>
x
+
size
(
rest
)
})
ensuring
(
res
=>
res
>
0
)
def
s1
=
size
(
Cons
(
10
,
Cons
(
1000
,
Nil
)))
def
content
(
l
:
List
)
:
Set
[
BigInt
]
=
l
match
{
case
Nil
=>
Set
()
case
Cons
(
i
,
t
)
=>
Set
(
i
)
++
content
(
t
)
...
...
@@ -53,7 +45,6 @@ object Sort {
}
} ensuring {(res:List) =>
isSorted(res) && content(res) == content(l) ++ Set(x)}
// size(res) == size(l) + 1
*/
// We can also synthesize the body of sInsert interactively
...
...
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