-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Monad-thunk every nontrivial nontac_expr (#19)
- Loading branch information
Showing
7 changed files
with
83 additions
and
27 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
CAMLPKGS:=-package coq-core.plugins.ltac2 |
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,21 @@ | ||
From Ltac2 Require Import Ltac2 Printf. | ||
|
||
From Ltac2Compiler Require Import Ltac2Compiler. | ||
|
||
Declare ML Module "compiler-bugs.compiler_bug_17". | ||
|
||
Ltac2 @ external push : unit -> int := "compiler-bugs.compiler_bug_17" "push". | ||
Ltac2 @ external pop : int -> unit := "compiler-bugs.compiler_bug_17" "pop". | ||
Ltac2 @ external reset : unit -> unit := "compiler-bugs.compiler_bug_17" "reset". | ||
|
||
Ltac2 test2 () := | ||
let outer := push () in | ||
let inner := push () in | ||
ltac1:(assert False) > | ||
[pop inner; pop outer|let outer := push () in pop outer]. | ||
|
||
Ltac2 Compile test2. | ||
|
||
Goal True /\ True. | ||
test2 (). | ||
Abort. |
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,10 @@ | ||
package "compiler_bug_17" ( | ||
directory = "." | ||
version = "dev" | ||
requires = "coq-core.plugins.ltac2" | ||
archive(byte) = "compiler_bug_17_plugin.cma" | ||
archive(native) = "compiler_bug_17_plugin.cmxa" | ||
plugin(byte) = "compiler_bug_17_plugin.cma" | ||
plugin(native) = "compiler_bug_17_plugin.cmxs" | ||
) | ||
directory = "." |
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,20 @@ | ||
open Ltac2_plugin | ||
open Tac2ffi | ||
open Tac2expr | ||
open Tac2externals | ||
|
||
let define s = define { mltac_plugin = "compiler-bugs.compiler_bug_17"; mltac_tactic = s } | ||
|
||
let state : int ref = Summary.ref ~name:"tac2compile_bug17" 0 | ||
let push : unit -> int = fun () -> | ||
state := 1 + !state; !state | ||
let pop : int -> unit = fun i -> | ||
if i == !state then | ||
state := i - 1 | ||
else | ||
raise Not_found | ||
let reset : unit -> unit = fun _ -> state := 0 | ||
|
||
let _ = define "push" (unit @-> ret int) push | ||
let _ = define "pop" (int @-> ret unit) pop | ||
let _ = define "reset" (unit @-> ret unit) reset |
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 @@ | ||
Compiler_bug_17 |