Commit c7184fad authored by POTTIER Francois's avatar POTTIER Francois

Add KitAvoid.

parent 27cfd1e8
(* This kit serves to construct an [avoid] function for terms. This
function renames the bound names of a term, if necessary, so as
to avoid a certain set of bad names. *)
type env =
let empty =
let lookup =
let extend bad x env =
(* If [x] is bad, it must be renamed. Otherwise, keep it. *)
if Atom.Set.mem x bad then
KitCopy.extend x env
x, env
class ['self] map bad = object (_ : 'self)
method private extend x env = extend bad x env
method private visit_'fn env x = lookup env x
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