-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
fdbf2c5
commit 4ebee59
Showing
11 changed files
with
125 additions
and
151 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
57 changes: 31 additions & 26 deletions
57
examples/src/main/scala/soda/example/forlean/algorithms/RecursionForLean.lean
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
58 changes: 27 additions & 31 deletions
58
examples/src/main/scala/soda/example/forlean/algorithms/RecursionForLean.soda
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 5 additions & 14 deletions
19
examples/src/main/scala/soda/example/forlean/algorithms/SwapExample.soda
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,24 @@ | ||
|
||
directive coq | ||
Definition Nat : Type := nat . | ||
|
||
class PairExample | ||
|
||
abstract | ||
left : Nat | ||
right : Nat | ||
left : Int | ||
right : Int | ||
|
||
end | ||
|
||
class SwapExample | ||
|
||
abstract | ||
|
||
swap (pair : PairExample) : PairExample = | ||
PairExample_ (pair .right) (pair .left) | ||
|
||
directive lean | ||
theorem | ||
swap_of_swap (x : Nat) (y : Nat) : (swap (swap (PairExample_ (x) (y) ) ) ) = PairExample_ (x) (y) := | ||
swap_of_swap (x : Int) (y : Int) : (swap (swap (PairExample_ (x) (y) ) ) ) = PairExample_ (x) (y) := | ||
by | ||
constructor | ||
|
||
directive coq | ||
Theorem | ||
swap_of_swap : forall (x : nat) (y : nat) , (swap (swap (PairExample_ (x) (y) ) ) ) = | ||
PairExample_ (x) (y) . | ||
Proof. | ||
auto. | ||
Qed. | ||
|
||
end | ||
|
Oops, something went wrong.