equal
deleted
inserted
replaced
393 (* quote / antiquote *) |
393 (* quote / antiquote *) |
394 |
394 |
395 fun antiquote_tr' name = |
395 fun antiquote_tr' name = |
396 let |
396 let |
397 fun tr' i (t $ u) = |
397 fun tr' i (t $ u) = |
398 if u = Bound i then Lexicon.const name $ tr' i t |
398 if u aconv Bound i then Lexicon.const name $ tr' i t |
399 else tr' i t $ tr' i u |
399 else tr' i t $ tr' i u |
400 | tr' i (Abs (x, T, t)) = Abs (x, T, tr' (i + 1) t) |
400 | tr' i (Abs (x, T, t)) = Abs (x, T, tr' (i + 1) t) |
401 | tr' i a = if a = Bound i then raise Match else a; |
401 | tr' i a = if a aconv Bound i then raise Match else a; |
402 in tr' 0 end; |
402 in tr' 0 end; |
403 |
403 |
404 fun quote_tr' name (Abs (_, _, t)) = Term.incr_boundvars ~1 (antiquote_tr' name t) |
404 fun quote_tr' name (Abs (_, _, t)) = Term.incr_boundvars ~1 (antiquote_tr' name t) |
405 | quote_tr' _ _ = raise Match; |
405 | quote_tr' _ _ = raise Match; |
406 |
406 |