Skip to content

Commit

Permalink
Merge pull request #41 from SoftwareFoundationGroupAtKyotoU/feature/c…
Browse files Browse the repository at this point in the history
…all-mochi

[WIP] Call MoCHi automatically
  • Loading branch information
artoy authored Mar 21, 2024
2 parents c44a49a + 088f7ee commit b17ea89
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 2 deletions.
Empty file removed src/callMoCHi.ml
Empty file.
5 changes: 4 additions & 1 deletion src/consort.ml
Original file line number Diff line number Diff line change
Expand Up @@ -242,5 +242,8 @@ let convmochi ~opts file =
((function Some x -> x | None -> assert false) ownership_res)
ast
in
ConvMoCHi.Mochi.print_prog prog;
(* ConvMoCHi.Mochi.print_prog prog; *)
let file = open_out "./test/to_mochi.ml" in
ConvMoCHi.Mochi.write_to_channel_prog prog file;
Out_channel.close file;
match ownership_res with None -> Unverified Aliasing | Some _ -> Verified
4 changes: 4 additions & 0 deletions src/convMoCHi.ml
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,10 @@ module Mochi = struct
let print_prog prog =
print_endline builtin;
pp_prog prog std_formatter

let write_to_channel_prog prog file =
Printf.fprintf file "%s\n" builtin;
pp_prog prog (Format.formatter_of_out_channel file);
end

let pull_type ty con i =
Expand Down
3 changes: 2 additions & 1 deletion src/test/list/reverse2.imp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ mklist(n) {
_reverse(l, l_next) {
match l_next with
Nil -> {
// FIXME: this alias statement is (maybe) wrong
// alias(*(l.Cons.2) = l_next);
return l
}
Expand Down Expand Up @@ -51,4 +52,4 @@ len(l) {
let len_l = len(l) in
let rev_l = reverse(l) in
assert(len_l = len(rev_l))
}
}

0 comments on commit b17ea89

Please sign in to comment.