test(simple_mymem1) :- R=[a,b,c],
partially_evaluate_and_load(mymem(X,R),C),
call(C),X==c.
test(protect1) :-
clear_specialized_code,
partially_evaluate_and_load(protect([a,b,c],R),C),
call(C),R=mem(a).
test(block_member1) :- R=[a,b,c],
partially_evaluate_and_load(btest(b,R),C),
call(C).
test(block_member2) :- R=[a|T],
partially_evaluate_and_load(btest(b,R),C),
T = [b,c],
call(C).
test(block_member3) :- R=[a|T],
partially_evaluate_and_load(btest(b,R),C),
call(C), var(T), % check that block declaration active
T = [b,c].
test(revacc1) :- partially_evaluate_and_load(revacc([a,b,c|T],R),C),
T=[d,e], call(C), R=[e,d,c,b,a].
test(revaccw1) :- partially_evaluate_and_load(revw([a,b,c|T],[],R),C),
T=[d,e], call(C), R=[e,d,c,b,a].
test(cut) :- partially_evaluate_and_load(p(s(1,s(-1,s(c,R))),Res),C),
R=22, call(C), Res=r(pos,r(neg,r(at,pos))).
test(cut2) :- partially_evaluate_and_load(p(s(f(1),f(_)),Res),C),
call(C), Res=r(fat,fvar).