Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
lisa
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
lisa
Commits
9dcd3b12
Unverified
Commit
9dcd3b12
authored
1 year ago
by
Simon Guilloud
Committed by
GitHub
1 year ago
Browse files
Options
Downloads
Patches
Plain Diff
Small lattices changes (#205)
Minor fix to Lattices tutorial
parent
fe84b0b5
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
lisa-examples/src/main/scala/Lattices.scala
+21
-14
21 additions, 14 deletions
lisa-examples/src/main/scala/Lattices.scala
with
21 additions
and
14 deletions
lisa-examples/src/main/scala/Lattices.scala
+
21
−
14
View file @
9dcd3b12
...
...
@@ -76,15 +76,15 @@ object Lattices extends lisa.Main {
(
left
,
right
)
match
{
// 1. left is a join. In that case, lub gives us the decomposition
case
(
u
(
a
:
Term
,
b
:
Term
),
_
)
=>
val
s1
=
solve
(
a
<=
right
)
val
s2
=
solve
(
b
<=
right
)
if
s1
.
isValid
&
s2
.
isValid
then
have
(
left
<=
right
)
by
Tautology
.
from
(
lub
of
(
x
:=
a
,
y
:=
b
,
z
:=
right
),
have
(
s1
),
have
(
s2
))
else
return
proof
.
InvalidProofTactic
(
"The inequality is not true in general "
)
???
// 2. right is a meet. In that case, glb gives us the decomposition
case
(
_
,
n
(
a
:
Term
,
b
:
Term
))
=>
???
val
s1
=
solve
(
left
<=
a
)
val
s2
=
solve
(
left
<=
b
)
if
s1
.
isValid
&
s2
.
isValid
then
have
(
left
<=
right
)
by
Tautology
.
from
(
glb
of
(
x
:=
a
,
y
:=
b
,
z
:=
left
),
have
(
s1
),
have
(
s2
))
else
return
proof
.
InvalidProofTactic
(
"The inequality is not true in general "
)
// 3. left is a meet, right is a join. In that case, we try all pairs.
case
(
n
(
a
:
Term
,
b
:
Term
),
u
(
c
:
Term
,
d
:
Term
))
=>
...
...
@@ -111,7 +111,6 @@ object Lattices extends lisa.Main {
}
if
result
.
isEmpty
then
return
proof
.
InvalidProofTactic
(
"The inequality is not true in general 3"
)
// 4. left is a meet, right is a variable or unknown term.
case
(
n
(
a
:
Term
,
b
:
Term
),
_
)
=>
val
result
=
LazyList
(
a
,
b
)
...
...
@@ -123,18 +122,27 @@ object Lattices extends lisa.Main {
meetUpperBound
of
(
x
:=
a
,
y
:=
b
),
transitivity
of
(
x
:=
left
,
y
:=
e
,
z
:=
right
)
)
}
if
result
.
isEmpty
then
return
proof
.
InvalidProofTactic
(
"The inequality is not true in general"
)
// 5. left is a variable or unknown term, right is a join.
case
(
_
,
u
(
c
:
Term
,
d
:
Term
))
=>
???
val
result
=
LazyList
(
c
,
d
)
.
map
{
e
=>
(
e
,
solve
(
left
<=
e
))
}
.
find
{
_
.
_2
.
isValid
}
.
map
{
case
(
e
,
step
)
=>
have
(
left
<=
right
)
by
Tautology
.
from
(
have
(
step
),
joinLowerBound
of
(
x
:=
c
,
y
:=
d
),
transitivity
of
(
x
:=
left
,
y
:=
e
,
z
:=
right
)
)
}
if
result
.
isEmpty
then
return
proof
.
InvalidProofTactic
(
"The inequality is not true in general"
)
// 6. left and right are variables or unknown terms.
case
_
=>
if
!(
left
==
right
)
then
return
proof
.
InvalidProofTactic
(
"The inequality is not true in general 6"
)
else
???
else
have
(
left
<=
right
)
by
Restate
.
from
(
reflexivity
of
(
x
:=
left
))
}
}
...
...
@@ -180,7 +188,6 @@ object Lattices extends lisa.Main {
val semiDistributivity = Theorem((x u (y n z)) <= ((x u y) n (x u z))) {
have(thesis) by Whitman.solve
}
*/
}
*/
}
\ No newline at end of file
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