(ㅌㅅㅌ)
글쓴이: 동쪽하늘 / 작성시간: 목, 2003/01/23 - 9:47오후
fun bruijn(le, lamlist) = let fun depth(s, lst) = if lst=[] then raise NotClosed else if List.hd(lst)=s then 0 else 1+depth(s,List.tl(lst)) in case le of VAR(s) => I(depth(s, lamlist)) | LAM(s, e) => L(bruijn(e, s::lamlist)) | APP(e1, e2) => A(bruijn(e1,lamlist), bruijn(e2,lamlist)) end fun bruijnize le = bruijn(le, [])
:roll: :D :shock: :) :o :lol:
Forums: