anchor.diff:  
   order_fun_constraints([#constraint_ref{} = C|Tail], Funs, Acc, State) ->
     order_fun_constraints(Tail, [C|Funs], Acc, State);
  -order_fun_constraints([#constraint_list{list = List, type = Type} = C|Tail],
  +order_fun_constraints([#constraint_list{list = List,
  +                                        type = Type,
  +                                        masks = OldMasks} = C|Tail],
   		      Funs, Acc, State) ->
  -  {NewList, NewState} =
  -    case Type of
  -      conj -> order_fun_constraints(List, [], [], State);
  -      disj ->
  -	FoldFun = fun(X, AccState) ->
  -		      {[NewX], NewAccState} =
  -			order_fun_constraints([X], [], [], AccState),
  -		      {NewX, NewAccState}
  -		  end,
  -	lists:mapfoldl(FoldFun, State, List)
  -    end,
  -  C1 = update_constraint_list(C, NewList),
  -  Masks = calculate_masks(NewList, 1, []),
  -  NewAcc = [update_masks(C1, Masks)|Acc],
  -  order_fun_constraints(Tail, Funs, NewAcc, NewState);
  +  case OldMasks of
  +    undefined ->
  +      {NewList, NewState} =
  +        case Type of
  +          conj -> order_fun_constraints(List, [], [], State);
  +          disj ->
  +            FoldFun = fun(X, AccState) ->
  +                          {[NewX], NewAccState} =
  +                            order_fun_constraints([X], [], [], AccState),
  +                          {NewX, NewAccState}
  +                      end,
  +            lists:mapfoldl(FoldFun, State, List)
  +        end,
  +      NewList2 = reset_deps(NewList, State),
  +      C1 = update_constraint_list(C, NewList2),
  +      Masks = calculate_masks(NewList, 1, []),
  +      NewAcc = [update_masks(C1, Masks)|Acc],
  +      order_fun_constraints(Tail, Funs, NewAcc, NewState);
  +    M when is_map(M) ->
  +      order_fun_constraints(Tail, Funs, [C|Acc], State)
  +  end;
   order_fun_constraints([#constraint{} = C|Tail], Funs, Acc, State) ->
     order_fun_constraints(Tail, Funs, [C|Acc], State);
   order_fun_constraints([], Funs, Acc, State) ->
  
positive.code: 
  update_masks(C, Masks) ->
    C#constraint_list{masks = Masks}.
  
  calculate_masks([C|Cs], I, L0) ->
    calculate_masks(Cs, I+1, [{V, I} || V <- get_deps(C)] ++ L0);
  
negative.code: 
  order_fun_constraints([#constraint_ref{id = Id}|Tail], State) ->
    Cs = state__get_cs(Id, State),
    {[Cs1], State1} = order_fun_constraints([Cs], [], [], State),
    NewCs = Cs1#constraint_list{deps = Cs#constraint_list.deps},
    NewState = state__store_constrs(Id, NewCs, State1),
    order_fun_constraints(Tail, NewState);
  order_fun_constraints([], State) ->
  