Update bench.
[why3.git] / examples / gcd / main.ml
blob5c7035e80679834d95c0406bc7966f965cf82109
2 open Format
4 let () =
5 printf "%d@."
6 (EuclideanAlgorithm63.euclid (int_of_string Sys.argv.(1)) (int_of_string Sys.argv.(2)))
8 (*
9 let usage () =
10 eprintf "Reduction of combinator terms@.";
11 eprintf "Usage: %s <combinator term>@." Sys.argv.(0);
12 exit 2
14 let input =
15 if Array.length Sys.argv <> 2 then usage ();
16 Sys.argv.(1)
18 let input_term =
19 if input = "go" then
20 let i = Vstte12_combinators__Combinators.i in
21 Vstte12_combinators__Combinators.App(i,i)
22 else
23 try Parse.parse_term input
24 with _ ->
25 begin
26 eprintf "syntax error@.";
27 usage ()
28 end
30 let () =
31 let a = Vstte12_combinators__Combinators.reduction input_term in
32 printf "The normal form of %a is %a@."
33 Parse.pr input_term Parse.pr a