Commit d920b8a3 authored by POTTIER Francois's avatar POTTIER Francois

Remove [fa] and the micro-benchmark of [fa] versus [fa'].

Rename [fa'] to [fa].
parent 63bf579d
......@@ -97,14 +97,6 @@ let print_fa t =
let () =
evaluate print_fa
let print_fa' t =
printf "fa'(%a) = %a\n%!"
nhprint t
Atom.Set.print (fa' t)
let () =
evaluate print_fa'
let print_subst1 u x t =
let t' = subst_term_term1 u x t in
printf "substituting %a for %a in %a = ...\n %a\n%s\n%!"
......@@ -150,27 +142,9 @@ let () =
evaluate print_wf;
print_wf (TApp (id, id))
module Bench = Core_bench.Std.Bench
module Command = Core.Std.Command
let run tests =
let tests =
List.map (fun (name, test) -> Bench.Test.create ~name test) tests
in
Command.run (Bench.make_command tests)
let () =
let tests = ref [] in
for i = 0 to 9 do
let t = import_term KitImport.empty (generate 100000) in
let test_fa =
sprintf "fa(t%d)" i,
fun () -> ignore (fa t)
and test_fa' =
sprintf "fa'(t%d)" i,
fun () -> ignore (fa' t)
in
tests := test_fa :: test_fa' :: !tests
done;
let tests = List.rev !tests in
run tests
for _i = 0 to 9 do
let t = import_term KitImport.empty (generate 15) in
printf "generate() = %a\n%!"
hprint t
done
......@@ -5,5 +5,4 @@ true: \
package(pprint), \
package(visitors.ppx), \
package(visitors.runtime), \
package(alphaLib), \
thread, package(core_bench)
package(alphaLib)
......@@ -116,22 +116,12 @@ SUBST(term, term)
(* [fa] computes the free atoms of a term. *)
class fa = object
inherit [_] iter
inherit [_] KitFa.iter
end
let fa (t : nominal_term) : Atom.Set.t =
let fa = new fa in
fa # visit_term KitFa.empty t;
fa # accu
class fa' = object
inherit [_] reduce
inherit [_] KitFa.reduce
end
let fa' : nominal_term -> Atom.Set.t =
new fa' # visit_term ()
let fa : nominal_term -> Atom.Set.t =
new fa # visit_term ()
(* -------------------------------------------------------------------------- *)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment