-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The tactic `alias $name := $pattern @ $pos` alias the $pattern (subject to matching) in the instruction targetted by $pos using a fresh program variable $name. The tactic does not apply to the expression contained in the condition of a while loop.
- Loading branch information
Showing
11 changed files
with
141 additions
and
28 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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,26 @@ | ||
(* -------------------------------------------------------------------- *) | ||
open EcParsetree | ||
open EcTypes | ||
open EcSymbols | ||
open EcAst | ||
open EcCoreGoal.FApi | ||
open EcMatching.Position | ||
open EcMatching | ||
open EcUnify | ||
|
||
(* -------------------------------------------------------------------- *) | ||
val t_kill : oside -> codepos -> int option -> backward | ||
val t_alias : oside -> codepos -> psymbol option -> backward | ||
val t_set : oside -> codepos -> bool * psymbol -> expr -> backward | ||
val t_cfold : oside -> codepos -> int option -> backward | ||
val t_kill : oside -> codepos -> int option -> backward | ||
val t_alias : oside -> codepos -> psymbol option -> backward | ||
val t_set : oside -> codepos -> bool * psymbol -> expr -> backward | ||
val t_set_match : oside -> codepos -> symbol -> unienv * mevmap * form -> backward | ||
val t_cfold : oside -> codepos -> int option -> backward | ||
|
||
(* -------------------------------------------------------------------- *) | ||
val process_kill : oside * pcodepos * int option -> backward | ||
val process_alias : oside * pcodepos * psymbol option -> backward | ||
val process_set : oside * pcodepos * bool * psymbol * pexpr -> backward | ||
val process_cfold : oside * pcodepos * int option -> backward | ||
val process_case : oside * pcodepos -> backward | ||
val process_kill : oside * pcodepos * int option -> backward | ||
val process_alias : oside * pcodepos * psymbol option -> backward | ||
val process_set : oside * pcodepos * bool * psymbol * pexpr -> backward | ||
val process_set_match : oside * pcodepos * psymbol * pformula -> backward | ||
val process_cfold : oside * pcodepos * int option -> backward | ||
val process_case : oside * pcodepos -> backward | ||
|
||
(* -------------------------------------------------------------------- *) | ||
val process_weakmem : (oside * psymbol * fun_params) -> backward |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
require import AllCore. | ||
|
||
op foo : int -> int. | ||
op bar : int -> int distr. | ||
|
||
module M = { | ||
proc f() : int = { | ||
return 0; | ||
} | ||
|
||
proc g() = { | ||
var x : int; | ||
|
||
x <- foo (5 + 3); | ||
x <$ bar (x + 2); | ||
|
||
while (2 * x < 4) { | ||
} | ||
|
||
x <@ f(); | ||
} | ||
}. | ||
|
||
|
||
lemma L : hoare[M.g : true ==> true]. | ||
proof. | ||
proc. | ||
alias c := (_ + 3) @ 1. | ||
alias d := (x + _) @ 3. | ||
|
||
fail alias e := (_ * x) @ ^ while. | ||
fail alias e := 3 @ ^ <@. | ||
abort. |