-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
We realized that sometimes we want to inline everything besides one procedure and found that it is cumbersome to have to list everything that has to be inlined instead of listing what should remain as is. So we decided to add this to the current inline. We should have kept the previous use cases identical as supported by the fact that nothing broke while not touching any old ec files. In doing so, we also added the possibility to provide the name of a module leading to inlining all the procedure in this module. Finally, one can now provide the name of a procedure and it will inline all the procedures with that name regardless of the module in which they belong. As already mentioned, one can find examples at the following link. https://github.com/EasyCrypt/easycrypt/blob/deploy-inline/examples/tactics/inline.ec start with parsing pattern matching on inline add some examples fix
- Loading branch information
Showing
5 changed files
with
258 additions
and
55 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,128 @@ | ||
module F = { | ||
proc f () = { | ||
var r; | ||
|
||
r <- 0; | ||
} | ||
|
||
proc g () = { | ||
var s; | ||
|
||
s <- 1; | ||
} | ||
}. | ||
|
||
module G = { | ||
proc f () = { | ||
var t; | ||
|
||
F.g(); | ||
t <- 2; | ||
} | ||
|
||
proc g () = { | ||
var u; | ||
|
||
F.f(); | ||
u <- 3; | ||
} | ||
}. | ||
|
||
module Game = { | ||
proc main () = { | ||
F.f(); | ||
G.g(); | ||
F.g(); | ||
G.f(); | ||
} | ||
}. | ||
|
||
equiv inline_full_procedures : Game.main ~ Game.main : true ==> true. | ||
proof. | ||
proc. | ||
inline F.f G.g. | ||
admitted. | ||
|
||
equiv inline_star : Game.main ~ Game.main : true ==> true. | ||
proof. | ||
proc. | ||
inline *. | ||
admitted. | ||
|
||
equiv inline_blank : Game.main ~ Game.main : true ==> true. | ||
proof. | ||
proc. | ||
inline. | ||
admitted. | ||
|
||
equiv inline_module : Game.main ~ Game.main : true ==> true. | ||
proof. | ||
proc. | ||
inline F. | ||
admitted. | ||
|
||
equiv inline_procedure : Game.main ~ Game.main : true ==> true. | ||
proof. | ||
proc. | ||
inline f. | ||
admitted. | ||
|
||
equiv inline_minus_full_procedure : Game.main ~ Game.main : true ==> true. | ||
proof. | ||
proc. | ||
inline * - F.f. | ||
admitted. | ||
|
||
equiv inline_minus_procedure : Game.main ~ Game.main : true ==> true. | ||
proof. | ||
proc. | ||
inline * - f. | ||
admitted. | ||
|
||
equiv inline_minus_module : Game.main ~ Game.main : true ==> true. | ||
proof. | ||
proc. | ||
inline * - F. | ||
admitted. | ||
|
||
equiv inline_minuses : Game.main ~ Game.main : true ==> true. | ||
proof. | ||
proc. | ||
inline * - F - g. | ||
admitted. | ||
|
||
equiv inline_add_back : Game.main ~ Game.main : true ==> true. | ||
proof. | ||
proc. | ||
inline * - F F. | ||
admitted. | ||
|
||
equiv inline_remove_back : Game.main ~ Game.main : true ==> true. | ||
proof. | ||
proc. | ||
inline F - F. | ||
admitted. | ||
|
||
equiv inline_side : Game.main ~ Game.main : true ==> true. | ||
proof. | ||
proc. | ||
inline{1} *. | ||
admitted. | ||
|
||
equiv inline_occs : Game.main ~ Game.main : true ==> true. | ||
proof. | ||
proc. | ||
inline{1} (1 4). | ||
admitted. | ||
|
||
equiv inline_occs_pat : Game.main ~ Game.main : true ==> true. | ||
proof. | ||
proc. | ||
inline{1} (1 2) * - G. | ||
admitted. | ||
|
||
equiv inline_codepos : Game.main ~ Game.main : true ==> true. | ||
proof. | ||
proc. | ||
inline {1} 3. | ||
admitted. |
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
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
Oops, something went wrong.