anchor.diff:    [s] = lookup({"B",[{{[0],t},0}]}, T1),
     [] = lookup({"B",[{s,2}]}, T1),
     1 = lookup({"B",[{{[0],t},0},{s,0}]}, T1),
  +  {calc,[0]} = lookup({"A",[{{[0],t},2}]}, T1),
  +  2 = lookup({"A",[{{[0],t},1},{s,0}]}, T1),
  +  3 = lookup({"A",[{{[0],t},1},{s,1}]}, T1),
   
     X = lookup({"A", [{s, 1}, {{[0],t}, 0}]}, T1),
     io:format("A [s <- 0, t <- 0] = ~p~n", [X]),
  
positive.code: 	   insert({Xi, NewK0, V}, NewDi, SNs, [])}] ++ Tree;
  
  insert({Xi, K0, V}, Di, [], Acc) ->
  %%  Acc ++ [{node, {Xi, K0, V}, []}];
    throw(undefined_branch);
  
  %% When the node is not an internal node and the delta is the same as the nodes
  %% context but K0 is nonempty, we cannot insert the node in a subnode (error)
  insert({Xi, K, V0}, Di, [{node, {Xi, Di, V1}, SNs}|Tree], Acc) ->
    NewK0 = tset:subtract(K, Di),
  %%  io:format("NewK0 = ~p, Di = ~p~n", [NewK0, Di]),
    Acc ++ [{node, {Xi, Di, V1},
  	   insert({Xi, NewK0, V0}, Di, SNs, [])}] ++ Tree;
  
  %%  throw(not_an_internal_node);
  
  %% When the delta is empty, and the tree is empty, insert it
  insert({Xi, K0, V}, [], [], Acc) ->
    Acc ++ [{node, {Xi, K0, V}, []}];
  
  %% When the nodes delta is distinct from the nodes context, we must search for 
  %% the rest of K0 within the siblings of this node.
  insert({Xi, K0, V}, Di0, [Node|Tree], Acc) ->
    [Node|Acc] ++ insert({Xi, K0, V}, Di0, Tree, []).
  
  
negative.code: %% Tests
  %%------------------------------------------------------------------------------
  correct_tree() ->
    [{node, {"A", [], {i,[{[0],t}],[[{{[0],t},0}],[{{[0],t},1}], [{{[0],t},2}]]}},
      [{node, {"A", [{{[0],t},0}], {i,[s],[[{s,0}],[{s,1}]]}},
        [{node, {"A", [{s,0}], 1}, []}]},
       {node, {"A", [{{[0],t},1}], {i,[s],[[{s,0}],[{s,1}]]}},
        [{node, {"A", [{s,0}], 2}, []},
         {node, {"A", [{s,1}], 3}, []}]},
       {node, {"A", [{{[0],t},2}], {calc, [0]}}, []}]},
     {node, {"B", [], {i,[s],[[{s,0}],[{s,1}]]}},
      [{node, {"B", [{s,0}], 1}, []},
       {node, {"B", [{s,1}], 1}, []}]}].
  