Ewan Delanoy on Thu, 21 Nov 2013 17:54:43 +0100


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Function vs list of instructions executed separately


 Hello all,

  recently I’ve encountered a strange situation where it seems a function renders a different output than the output obtained when each of its instructions are executed separately.
  About a year ago I has asked this list for help on a similar matter, and it turned out (fortunately) to be just a typo issue in function names.  But this time I’ve re-read the code several times and it’s still a mystery to me …

 Thanks in advance for any help,

Ewan

  Here is the revelant code snippet (items %6 and %11 should be equal, and why they are not is beyond me ):

? extr_constraints=[i, j, k, u]
%2 = [i, j, k, u]
? extr_vectors=[i, j, k, u]
%3 = [i, j, k, u]
? new_cstr=4*u-i
%4 = -i + 4*u
? list_of_vars=[i,j,k,u]
%5 = [i, j, k, u]
? ?insert_constraint0
insert_constraint0(extr_constraints,extr_vectors,new_cstr,list_of_vars)=local(temp_vecs,temp_cstr,new_vecs,new_cstr);temp_vecs=untested_new_vectors(extr_constraints,extr_vectors,new_cstr,list_of_vars);temp_cstr=concat(extr_constraints,new_cstr);new_vecs=test_individuals_for_extremality(temp_cstr,temp_vecs,list_of_vars);new_cstr=test_individuals_for_extremality(new_vecs,temp_cstr,list_of_vars);return([new_cstr,new_vecs])
? insert_constraint0(extr_constraints,extr_vectors,new_cstr,list_of_vars)
%6 = [[i, j, k, u], [i, j, k, u]]
? temp_vecs=untested_new_vectors(extr_constraints,extr_vectors,new_cstr,list_of_vars)
%7 = [j, k, u, 4*i + u]
? temp_cstr=concat(extr_constraints,new_cstr)
%8 = [i, j, k, u, -i + 4*u]
? new_vecs=test_individuals_for_extremality(temp_cstr,temp_vecs,list_of_vars)
%9 = [j, k, u, 4*i + u]
? new_cstr=test_individuals_for_extremality(new_vecs,temp_cstr,list_of_vars)
%10 = [i, j, k, -i + 4*u]
?
? [new_vecs,new_cstr]
%11 = [[j, k, u, 4*i + u], [i, j, k, -i + 4*u]]