lazy_store_updates_and_normalise2(Var,EXPAND,NewVal,RestUpdates,UpdSoFar,InState,OutState) :-
normalise_value_for_var(Var,EXPAND,NewVal,NormalisedNewVal),
%print(store(Var,NewVal,NormalisedNewVal)),nl,
store_value_for_existing_id(InState,Var,NormalisedNewVal,InState2),
(member(bind(Var,OtherValue),UpdSoFar) % safe_member(bind(Var,OtherValue),UpdSoFar,store_updates_and_normalise)
->
add_error(store_updates_and_normalise,'Variable has been assigned twice in parallel: ',Var),
add_error(store_updates_and_normalise,'Values: ',(NewVal,OtherValue))
; (b_is_constant(Var)
-> add_error(store_updates_and_normalise,'Assigned value to constant: ',Var) ; true)
),
lazy_store_updates_and_normalise1(RestUpdates,EXPAND,[bind(Var,NewVal)|UpdSoFar],InState2,OutState).