Commit fa9707d9 authored by POTTIER Francois's avatar POTTIER Francois

Move [wrap] and [wrap2] to [VisitorsRuntime].

parent 0fc8bc17
......@@ -51,10 +51,3 @@ class ['self] iter2 = object (_ : 'self)
method private extend = extend
method private visit_'fn = lookup
end
let wrap2 f t1 t2 =
try
f t1 t2;
true
with VisitorsRuntime.StructuralMismatch ->
false
......@@ -32,10 +32,3 @@ class ['self] iter = object (_ : 'self)
method private extend = extend
method private visit_'fn = lookup
end
let wrap f t =
try
f t;
true
with VisitorsRuntime.StructuralMismatch ->
false
......@@ -133,7 +133,7 @@ class equiv = object
end
let equiv : nominal_term -> nominal_term -> bool =
KitEquiv.wrap2 (new equiv # visit_term KitEquiv.empty)
VisitorsRuntime.wrap2 (new equiv # visit_term KitEquiv.empty)
class wf = object
inherit [_] iter
......@@ -141,4 +141,4 @@ class wf = object
end
let wf : nominal_term -> bool =
KitWf.wrap (new wf # visit_term KitWf.empty)
VisitorsRuntime.wrap (new wf # visit_term KitWf.empty)
......@@ -24,6 +24,20 @@ exception StructuralMismatch
let fail () =
raise StructuralMismatch
let wrap f t =
try
f t;
true
with StructuralMismatch ->
false
let wrap2 f t1 t2 =
try
f t1 t2;
true
with StructuralMismatch ->
false
(* -------------------------------------------------------------------------- *)
(* A virtual base class for monoids. *)
......
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