-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement and verify the naive translation of lazy/force to thunks (#98)
* Implement and verify the naive translation of lazy/force to thunks based on the latest metacoq. Add a lazy factorial test in the benchmarks * Fix build instructions to use metacoq submodule * Fix build.yml? * Point to the right metacoq dev version in the opam file * Forgot one file
- Loading branch information
Showing
9 changed files
with
150 additions
and
41 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 |
---|---|---|
|
@@ -5,4 +5,5 @@ vs_easy | |
vs_hard | ||
binom | ||
color | ||
sha_fast | ||
sha_fast | ||
lazy_factorial |
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,35 @@ | ||
#include <stdio.h> | ||
#include <stdlib.h> | ||
#include "gc_stack.h" | ||
#include <time.h> | ||
|
||
extern value body(struct thread_info *); | ||
|
||
int main(int argc, char *argv[]) { | ||
value val; | ||
struct thread_info* tinfo; | ||
clock_t start, end; | ||
double msec, sec; | ||
|
||
// Specify number of runs | ||
int n = 1; | ||
if (argc > 1) n = atoi(argv[1]); | ||
|
||
start = clock(); | ||
// Run Coq program | ||
for (int i = 0; i < n; i ++) { | ||
tinfo = make_tinfo(); | ||
body(tinfo); | ||
} | ||
end = clock(); | ||
|
||
/* TODO write string printers */ | ||
/* print_Coq_Init_Datatypes_list(val, print_Coq_Init_Datatypes_bool); */ | ||
/* printf("\n"); */ | ||
|
||
sec = (double)(end - start)/CLOCKS_PER_SEC; | ||
msec = 1000*sec; | ||
printf("Time taken %f seconds %f milliseconds\n", sec, msec); | ||
|
||
return 0; | ||
} |
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
Submodule metacoq
updated
19 files
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