test(single_quantifier, [setup(reset_id), true(Renamed == Expected)]) :-
set_unique_quantified_identifiers(b(conjunct(b(conjunct(b(less(b(identifier(y),integer,[]),b(identifier(x),integer,[])),pred,[]),b(less(b(integer(1),integer,[]),b(identifier(x),integer,[])),pred,[])),pred,[]),b(forall([b(identifier(x),integer,[]),b(identifier(y),integer,[])],b(member(b(identifier(x),integer,[]),b(integer_set('NATURAL'),set(integer),[])),pred,[]),b(conjunct(b(less(b(identifier(y),integer,[]),b(identifier(x),integer,[])),pred,[]),b(less(b(integer(0),integer,[]),b(identifier(x),integer,[])),pred,[])),pred,[])),pred,[])),pred,[]), Renamed),
Expected = b(conjunct(b(conjunct(b(less(b(identifier(y),integer,[]),b(identifier(x),integer,[])),pred,[]),b(less(b(integer(1),integer,[]),b(identifier(x),integer,[])),pred,[])),pred,[]),b(forall([b(identifier('_q1'),integer,[]),b(identifier('_q2'),integer,[])],b(member(b(identifier('_q1'),integer,[]),b(integer_set('NATURAL'),set(integer),[])),pred,[]),b(conjunct(b(less(b(identifier('_q2'),integer,[]),b(identifier('_q1'),integer,[])),pred,[]),b(less(b(integer(0),integer,[]),b(identifier('_q1'),integer,[])),pred,[])),pred,[])),pred,[])),pred,[]).
test(two_nested_quantifiers, [setup(reset_id), true(Renamed == Expected)]) :-
set_unique_quantified_identifiers(b(forall([b(identifier(x),integer,[]),b(identifier(y),integer,[])],b(truth,pred,[]),b(exists([b(identifier(z),integer,[])],b(equal(b(identifier(y),integer,[]),b(add(b(identifier(x),integer,[]),b(unary_minus(b(identifier(z),integer,[])),integer,[])),integer,[])),pred,[])),pred,[])),pred,[]), Renamed),
Expected = b(forall([b(identifier('_q1'),integer,[]),b(identifier('_q2'),integer,[])],b(truth,pred,[]),b(exists([b(identifier('_q3'),integer,[])],b(equal(b(identifier('_q2'),integer,[]),b(add(b(identifier('_q1'),integer,[]),b(unary_minus(b(identifier('_q3'),integer,[])),integer,[])),integer,[])),pred,[])),pred,[])),pred,[]).
test(two_nested_quantifiers2, [setup(reset_id), true(Renamed == Expected)]) :-
set_unique_quantified_identifiers(b(forall([b(identifier(x),integer,[]),b(identifier(y),integer,[])],b(conjunct(b(member(b(identifier(x),integer,[]),b(integer_set('NATURAL1'),set(integer),[])),pred,[]),b(member(b(identifier(y),integer,[]),b(integer_set('NATURAL1'),set(integer),[])),pred,[])),pred,[]),b(conjunct(b(conjunct(b(less(b(integer(0),integer,[]),b(identifier(x),integer,[])),pred,[]),b(less(b(integer(0),integer,[]),b(identifier(y),integer,[])),pred,[])),pred,[]),b(forall([b(identifier(z),integer,[])],b(truth,pred,[]),b(equal(b(identifier(y),integer,[]),b(add(b(identifier(x),integer,[]),b(unary_minus(b(identifier(z),integer,[])),integer,[])),integer,[])),pred,[])),pred,[])),pred,[])),pred,[]), Renamed),
Expected = b(forall([b(identifier('_q1'),integer,[]),b(identifier('_q2'),integer,[])],b(conjunct(b(member(b(identifier('_q1'),integer,[]),b(integer_set('NATURAL1'),set(integer),[])),pred,[]),b(member(b(identifier('_q2'),integer,[]),b(integer_set('NATURAL1'),set(integer),[])),pred,[])),pred,[]),b(conjunct(b(conjunct(b(less(b(integer(0),integer,[]),b(identifier('_q1'),integer,[])),pred,[]),b(less(b(integer(0),integer,[]),b(identifier('_q2'),integer,[])),pred,[])),pred,[]),b(forall([b(identifier('_q3'),integer,[])],b(truth,pred,[]),b(equal(b(identifier('_q2'),integer,[]),b(add(b(identifier('_q1'),integer,[]),b(unary_minus(b(identifier('_q3'),integer,[])),integer,[])),integer,[])),pred,[])),pred,[])),pred,[])),pred,[]).
test(renamed_id_in_set, [setup(reset_id), true(Renamed == Expected)]) :-
set_unique_quantified_identifiers(b(forall([b(identifier(x),integer,[]),b(identifier(y),integer,[])],b(conjunct(b(member(b(identifier(x),integer,[]),b(integer_set('NATURAL'),set(integer),[])),pred,[]),b(member(b(identifier(y),integer,[]),b(integer_set('NATURAL'),set(integer),[])),pred,[])),pred,[]),b(subset_strict(b(set_extension([b(identifier(x),integer,[])]),set(integer),[]),b(set_extension([b(identifier(y),integer,[]),b(integer(1),integer,[]),b(integer(2),integer,[]),b(integer(3),integer,[])]),set(integer),[])),pred,[])),pred,[]), Renamed),
Expected = b(forall([b(identifier('_q1'),integer,[]),b(identifier('_q2'),integer,[])],b(conjunct(b(member(b(identifier('_q1'),integer,[]),b(integer_set('NATURAL'),set(integer),[])),pred,[]),b(member(b(identifier('_q2'),integer,[]),b(integer_set('NATURAL'),set(integer),[])),pred,[])),pred,[]),b(subset_strict(b(set_extension([b(identifier('_q1'),integer,[])]),set(integer),[]),b(set_extension([b(identifier('_q2'),integer,[]),b(integer(1),integer,[]),b(integer(2),integer,[]),b(integer(3),integer,[])]),set(integer),[])),pred,[])),pred,[]).