+nCicTacReduction.cmi:
+nTacStatus.cmi:
+nCicElim.cmi:
nTactics.cmi: nTacStatus.cmi
+zipTree.cmi:
nAuto.cmi: nTacStatus.cmi
nInversion.cmi: nTacStatus.cmi
nCicTacReduction.cmo: nCicTacReduction.cmi
nCicElim.cmx: nCicElim.cmi
nTactics.cmo: nTacStatus.cmi nCicElim.cmi nTactics.cmi
nTactics.cmx: nTacStatus.cmx nCicElim.cmx nTactics.cmi
+zipTree.cmo: zipTree.cmi
+zipTree.cmx: zipTree.cmi
nAuto.cmo: nTactics.cmi nTacStatus.cmi nAuto.cmi
nAuto.cmx: nTactics.cmx nTacStatus.cmx nAuto.cmi
nInversion.cmo: nTactics.cmi nCicElim.cmi nInversion.cmi
nCicTacReduction.cmi:
nTacStatus.cmi:
nCicElim.cmi:
-nAuto.cmi: nTacStatus.cmi
nTactics.cmi: nTacStatus.cmi
+zipTree.cmi:
+nAuto.cmi: nTacStatus.cmi
nInversion.cmi: nTacStatus.cmi
nCicTacReduction.cmo: nCicTacReduction.cmi
nCicTacReduction.cmx: nCicTacReduction.cmi
nTacStatus.cmx: nCicTacReduction.cmx nTacStatus.cmi
nCicElim.cmo: nCicElim.cmi
nCicElim.cmx: nCicElim.cmi
-nAuto.cmo: nTacStatus.cmi nAuto.cmi
-nAuto.cmx: nTacStatus.cmx nAuto.cmi
nTactics.cmo: nTacStatus.cmi nCicElim.cmi nTactics.cmi
nTactics.cmx: nTacStatus.cmx nCicElim.cmx nTactics.cmi
+zipTree.cmo: zipTree.cmi
+zipTree.cmx: zipTree.cmi
+nAuto.cmo: nTactics.cmi nTacStatus.cmi nAuto.cmi
+nAuto.cmx: nTactics.cmx nTacStatus.cmx nAuto.cmi
nInversion.cmo: nTactics.cmi nCicElim.cmi nInversion.cmi
nInversion.cmx: nTactics.cmx nCicElim.cmx nInversion.cmi
--- /dev/null
+(*
+ ||M|| This file is part of HELM, an Hypertextual, Electronic
+ ||A|| Library of Mathematics, developed at the Computer Science
+ ||T|| Department, University of Bologna, Italy.
+ ||I||
+ ||T|| HELM is free software; you can redistribute it and/or
+ ||A|| modify it under the terms of the GNU General Public License
+ \ / version 2 or (at your option) any later version.
+ \ / This software is distributed as is, NO WARRANTY.
+ V_______________________________________________________________ *)
+
+(* $Id: nCic.ml 9058 2008-10-13 17:42:30Z tassi $ *)
+
+module type Elem = sig type t val pp : t -> string end ;;
+
+module Make(T : Elem) = struct
+
+type tree = Node of (T.t * tree) list
+
+type tree_ctx =
+ | Ctx of tree_ctx * (T.t * tree) list * T.t * (T.t * tree) list
+ | Top
+
+type position = Loc of tree_ctx * tree
+
+
+let start (t : tree) : position = Loc (Top, t);;
+
+let down = function
+ | Loc (_,Node []) -> None
+ | Loc (ctx, Node ((x,t)::tl)) -> Some (Loc (Ctx (ctx,[],x,tl),t))
+;;
+
+let up = function
+ | Loc (Top,_) -> None
+ | Loc (Ctx(ctx,l,x,r),t) -> Some (Loc (ctx,Node (l@[x,t]@r)))
+;;
+
+let right = function
+ | Loc (Top,_) | Loc (Ctx(_,_,_,[]),_) -> None
+ | Loc (Ctx(ctx,l,x,(rx,rt)::tl),t) -> Some (Loc(Ctx(ctx,l@[x,t],rx,tl),rt))
+;;
+
+let left = function
+ | Loc (Top,_) | Loc (Ctx(_,[],_,_),_) -> None
+ | Loc (Ctx(ctx,(lx,lt)::tl,x,r),t) -> Some (Loc(Ctx(ctx,tl,lx,(x,t)::r),lt))
+;;
+
+let rec repeat f l = match f l with None -> l | Some l -> repeat f l;;
+
+let root t =
+ match repeat up t with
+ | Loc(Top,t) -> t
+ | _ -> assert false
+;;
+
+let previsit f acc (t : position) =
+ let rec aux acc = function
+ | Node [] -> acc
+ | Node ((x,t)::tl) ->
+ let acc = aux acc t in
+ let acc = f acc x in
+ aux acc (Node tl)
+ in
+ aux acc (root t)
+;;
+
+
+
+
+end
--- /dev/null
+(*
+ ||M|| This file is part of HELM, an Hypertextual, Electronic
+ ||A|| Library of Mathematics, developed at the Computer Science
+ ||T|| Department, University of Bologna, Italy.
+ ||I||
+ ||T|| HELM is free software; you can redistribute it and/or
+ ||A|| modify it under the terms of the GNU General Public License
+ \ / version 2 or (at your option) any later version.
+ \ / This software is distributed as is, NO WARRANTY.
+ V_______________________________________________________________ *)
+
+(* $Id: nCic.ml 9058 2008-10-13 17:42:30Z tassi $ *)
+
+