diff --git a/fzn-parser/examples/CostasArray.ast b/fzn-parser/examples/CostasArray.ast new file mode 100644 index 0000000..9d93e21 --- /dev/null +++ b/fzn-parser/examples/CostasArray.ast @@ -0,0 +1,1282 @@ +_ > []. +_T > [[]|_T]. +[X|_T] > [preds(X)|_T]. +_T > [[]|_T]. +_T > [int|_T]. +_T > ['X_INTRODUCED_42'|_T]. +_T > [[]|_T]. +_T > [lit(1,int)|_T]. +_T > [lit(-1,int)|_T]. +[E|_T] > [[E]|_T]. +[T,H|_T] > [[H|T]|_T]. +[Es|_T] > [lit(Es,array(_))|_T]. +[VAL,AN,ID,T|_T] > [var(ID, array(T,1,2), VAL, AN)|_T]. +[H,T|_T] > [[H|T]|_T]. +_T > [int|_T]. +_T > ['X_INTRODUCED_45'|_T]. +_T > [[]|_T]. +_T > [lit(1,int)|_T]. +_T > [lit(-1,int)|_T]. +_T > [lit(1,int)|_T]. +[E|_T] > [[E]|_T]. +[T,H|_T] > [[H|T]|_T]. +[T,H|_T] > [[H|T]|_T]. +[Es|_T] > [lit(Es,array(_))|_T]. +[VAL,AN,ID,T|_T] > [var(ID, array(T,1,3), VAL, AN)|_T]. +[H,T|_T] > [[H|T]|_T]. +_T > [int|_T]. +_T > ['X_INTRODUCED_70'|_T]. +_T > [[]|_T]. +_T > [lit(1,int)|_T]. +_T > [lit(1,int)|_T]. +_T > [lit(-1,int)|_T]. +_T > [lit(-1,int)|_T]. +[E|_T] > [[E]|_T]. +[T,H|_T] > [[H|T]|_T]. +[T,H|_T] > [[H|T]|_T]. +[T,H|_T] > [[H|T]|_T]. +[Es|_T] > [lit(Es,array(_))|_T]. +[VAL,AN,ID,T|_T] > [var(ID, array(T,1,4), VAL, AN)|_T]. +[H,T|_T] > [[H|T]|_T]. +_T > [int(1,6)|_T]. +_T > ['X_INTRODUCED_0'|_T]. +_T > [[]|_T]. +_T > [[]|_T]. +[VAL,AN,ID,T|_T] > [var(ID, T, VAL, AN)|_T]. +[H,T|_T] > [[H|T]|_T]. +_T > [int(1,6)|_T]. +_T > ['X_INTRODUCED_1'|_T]. +_T > [[]|_T]. +_T > [[]|_T]. +[VAL,AN,ID,T|_T] > [var(ID, T, VAL, AN)|_T]. +[H,T|_T] > [[H|T]|_T]. +_T > [int(1,6)|_T]. +_T > ['X_INTRODUCED_2'|_T]. +_T > [[]|_T]. +_T > [[]|_T]. +[VAL,AN,ID,T|_T] > [var(ID, T, VAL, AN)|_T]. +[H,T|_T] > [[H|T]|_T]. +_T > [int(1,6)|_T]. +_T > ['X_INTRODUCED_3'|_T]. +_T > [[]|_T]. +_T > [[]|_T]. +[VAL,AN,ID,T|_T] > [var(ID, T, VAL, AN)|_T]. +[H,T|_T] > [[H|T]|_T]. +_T > [int(1,6)|_T]. +_T > ['X_INTRODUCED_4'|_T]. +_T > [[]|_T]. +_T > [[]|_T]. +[VAL,AN,ID,T|_T] > [var(ID, T, VAL, AN)|_T]. +[H,T|_T] > [[H|T]|_T]. +_T > [int(1,6)|_T]. +_T > ['X_INTRODUCED_5'|_T]. +_T > [[]|_T]. +_T > [[]|_T]. +[VAL,AN,ID,T|_T] > [var(ID, T, VAL, AN)|_T]. +[H,T|_T] > [[H|T]|_T]. +_T > [[5]|_T]. +[Ls|_T] > [[4|Ls]|_T]. +[Ls|_T] > [[3|Ls]|_T]. +[Ls|_T] > [[2|Ls]|_T]. +[Ls|_T] > [[1|Ls]|_T]. +[Ls|_T] > [[-1|Ls]|_T]. +[Ls|_T] > [[-2|Ls]|_T]. +[Ls|_T] > [[-3|Ls]|_T]. +[Ls|_T] > [[-4|Ls]|_T]. +[Ls|_T] > [[-5|Ls]|_T]. +[Ls|_T] > [int(Ls)|_T]. +_T > ['X_INTRODUCED_7'|_T]. +_T > [id('is_defined_var')|_T]. +_T > [[]|_T]. +[As, E|_T] > [[E|As]|_T]. +_T > [[]|_T]. +[VAL,AN,ID,T|_T] > [var(ID, T, VAL, AN)|_T]. +[H,T|_T] > [[H|T]|_T]. +_T > [[5]|_T]. +[Ls|_T] > [[4|Ls]|_T]. +[Ls|_T] > [[3|Ls]|_T]. +[Ls|_T] > [[2|Ls]|_T]. +[Ls|_T] > [[1|Ls]|_T]. +[Ls|_T] > [[-1|Ls]|_T]. +[Ls|_T] > [[-2|Ls]|_T]. +[Ls|_T] > [[-3|Ls]|_T]. +[Ls|_T] > [[-4|Ls]|_T]. +[Ls|_T] > [[-5|Ls]|_T]. +[Ls|_T] > [int(Ls)|_T]. +_T > ['X_INTRODUCED_8'|_T]. +_T > [id('is_defined_var')|_T]. +_T > [[]|_T]. +[As, E|_T] > [[E|As]|_T]. +_T > [[]|_T]. +[VAL,AN,ID,T|_T] > [var(ID, T, VAL, AN)|_T]. +[H,T|_T] > [[H|T]|_T]. +_T > [[5]|_T]. +[Ls|_T] > [[4|Ls]|_T]. +[Ls|_T] > [[3|Ls]|_T]. +[Ls|_T] > [[2|Ls]|_T]. +[Ls|_T] > [[1|Ls]|_T]. +[Ls|_T] > [[-1|Ls]|_T]. +[Ls|_T] > [[-2|Ls]|_T]. +[Ls|_T] > [[-3|Ls]|_T]. +[Ls|_T] > [[-4|Ls]|_T]. +[Ls|_T] > [[-5|Ls]|_T]. +[Ls|_T] > [int(Ls)|_T]. +_T > ['X_INTRODUCED_9'|_T]. +_T > [id('is_defined_var')|_T]. +_T > [[]|_T]. +[As, E|_T] > [[E|As]|_T]. +_T > [[]|_T]. +[VAL,AN,ID,T|_T] > [var(ID, T, VAL, AN)|_T]. +[H,T|_T] > [[H|T]|_T]. +_T > [[5]|_T]. +[Ls|_T] > [[4|Ls]|_T]. +[Ls|_T] > [[3|Ls]|_T]. +[Ls|_T] > [[2|Ls]|_T]. +[Ls|_T] > [[1|Ls]|_T]. +[Ls|_T] > [[-1|Ls]|_T]. +[Ls|_T] > [[-2|Ls]|_T]. +[Ls|_T] > [[-3|Ls]|_T]. +[Ls|_T] > [[-4|Ls]|_T]. +[Ls|_T] > [[-5|Ls]|_T]. +[Ls|_T] > [int(Ls)|_T]. +_T > ['X_INTRODUCED_10'|_T]. +_T > [id('is_defined_var')|_T]. +_T > [[]|_T]. +[As, E|_T] > [[E|As]|_T]. +_T > [[]|_T]. +[VAL,AN,ID,T|_T] > [var(ID, T, VAL, AN)|_T]. +[H,T|_T] > [[H|T]|_T]. +_T > [[5]|_T]. +[Ls|_T] > [[4|Ls]|_T]. +[Ls|_T] > [[3|Ls]|_T]. +[Ls|_T] > [[2|Ls]|_T]. +[Ls|_T] > [[1|Ls]|_T]. +[Ls|_T] > [[-1|Ls]|_T]. +[Ls|_T] > [[-2|Ls]|_T]. +[Ls|_T] > [[-3|Ls]|_T]. +[Ls|_T] > [[-4|Ls]|_T]. +[Ls|_T] > [[-5|Ls]|_T]. +[Ls|_T] > [int(Ls)|_T]. +_T > ['X_INTRODUCED_11'|_T]. +_T > [id('is_defined_var')|_T]. +_T > [[]|_T]. +[As, E|_T] > [[E|As]|_T]. +_T > [[]|_T]. +[VAL,AN,ID,T|_T] > [var(ID, T, VAL, AN)|_T]. +[H,T|_T] > [[H|T]|_T]. +_T > [[5]|_T]. +[Ls|_T] > [[4|Ls]|_T]. +[Ls|_T] > [[3|Ls]|_T]. +[Ls|_T] > [[2|Ls]|_T]. +[Ls|_T] > [[1|Ls]|_T]. +[Ls|_T] > [[-1|Ls]|_T]. +[Ls|_T] > [[-2|Ls]|_T]. +[Ls|_T] > [[-3|Ls]|_T]. +[Ls|_T] > [[-4|Ls]|_T]. +[Ls|_T] > [[-5|Ls]|_T]. +[Ls|_T] > [int(Ls)|_T]. +_T > ['X_INTRODUCED_14'|_T]. +_T > [id('is_defined_var')|_T]. +_T > [[]|_T]. +[As, E|_T] > [[E|As]|_T]. +_T > [[]|_T]. +[VAL,AN,ID,T|_T] > [var(ID, T, VAL, AN)|_T]. +[H,T|_T] > [[H|T]|_T]. +_T > [[5]|_T]. +[Ls|_T] > [[4|Ls]|_T]. +[Ls|_T] > [[3|Ls]|_T]. +[Ls|_T] > [[2|Ls]|_T]. +[Ls|_T] > [[1|Ls]|_T]. +[Ls|_T] > [[-1|Ls]|_T]. +[Ls|_T] > [[-2|Ls]|_T]. +[Ls|_T] > [[-3|Ls]|_T]. +[Ls|_T] > [[-4|Ls]|_T]. +[Ls|_T] > [[-5|Ls]|_T]. +[Ls|_T] > [int(Ls)|_T]. +_T > ['X_INTRODUCED_15'|_T]. +_T > [id('is_defined_var')|_T]. +_T > [[]|_T]. +[As, E|_T] > [[E|As]|_T]. +_T > [[]|_T]. +[VAL,AN,ID,T|_T] > [var(ID, T, VAL, AN)|_T]. +[H,T|_T] > [[H|T]|_T]. +_T > [[5]|_T]. +[Ls|_T] > [[4|Ls]|_T]. +[Ls|_T] > [[3|Ls]|_T]. +[Ls|_T] > [[2|Ls]|_T]. +[Ls|_T] > [[1|Ls]|_T]. +[Ls|_T] > [[-1|Ls]|_T]. +[Ls|_T] > [[-2|Ls]|_T]. +[Ls|_T] > [[-3|Ls]|_T]. +[Ls|_T] > [[-4|Ls]|_T]. +[Ls|_T] > [[-5|Ls]|_T]. +[Ls|_T] > [int(Ls)|_T]. +_T > ['X_INTRODUCED_16'|_T]. +_T > [id('is_defined_var')|_T]. +_T > [[]|_T]. +[As, E|_T] > [[E|As]|_T]. +_T > [[]|_T]. +[VAL,AN,ID,T|_T] > [var(ID, T, VAL, AN)|_T]. +[H,T|_T] > [[H|T]|_T]. +_T > [[5]|_T]. +[Ls|_T] > [[4|Ls]|_T]. +[Ls|_T] > [[3|Ls]|_T]. +[Ls|_T] > [[2|Ls]|_T]. +[Ls|_T] > [[1|Ls]|_T]. +[Ls|_T] > [[-1|Ls]|_T]. +[Ls|_T] > [[-2|Ls]|_T]. +[Ls|_T] > [[-3|Ls]|_T]. +[Ls|_T] > [[-4|Ls]|_T]. +[Ls|_T] > [[-5|Ls]|_T]. +[Ls|_T] > [int(Ls)|_T]. +_T > ['X_INTRODUCED_17'|_T]. +_T > [id('is_defined_var')|_T]. +_T > [[]|_T]. +[As, E|_T] > [[E|As]|_T]. +_T > [[]|_T]. +[VAL,AN,ID,T|_T] > [var(ID, T, VAL, AN)|_T]. +[H,T|_T] > [[H|T]|_T]. +_T > [[5]|_T]. +[Ls|_T] > [[4|Ls]|_T]. +[Ls|_T] > [[3|Ls]|_T]. +[Ls|_T] > [[2|Ls]|_T]. +[Ls|_T] > [[1|Ls]|_T]. +[Ls|_T] > [[-1|Ls]|_T]. +[Ls|_T] > [[-2|Ls]|_T]. +[Ls|_T] > [[-3|Ls]|_T]. +[Ls|_T] > [[-4|Ls]|_T]. +[Ls|_T] > [[-5|Ls]|_T]. +[Ls|_T] > [int(Ls)|_T]. +_T > ['X_INTRODUCED_21'|_T]. +_T > [id('is_defined_var')|_T]. +_T > [[]|_T]. +[As, E|_T] > [[E|As]|_T]. +_T > [[]|_T]. +[VAL,AN,ID,T|_T] > [var(ID, T, VAL, AN)|_T]. +[H,T|_T] > [[H|T]|_T]. +_T > [[5]|_T]. +[Ls|_T] > [[4|Ls]|_T]. +[Ls|_T] > [[3|Ls]|_T]. +[Ls|_T] > [[2|Ls]|_T]. +[Ls|_T] > [[1|Ls]|_T]. +[Ls|_T] > [[-1|Ls]|_T]. +[Ls|_T] > [[-2|Ls]|_T]. +[Ls|_T] > [[-3|Ls]|_T]. +[Ls|_T] > [[-4|Ls]|_T]. +[Ls|_T] > [[-5|Ls]|_T]. +[Ls|_T] > [int(Ls)|_T]. +_T > ['X_INTRODUCED_22'|_T]. +_T > [id('is_defined_var')|_T]. +_T > [[]|_T]. +[As, E|_T] > [[E|As]|_T]. +_T > [[]|_T]. +[VAL,AN,ID,T|_T] > [var(ID, T, VAL, AN)|_T]. +[H,T|_T] > [[H|T]|_T]. +_T > [[5]|_T]. +[Ls|_T] > [[4|Ls]|_T]. +[Ls|_T] > [[3|Ls]|_T]. +[Ls|_T] > [[2|Ls]|_T]. +[Ls|_T] > [[1|Ls]|_T]. +[Ls|_T] > [[-1|Ls]|_T]. +[Ls|_T] > [[-2|Ls]|_T]. +[Ls|_T] > [[-3|Ls]|_T]. +[Ls|_T] > [[-4|Ls]|_T]. +[Ls|_T] > [[-5|Ls]|_T]. +[Ls|_T] > [int(Ls)|_T]. +_T > ['X_INTRODUCED_23'|_T]. +_T > [id('is_defined_var')|_T]. +_T > [[]|_T]. +[As, E|_T] > [[E|As]|_T]. +_T > [[]|_T]. +[VAL,AN,ID,T|_T] > [var(ID, T, VAL, AN)|_T]. +[H,T|_T] > [[H|T]|_T]. +_T > [[5]|_T]. +[Ls|_T] > [[4|Ls]|_T]. +[Ls|_T] > [[3|Ls]|_T]. +[Ls|_T] > [[2|Ls]|_T]. +[Ls|_T] > [[1|Ls]|_T]. +[Ls|_T] > [[-1|Ls]|_T]. +[Ls|_T] > [[-2|Ls]|_T]. +[Ls|_T] > [[-3|Ls]|_T]. +[Ls|_T] > [[-4|Ls]|_T]. +[Ls|_T] > [[-5|Ls]|_T]. +[Ls|_T] > [int(Ls)|_T]. +_T > ['X_INTRODUCED_28'|_T]. +_T > [id('is_defined_var')|_T]. +_T > [[]|_T]. +[As, E|_T] > [[E|As]|_T]. +_T > [[]|_T]. +[VAL,AN,ID,T|_T] > [var(ID, T, VAL, AN)|_T]. +[H,T|_T] > [[H|T]|_T]. +_T > [[5]|_T]. +[Ls|_T] > [[4|Ls]|_T]. +[Ls|_T] > [[3|Ls]|_T]. +[Ls|_T] > [[2|Ls]|_T]. +[Ls|_T] > [[1|Ls]|_T]. +[Ls|_T] > [[-1|Ls]|_T]. +[Ls|_T] > [[-2|Ls]|_T]. +[Ls|_T] > [[-3|Ls]|_T]. +[Ls|_T] > [[-4|Ls]|_T]. +[Ls|_T] > [[-5|Ls]|_T]. +[Ls|_T] > [int(Ls)|_T]. +_T > ['X_INTRODUCED_29'|_T]. +_T > [id('is_defined_var')|_T]. +_T > [[]|_T]. +[As, E|_T] > [[E|As]|_T]. +_T > [[]|_T]. +[VAL,AN,ID,T|_T] > [var(ID, T, VAL, AN)|_T]. +[H,T|_T] > [[H|T]|_T]. +_T > [[5]|_T]. +[Ls|_T] > [[4|Ls]|_T]. +[Ls|_T] > [[3|Ls]|_T]. +[Ls|_T] > [[2|Ls]|_T]. +[Ls|_T] > [[1|Ls]|_T]. +[Ls|_T] > [[-1|Ls]|_T]. +[Ls|_T] > [[-2|Ls]|_T]. +[Ls|_T] > [[-3|Ls]|_T]. +[Ls|_T] > [[-4|Ls]|_T]. +[Ls|_T] > [[-5|Ls]|_T]. +[Ls|_T] > [int(Ls)|_T]. +_T > ['X_INTRODUCED_35'|_T]. +_T > [id('is_defined_var')|_T]. +_T > [[]|_T]. +[As, E|_T] > [[E|As]|_T]. +_T > [[]|_T]. +[VAL,AN,ID,T|_T] > [var(ID, T, VAL, AN)|_T]. +[H,T|_T] > [[H|T]|_T]. +_T > [int(1,6)|_T]. +_T > ['costas'|_T]. +_T > [lit([1, 2, 3, 4, 5, 6], set(int))|_T]. +[E|_T] > [[E]|_T]. +[Es|_T] > [lit(Es,array(_))|_T]. +[E|_T] > [[E]|_T]. +_T > [[]|_T]. +[As, E|_T] > [[E|As]|_T]. +_T > [id('X_INTRODUCED_0')|_T]. +_T > [id('X_INTRODUCED_1')|_T]. +_T > [id('X_INTRODUCED_2')|_T]. +_T > [id('X_INTRODUCED_3')|_T]. +_T > [id('X_INTRODUCED_4')|_T]. +_T > [id('X_INTRODUCED_5')|_T]. +[E|_T] > [[E]|_T]. +[T,H|_T] > [[H|T]|_T]. +[T,H|_T] > [[H|T]|_T]. +[T,H|_T] > [[H|T]|_T]. +[T,H|_T] > [[H|T]|_T]. +[T,H|_T] > [[H|T]|_T]. +[Es|_T] > [lit(Es,array(_))|_T]. +[VAL,AN,ID,T|_T] > [var(ID, array(T,1,6), VAL, AN)|_T]. +[H,T|_T] > [[H|T]|_T]. +[X|_T] > [vars(X)|_T]. +_T > [[]|_T]. +_T > [id('X_INTRODUCED_42')|_T]. +_T > [id('X_INTRODUCED_0')|_T]. +_T > [id('X_INTRODUCED_1')|_T]. +[E|_T] > [[E]|_T]. +[T,H|_T] > [[H|T]|_T]. +[Es|_T] > [lit(Es,array(_))|_T]. +_T > [lit(0,int)|_T]. +[E|_T] > [[E]|_T]. +[T,H|_T] > [[H|T]|_T]. +[T,H|_T] > [[H|T]|_T]. +[AL|_T] > [C|_T] :- C =.. ['int_lin_ne'|AL]. +_T > [[]|_T]. +[A,C|_T] > [constraint(C,A)|_T]. +[H,T|_T] > [[H|T]|_T]. +_T > [id('X_INTRODUCED_42')|_T]. +_T > [id('X_INTRODUCED_0')|_T]. +_T > [id('X_INTRODUCED_2')|_T]. +[E|_T] > [[E]|_T]. +[T,H|_T] > [[H|T]|_T]. +[Es|_T] > [lit(Es,array(_))|_T]. +_T > [lit(0,int)|_T]. +[E|_T] > [[E]|_T]. +[T,H|_T] > [[H|T]|_T]. +[T,H|_T] > [[H|T]|_T]. +[AL|_T] > [C|_T] :- C =.. ['int_lin_ne'|AL]. +_T > [[]|_T]. +[A,C|_T] > [constraint(C,A)|_T]. +[H,T|_T] > [[H|T]|_T]. +_T > [id('X_INTRODUCED_42')|_T]. +_T > [id('X_INTRODUCED_0')|_T]. +_T > [id('X_INTRODUCED_3')|_T]. +[E|_T] > [[E]|_T]. +[T,H|_T] > [[H|T]|_T]. +[Es|_T] > [lit(Es,array(_))|_T]. +_T > [lit(0,int)|_T]. +[E|_T] > [[E]|_T]. +[T,H|_T] > [[H|T]|_T]. +[T,H|_T] > [[H|T]|_T]. +[AL|_T] > [C|_T] :- C =.. ['int_lin_ne'|AL]. +_T > [[]|_T]. +[A,C|_T] > [constraint(C,A)|_T]. +[H,T|_T] > [[H|T]|_T]. +_T > [id('X_INTRODUCED_42')|_T]. +_T > [id('X_INTRODUCED_0')|_T]. +_T > [id('X_INTRODUCED_4')|_T]. +[E|_T] > [[E]|_T]. +[T,H|_T] > [[H|T]|_T]. +[Es|_T] > [lit(Es,array(_))|_T]. +_T > [lit(0,int)|_T]. +[E|_T] > [[E]|_T]. +[T,H|_T] > [[H|T]|_T]. +[T,H|_T] > [[H|T]|_T]. +[AL|_T] > [C|_T] :- C =.. ['int_lin_ne'|AL]. +_T > [[]|_T]. +[A,C|_T] > [constraint(C,A)|_T]. +[H,T|_T] > [[H|T]|_T]. +_T > [id('X_INTRODUCED_42')|_T]. +_T > [id('X_INTRODUCED_0')|_T]. +_T > [id('X_INTRODUCED_5')|_T]. +[E|_T] > [[E]|_T]. +[T,H|_T] > [[H|T]|_T]. +[Es|_T] > [lit(Es,array(_))|_T]. +_T > [lit(0,int)|_T]. +[E|_T] > [[E]|_T]. +[T,H|_T] > [[H|T]|_T]. +[T,H|_T] > [[H|T]|_T]. +[AL|_T] > [C|_T] :- C =.. ['int_lin_ne'|AL]. +_T > [[]|_T]. +[A,C|_T] > [constraint(C,A)|_T]. +[H,T|_T] > [[H|T]|_T]. +_T > [id('X_INTRODUCED_42')|_T]. +_T > [id('X_INTRODUCED_1')|_T]. +_T > [id('X_INTRODUCED_2')|_T]. +[E|_T] > [[E]|_T]. +[T,H|_T] > [[H|T]|_T]. +[Es|_T] > [lit(Es,array(_))|_T]. +_T > [lit(0,int)|_T]. +[E|_T] > [[E]|_T]. +[T,H|_T] > [[H|T]|_T]. +[T,H|_T] > [[H|T]|_T]. +[AL|_T] > [C|_T] :- C =.. ['int_lin_ne'|AL]. +_T > [[]|_T]. +[A,C|_T] > [constraint(C,A)|_T]. +[H,T|_T] > [[H|T]|_T]. +_T > [id('X_INTRODUCED_42')|_T]. +_T > [id('X_INTRODUCED_1')|_T]. +_T > [id('X_INTRODUCED_3')|_T]. +[E|_T] > [[E]|_T]. +[T,H|_T] > [[H|T]|_T]. +[Es|_T] > [lit(Es,array(_))|_T]. +_T > [lit(0,int)|_T]. +[E|_T] > [[E]|_T]. +[T,H|_T] > [[H|T]|_T]. +[T,H|_T] > [[H|T]|_T]. +[AL|_T] > [C|_T] :- C =.. ['int_lin_ne'|AL]. +_T > [[]|_T]. +[A,C|_T] > [constraint(C,A)|_T]. +[H,T|_T] > [[H|T]|_T]. +_T > [id('X_INTRODUCED_42')|_T]. +_T > [id('X_INTRODUCED_1')|_T]. +_T > [id('X_INTRODUCED_4')|_T]. +[E|_T] > [[E]|_T]. +[T,H|_T] > [[H|T]|_T]. +[Es|_T] > [lit(Es,array(_))|_T]. +_T > [lit(0,int)|_T]. +[E|_T] > [[E]|_T]. +[T,H|_T] > [[H|T]|_T]. +[T,H|_T] > [[H|T]|_T]. +[AL|_T] > [C|_T] :- C =.. ['int_lin_ne'|AL]. +_T > [[]|_T]. +[A,C|_T] > [constraint(C,A)|_T]. +[H,T|_T] > [[H|T]|_T]. +_T > [id('X_INTRODUCED_42')|_T]. +_T > [id('X_INTRODUCED_1')|_T]. +_T > [id('X_INTRODUCED_5')|_T]. +[E|_T] > [[E]|_T]. +[T,H|_T] > [[H|T]|_T]. +[Es|_T] > [lit(Es,array(_))|_T]. +_T > [lit(0,int)|_T]. +[E|_T] > [[E]|_T]. +[T,H|_T] > [[H|T]|_T]. +[T,H|_T] > [[H|T]|_T]. +[AL|_T] > [C|_T] :- C =.. ['int_lin_ne'|AL]. +_T > [[]|_T]. +[A,C|_T] > [constraint(C,A)|_T]. +[H,T|_T] > [[H|T]|_T]. +_T > [id('X_INTRODUCED_42')|_T]. +_T > [id('X_INTRODUCED_2')|_T]. +_T > [id('X_INTRODUCED_3')|_T]. +[E|_T] > [[E]|_T]. +[T,H|_T] > [[H|T]|_T]. +[Es|_T] > [lit(Es,array(_))|_T]. +_T > [lit(0,int)|_T]. +[E|_T] > [[E]|_T]. +[T,H|_T] > [[H|T]|_T]. +[T,H|_T] > [[H|T]|_T]. +[AL|_T] > [C|_T] :- C =.. ['int_lin_ne'|AL]. +_T > [[]|_T]. +[A,C|_T] > [constraint(C,A)|_T]. +[H,T|_T] > [[H|T]|_T]. +_T > [id('X_INTRODUCED_42')|_T]. +_T > [id('X_INTRODUCED_2')|_T]. +_T > [id('X_INTRODUCED_4')|_T]. +[E|_T] > [[E]|_T]. +[T,H|_T] > [[H|T]|_T]. +[Es|_T] > [lit(Es,array(_))|_T]. +_T > [lit(0,int)|_T]. +[E|_T] > [[E]|_T]. +[T,H|_T] > [[H|T]|_T]. +[T,H|_T] > [[H|T]|_T]. +[AL|_T] > [C|_T] :- C =.. ['int_lin_ne'|AL]. +_T > [[]|_T]. +[A,C|_T] > [constraint(C,A)|_T]. +[H,T|_T] > [[H|T]|_T]. +_T > [id('X_INTRODUCED_42')|_T]. +_T > [id('X_INTRODUCED_2')|_T]. +_T > [id('X_INTRODUCED_5')|_T]. +[E|_T] > [[E]|_T]. +[T,H|_T] > [[H|T]|_T]. +[Es|_T] > [lit(Es,array(_))|_T]. +_T > [lit(0,int)|_T]. +[E|_T] > [[E]|_T]. +[T,H|_T] > [[H|T]|_T]. +[T,H|_T] > [[H|T]|_T]. +[AL|_T] > [C|_T] :- C =.. ['int_lin_ne'|AL]. +_T > [[]|_T]. +[A,C|_T] > [constraint(C,A)|_T]. +[H,T|_T] > [[H|T]|_T]. +_T > [id('X_INTRODUCED_42')|_T]. +_T > [id('X_INTRODUCED_3')|_T]. +_T > [id('X_INTRODUCED_4')|_T]. +[E|_T] > [[E]|_T]. +[T,H|_T] > [[H|T]|_T]. +[Es|_T] > [lit(Es,array(_))|_T]. +_T > [lit(0,int)|_T]. +[E|_T] > [[E]|_T]. +[T,H|_T] > [[H|T]|_T]. +[T,H|_T] > [[H|T]|_T]. +[AL|_T] > [C|_T] :- C =.. ['int_lin_ne'|AL]. +_T > [[]|_T]. +[A,C|_T] > [constraint(C,A)|_T]. +[H,T|_T] > [[H|T]|_T]. +_T > [id('X_INTRODUCED_42')|_T]. +_T > [id('X_INTRODUCED_3')|_T]. +_T > [id('X_INTRODUCED_5')|_T]. +[E|_T] > [[E]|_T]. +[T,H|_T] > [[H|T]|_T]. +[Es|_T] > [lit(Es,array(_))|_T]. +_T > [lit(0,int)|_T]. +[E|_T] > [[E]|_T]. +[T,H|_T] > [[H|T]|_T]. +[T,H|_T] > [[H|T]|_T]. +[AL|_T] > [C|_T] :- C =.. ['int_lin_ne'|AL]. +_T > [[]|_T]. +[A,C|_T] > [constraint(C,A)|_T]. +[H,T|_T] > [[H|T]|_T]. +_T > [id('X_INTRODUCED_42')|_T]. +_T > [id('X_INTRODUCED_4')|_T]. +_T > [id('X_INTRODUCED_5')|_T]. +[E|_T] > [[E]|_T]. +[T,H|_T] > [[H|T]|_T]. +[Es|_T] > [lit(Es,array(_))|_T]. +_T > [lit(0,int)|_T]. +[E|_T] > [[E]|_T]. +[T,H|_T] > [[H|T]|_T]. +[T,H|_T] > [[H|T]|_T]. +[AL|_T] > [C|_T] :- C =.. ['int_lin_ne'|AL]. +_T > [[]|_T]. +[A,C|_T] > [constraint(C,A)|_T]. +[H,T|_T] > [[H|T]|_T]. +_T > [id('X_INTRODUCED_45')|_T]. +_T > [id('X_INTRODUCED_7')|_T]. +_T > [id('X_INTRODUCED_1')|_T]. +_T > [id('X_INTRODUCED_0')|_T]. +[E|_T] > [[E]|_T]. +[T,H|_T] > [[H|T]|_T]. +[T,H|_T] > [[H|T]|_T]. +[Es|_T] > [lit(Es,array(_))|_T]. +_T > [lit(0,int)|_T]. +[E|_T] > [[E]|_T]. +[T,H|_T] > [[H|T]|_T]. +[T,H|_T] > [[H|T]|_T]. +[AL|_T] > [C|_T] :- C =.. ['int_lin_eq'|AL]. +_T > [id('X_INTRODUCED_7')|_T]. +[E|_T] > [[E]|_T]. +_T > [[]|_T]. +[As, E|_T] > [[E|As]|_T]. +[A,C|_T] > [constraint(C,A)|_T]. +[H,T|_T] > [[H|T]|_T]. +_T > [id('X_INTRODUCED_45')|_T]. +_T > [id('X_INTRODUCED_8')|_T]. +_T > [id('X_INTRODUCED_2')|_T]. +_T > [id('X_INTRODUCED_1')|_T]. +[E|_T] > [[E]|_T]. +[T,H|_T] > [[H|T]|_T]. +[T,H|_T] > [[H|T]|_T]. +[Es|_T] > [lit(Es,array(_))|_T]. +_T > [lit(0,int)|_T]. +[E|_T] > [[E]|_T]. +[T,H|_T] > [[H|T]|_T]. +[T,H|_T] > [[H|T]|_T]. +[AL|_T] > [C|_T] :- C =.. ['int_lin_eq'|AL]. +_T > [id('X_INTRODUCED_8')|_T]. +[E|_T] > [[E]|_T]. +_T > [[]|_T]. +[As, E|_T] > [[E|As]|_T]. +[A,C|_T] > [constraint(C,A)|_T]. +[H,T|_T] > [[H|T]|_T]. +_T > [id('X_INTRODUCED_45')|_T]. +_T > [id('X_INTRODUCED_9')|_T]. +_T > [id('X_INTRODUCED_3')|_T]. +_T > [id('X_INTRODUCED_2')|_T]. +[E|_T] > [[E]|_T]. +[T,H|_T] > [[H|T]|_T]. +[T,H|_T] > [[H|T]|_T]. +[Es|_T] > [lit(Es,array(_))|_T]. +_T > [lit(0,int)|_T]. +[E|_T] > [[E]|_T]. +[T,H|_T] > [[H|T]|_T]. +[T,H|_T] > [[H|T]|_T]. +[AL|_T] > [C|_T] :- C =.. ['int_lin_eq'|AL]. +_T > [id('X_INTRODUCED_9')|_T]. +[E|_T] > [[E]|_T]. +_T > [[]|_T]. +[As, E|_T] > [[E|As]|_T]. +[A,C|_T] > [constraint(C,A)|_T]. +[H,T|_T] > [[H|T]|_T]. +_T > [id('X_INTRODUCED_45')|_T]. +_T > [id('X_INTRODUCED_10')|_T]. +_T > [id('X_INTRODUCED_4')|_T]. +_T > [id('X_INTRODUCED_3')|_T]. +[E|_T] > [[E]|_T]. +[T,H|_T] > [[H|T]|_T]. +[T,H|_T] > [[H|T]|_T]. +[Es|_T] > [lit(Es,array(_))|_T]. +_T > [lit(0,int)|_T]. +[E|_T] > [[E]|_T]. +[T,H|_T] > [[H|T]|_T]. +[T,H|_T] > [[H|T]|_T]. +[AL|_T] > [C|_T] :- C =.. ['int_lin_eq'|AL]. +_T > [id('X_INTRODUCED_10')|_T]. +[E|_T] > [[E]|_T]. +_T > [[]|_T]. +[As, E|_T] > [[E|As]|_T]. +[A,C|_T] > [constraint(C,A)|_T]. +[H,T|_T] > [[H|T]|_T]. +_T > [id('X_INTRODUCED_45')|_T]. +_T > [id('X_INTRODUCED_11')|_T]. +_T > [id('X_INTRODUCED_5')|_T]. +_T > [id('X_INTRODUCED_4')|_T]. +[E|_T] > [[E]|_T]. +[T,H|_T] > [[H|T]|_T]. +[T,H|_T] > [[H|T]|_T]. +[Es|_T] > [lit(Es,array(_))|_T]. +_T > [lit(0,int)|_T]. +[E|_T] > [[E]|_T]. +[T,H|_T] > [[H|T]|_T]. +[T,H|_T] > [[H|T]|_T]. +[AL|_T] > [C|_T] :- C =.. ['int_lin_eq'|AL]. +_T > [id('X_INTRODUCED_11')|_T]. +[E|_T] > [[E]|_T]. +_T > [[]|_T]. +[As, E|_T] > [[E|As]|_T]. +[A,C|_T] > [constraint(C,A)|_T]. +[H,T|_T] > [[H|T]|_T]. +_T > [id('X_INTRODUCED_45')|_T]. +_T > [id('X_INTRODUCED_14')|_T]. +_T > [id('X_INTRODUCED_2')|_T]. +_T > [id('X_INTRODUCED_0')|_T]. +[E|_T] > [[E]|_T]. +[T,H|_T] > [[H|T]|_T]. +[T,H|_T] > [[H|T]|_T]. +[Es|_T] > [lit(Es,array(_))|_T]. +_T > [lit(0,int)|_T]. +[E|_T] > [[E]|_T]. +[T,H|_T] > [[H|T]|_T]. +[T,H|_T] > [[H|T]|_T]. +[AL|_T] > [C|_T] :- C =.. ['int_lin_eq'|AL]. +_T > [id('X_INTRODUCED_14')|_T]. +[E|_T] > [[E]|_T]. +_T > [[]|_T]. +[As, E|_T] > [[E|As]|_T]. +[A,C|_T] > [constraint(C,A)|_T]. +[H,T|_T] > [[H|T]|_T]. +_T > [id('X_INTRODUCED_45')|_T]. +_T > [id('X_INTRODUCED_15')|_T]. +_T > [id('X_INTRODUCED_3')|_T]. +_T > [id('X_INTRODUCED_1')|_T]. +[E|_T] > [[E]|_T]. +[T,H|_T] > [[H|T]|_T]. +[T,H|_T] > [[H|T]|_T]. +[Es|_T] > [lit(Es,array(_))|_T]. +_T > [lit(0,int)|_T]. +[E|_T] > [[E]|_T]. +[T,H|_T] > [[H|T]|_T]. +[T,H|_T] > [[H|T]|_T]. +[AL|_T] > [C|_T] :- C =.. ['int_lin_eq'|AL]. +_T > [id('X_INTRODUCED_15')|_T]. +[E|_T] > [[E]|_T]. +_T > [[]|_T]. +[As, E|_T] > [[E|As]|_T]. +[A,C|_T] > [constraint(C,A)|_T]. +[H,T|_T] > [[H|T]|_T]. +_T > [id('X_INTRODUCED_45')|_T]. +_T > [id('X_INTRODUCED_16')|_T]. +_T > [id('X_INTRODUCED_4')|_T]. +_T > [id('X_INTRODUCED_2')|_T]. +[E|_T] > [[E]|_T]. +[T,H|_T] > [[H|T]|_T]. +[T,H|_T] > [[H|T]|_T]. +[Es|_T] > [lit(Es,array(_))|_T]. +_T > [lit(0,int)|_T]. +[E|_T] > [[E]|_T]. +[T,H|_T] > [[H|T]|_T]. +[T,H|_T] > [[H|T]|_T]. +[AL|_T] > [C|_T] :- C =.. ['int_lin_eq'|AL]. +_T > [id('X_INTRODUCED_16')|_T]. +[E|_T] > [[E]|_T]. +_T > [[]|_T]. +[As, E|_T] > [[E|As]|_T]. +[A,C|_T] > [constraint(C,A)|_T]. +[H,T|_T] > [[H|T]|_T]. +_T > [id('X_INTRODUCED_45')|_T]. +_T > [id('X_INTRODUCED_17')|_T]. +_T > [id('X_INTRODUCED_5')|_T]. +_T > [id('X_INTRODUCED_3')|_T]. +[E|_T] > [[E]|_T]. +[T,H|_T] > [[H|T]|_T]. +[T,H|_T] > [[H|T]|_T]. +[Es|_T] > [lit(Es,array(_))|_T]. +_T > [lit(0,int)|_T]. +[E|_T] > [[E]|_T]. +[T,H|_T] > [[H|T]|_T]. +[T,H|_T] > [[H|T]|_T]. +[AL|_T] > [C|_T] :- C =.. ['int_lin_eq'|AL]. +_T > [id('X_INTRODUCED_17')|_T]. +[E|_T] > [[E]|_T]. +_T > [[]|_T]. +[As, E|_T] > [[E|As]|_T]. +[A,C|_T] > [constraint(C,A)|_T]. +[H,T|_T] > [[H|T]|_T]. +_T > [id('X_INTRODUCED_45')|_T]. +_T > [id('X_INTRODUCED_21')|_T]. +_T > [id('X_INTRODUCED_3')|_T]. +_T > [id('X_INTRODUCED_0')|_T]. +[E|_T] > [[E]|_T]. +[T,H|_T] > [[H|T]|_T]. +[T,H|_T] > [[H|T]|_T]. +[Es|_T] > [lit(Es,array(_))|_T]. +_T > [lit(0,int)|_T]. +[E|_T] > [[E]|_T]. +[T,H|_T] > [[H|T]|_T]. +[T,H|_T] > [[H|T]|_T]. +[AL|_T] > [C|_T] :- C =.. ['int_lin_eq'|AL]. +_T > [id('X_INTRODUCED_21')|_T]. +[E|_T] > [[E]|_T]. +_T > [[]|_T]. +[As, E|_T] > [[E|As]|_T]. +[A,C|_T] > [constraint(C,A)|_T]. +[H,T|_T] > [[H|T]|_T]. +_T > [id('X_INTRODUCED_45')|_T]. +_T > [id('X_INTRODUCED_22')|_T]. +_T > [id('X_INTRODUCED_4')|_T]. +_T > [id('X_INTRODUCED_1')|_T]. +[E|_T] > [[E]|_T]. +[T,H|_T] > [[H|T]|_T]. +[T,H|_T] > [[H|T]|_T]. +[Es|_T] > [lit(Es,array(_))|_T]. +_T > [lit(0,int)|_T]. +[E|_T] > [[E]|_T]. +[T,H|_T] > [[H|T]|_T]. +[T,H|_T] > [[H|T]|_T]. +[AL|_T] > [C|_T] :- C =.. ['int_lin_eq'|AL]. +_T > [id('X_INTRODUCED_22')|_T]. +[E|_T] > [[E]|_T]. +_T > [[]|_T]. +[As, E|_T] > [[E|As]|_T]. +[A,C|_T] > [constraint(C,A)|_T]. +[H,T|_T] > [[H|T]|_T]. +_T > [id('X_INTRODUCED_45')|_T]. +_T > [id('X_INTRODUCED_23')|_T]. +_T > [id('X_INTRODUCED_5')|_T]. +_T > [id('X_INTRODUCED_2')|_T]. +[E|_T] > [[E]|_T]. +[T,H|_T] > [[H|T]|_T]. +[T,H|_T] > [[H|T]|_T]. +[Es|_T] > [lit(Es,array(_))|_T]. +_T > [lit(0,int)|_T]. +[E|_T] > [[E]|_T]. +[T,H|_T] > [[H|T]|_T]. +[T,H|_T] > [[H|T]|_T]. +[AL|_T] > [C|_T] :- C =.. ['int_lin_eq'|AL]. +_T > [id('X_INTRODUCED_23')|_T]. +[E|_T] > [[E]|_T]. +_T > [[]|_T]. +[As, E|_T] > [[E|As]|_T]. +[A,C|_T] > [constraint(C,A)|_T]. +[H,T|_T] > [[H|T]|_T]. +_T > [id('X_INTRODUCED_45')|_T]. +_T > [id('X_INTRODUCED_28')|_T]. +_T > [id('X_INTRODUCED_4')|_T]. +_T > [id('X_INTRODUCED_0')|_T]. +[E|_T] > [[E]|_T]. +[T,H|_T] > [[H|T]|_T]. +[T,H|_T] > [[H|T]|_T]. +[Es|_T] > [lit(Es,array(_))|_T]. +_T > [lit(0,int)|_T]. +[E|_T] > [[E]|_T]. +[T,H|_T] > [[H|T]|_T]. +[T,H|_T] > [[H|T]|_T]. +[AL|_T] > [C|_T] :- C =.. ['int_lin_eq'|AL]. +_T > [id('X_INTRODUCED_28')|_T]. +[E|_T] > [[E]|_T]. +_T > [[]|_T]. +[As, E|_T] > [[E|As]|_T]. +[A,C|_T] > [constraint(C,A)|_T]. +[H,T|_T] > [[H|T]|_T]. +_T > [id('X_INTRODUCED_45')|_T]. +_T > [id('X_INTRODUCED_29')|_T]. +_T > [id('X_INTRODUCED_5')|_T]. +_T > [id('X_INTRODUCED_1')|_T]. +[E|_T] > [[E]|_T]. +[T,H|_T] > [[H|T]|_T]. +[T,H|_T] > [[H|T]|_T]. +[Es|_T] > [lit(Es,array(_))|_T]. +_T > [lit(0,int)|_T]. +[E|_T] > [[E]|_T]. +[T,H|_T] > [[H|T]|_T]. +[T,H|_T] > [[H|T]|_T]. +[AL|_T] > [C|_T] :- C =.. ['int_lin_eq'|AL]. +_T > [id('X_INTRODUCED_29')|_T]. +[E|_T] > [[E]|_T]. +_T > [[]|_T]. +[As, E|_T] > [[E|As]|_T]. +[A,C|_T] > [constraint(C,A)|_T]. +[H,T|_T] > [[H|T]|_T]. +_T > [id('X_INTRODUCED_45')|_T]. +_T > [id('X_INTRODUCED_35')|_T]. +_T > [id('X_INTRODUCED_5')|_T]. +_T > [id('X_INTRODUCED_0')|_T]. +[E|_T] > [[E]|_T]. +[T,H|_T] > [[H|T]|_T]. +[T,H|_T] > [[H|T]|_T]. +[Es|_T] > [lit(Es,array(_))|_T]. +_T > [lit(0,int)|_T]. +[E|_T] > [[E]|_T]. +[T,H|_T] > [[H|T]|_T]. +[T,H|_T] > [[H|T]|_T]. +[AL|_T] > [C|_T] :- C =.. ['int_lin_eq'|AL]. +_T > [id('X_INTRODUCED_35')|_T]. +[E|_T] > [[E]|_T]. +_T > [[]|_T]. +[As, E|_T] > [[E|As]|_T]. +[A,C|_T] > [constraint(C,A)|_T]. +[H,T|_T] > [[H|T]|_T]. +_T > [id('X_INTRODUCED_42')|_T]. +_T > [id('X_INTRODUCED_7')|_T]. +_T > [id('X_INTRODUCED_8')|_T]. +[E|_T] > [[E]|_T]. +[T,H|_T] > [[H|T]|_T]. +[Es|_T] > [lit(Es,array(_))|_T]. +_T > [lit(0,int)|_T]. +[E|_T] > [[E]|_T]. +[T,H|_T] > [[H|T]|_T]. +[T,H|_T] > [[H|T]|_T]. +[AL|_T] > [C|_T] :- C =.. ['int_lin_ne'|AL]. +_T > [[]|_T]. +[A,C|_T] > [constraint(C,A)|_T]. +[H,T|_T] > [[H|T]|_T]. +_T > [id('X_INTRODUCED_42')|_T]. +_T > [id('X_INTRODUCED_7')|_T]. +_T > [id('X_INTRODUCED_9')|_T]. +[E|_T] > [[E]|_T]. +[T,H|_T] > [[H|T]|_T]. +[Es|_T] > [lit(Es,array(_))|_T]. +_T > [lit(0,int)|_T]. +[E|_T] > [[E]|_T]. +[T,H|_T] > [[H|T]|_T]. +[T,H|_T] > [[H|T]|_T]. +[AL|_T] > [C|_T] :- C =.. ['int_lin_ne'|AL]. +_T > [[]|_T]. +[A,C|_T] > [constraint(C,A)|_T]. +[H,T|_T] > [[H|T]|_T]. +_T > [id('X_INTRODUCED_42')|_T]. +_T > [id('X_INTRODUCED_7')|_T]. +_T > [id('X_INTRODUCED_10')|_T]. +[E|_T] > [[E]|_T]. +[T,H|_T] > [[H|T]|_T]. +[Es|_T] > [lit(Es,array(_))|_T]. +_T > [lit(0,int)|_T]. +[E|_T] > [[E]|_T]. +[T,H|_T] > [[H|T]|_T]. +[T,H|_T] > [[H|T]|_T]. +[AL|_T] > [C|_T] :- C =.. ['int_lin_ne'|AL]. +_T > [[]|_T]. +[A,C|_T] > [constraint(C,A)|_T]. +[H,T|_T] > [[H|T]|_T]. +_T > [id('X_INTRODUCED_42')|_T]. +_T > [id('X_INTRODUCED_7')|_T]. +_T > [id('X_INTRODUCED_11')|_T]. +[E|_T] > [[E]|_T]. +[T,H|_T] > [[H|T]|_T]. +[Es|_T] > [lit(Es,array(_))|_T]. +_T > [lit(0,int)|_T]. +[E|_T] > [[E]|_T]. +[T,H|_T] > [[H|T]|_T]. +[T,H|_T] > [[H|T]|_T]. +[AL|_T] > [C|_T] :- C =.. ['int_lin_ne'|AL]. +_T > [[]|_T]. +[A,C|_T] > [constraint(C,A)|_T]. +[H,T|_T] > [[H|T]|_T]. +_T > [id('X_INTRODUCED_42')|_T]. +_T > [id('X_INTRODUCED_8')|_T]. +_T > [id('X_INTRODUCED_9')|_T]. +[E|_T] > [[E]|_T]. +[T,H|_T] > [[H|T]|_T]. +[Es|_T] > [lit(Es,array(_))|_T]. +_T > [lit(0,int)|_T]. +[E|_T] > [[E]|_T]. +[T,H|_T] > [[H|T]|_T]. +[T,H|_T] > [[H|T]|_T]. +[AL|_T] > [C|_T] :- C =.. ['int_lin_ne'|AL]. +_T > [[]|_T]. +[A,C|_T] > [constraint(C,A)|_T]. +[H,T|_T] > [[H|T]|_T]. +_T > [id('X_INTRODUCED_42')|_T]. +_T > [id('X_INTRODUCED_8')|_T]. +_T > [id('X_INTRODUCED_10')|_T]. +[E|_T] > [[E]|_T]. +[T,H|_T] > [[H|T]|_T]. +[Es|_T] > [lit(Es,array(_))|_T]. +_T > [lit(0,int)|_T]. +[E|_T] > [[E]|_T]. +[T,H|_T] > [[H|T]|_T]. +[T,H|_T] > [[H|T]|_T]. +[AL|_T] > [C|_T] :- C =.. ['int_lin_ne'|AL]. +_T > [[]|_T]. +[A,C|_T] > [constraint(C,A)|_T]. +[H,T|_T] > [[H|T]|_T]. +_T > [id('X_INTRODUCED_42')|_T]. +_T > [id('X_INTRODUCED_8')|_T]. +_T > [id('X_INTRODUCED_11')|_T]. +[E|_T] > [[E]|_T]. +[T,H|_T] > [[H|T]|_T]. +[Es|_T] > [lit(Es,array(_))|_T]. +_T > [lit(0,int)|_T]. +[E|_T] > [[E]|_T]. +[T,H|_T] > [[H|T]|_T]. +[T,H|_T] > [[H|T]|_T]. +[AL|_T] > [C|_T] :- C =.. ['int_lin_ne'|AL]. +_T > [[]|_T]. +[A,C|_T] > [constraint(C,A)|_T]. +[H,T|_T] > [[H|T]|_T]. +_T > [id('X_INTRODUCED_42')|_T]. +_T > [id('X_INTRODUCED_9')|_T]. +_T > [id('X_INTRODUCED_10')|_T]. +[E|_T] > [[E]|_T]. +[T,H|_T] > [[H|T]|_T]. +[Es|_T] > [lit(Es,array(_))|_T]. +_T > [lit(0,int)|_T]. +[E|_T] > [[E]|_T]. +[T,H|_T] > [[H|T]|_T]. +[T,H|_T] > [[H|T]|_T]. +[AL|_T] > [C|_T] :- C =.. ['int_lin_ne'|AL]. +_T > [[]|_T]. +[A,C|_T] > [constraint(C,A)|_T]. +[H,T|_T] > [[H|T]|_T]. +_T > [id('X_INTRODUCED_42')|_T]. +_T > [id('X_INTRODUCED_9')|_T]. +_T > [id('X_INTRODUCED_11')|_T]. +[E|_T] > [[E]|_T]. +[T,H|_T] > [[H|T]|_T]. +[Es|_T] > [lit(Es,array(_))|_T]. +_T > [lit(0,int)|_T]. +[E|_T] > [[E]|_T]. +[T,H|_T] > [[H|T]|_T]. +[T,H|_T] > [[H|T]|_T]. +[AL|_T] > [C|_T] :- C =.. ['int_lin_ne'|AL]. +_T > [[]|_T]. +[A,C|_T] > [constraint(C,A)|_T]. +[H,T|_T] > [[H|T]|_T]. +_T > [id('X_INTRODUCED_42')|_T]. +_T > [id('X_INTRODUCED_10')|_T]. +_T > [id('X_INTRODUCED_11')|_T]. +[E|_T] > [[E]|_T]. +[T,H|_T] > [[H|T]|_T]. +[Es|_T] > [lit(Es,array(_))|_T]. +_T > [lit(0,int)|_T]. +[E|_T] > [[E]|_T]. +[T,H|_T] > [[H|T]|_T]. +[T,H|_T] > [[H|T]|_T]. +[AL|_T] > [C|_T] :- C =.. ['int_lin_ne'|AL]. +_T > [[]|_T]. +[A,C|_T] > [constraint(C,A)|_T]. +[H,T|_T] > [[H|T]|_T]. +_T > [id('X_INTRODUCED_42')|_T]. +_T > [id('X_INTRODUCED_14')|_T]. +_T > [id('X_INTRODUCED_15')|_T]. +[E|_T] > [[E]|_T]. +[T,H|_T] > [[H|T]|_T]. +[Es|_T] > [lit(Es,array(_))|_T]. +_T > [lit(0,int)|_T]. +[E|_T] > [[E]|_T]. +[T,H|_T] > [[H|T]|_T]. +[T,H|_T] > [[H|T]|_T]. +[AL|_T] > [C|_T] :- C =.. ['int_lin_ne'|AL]. +_T > [[]|_T]. +[A,C|_T] > [constraint(C,A)|_T]. +[H,T|_T] > [[H|T]|_T]. +_T > [id('X_INTRODUCED_42')|_T]. +_T > [id('X_INTRODUCED_14')|_T]. +_T > [id('X_INTRODUCED_16')|_T]. +[E|_T] > [[E]|_T]. +[T,H|_T] > [[H|T]|_T]. +[Es|_T] > [lit(Es,array(_))|_T]. +_T > [lit(0,int)|_T]. +[E|_T] > [[E]|_T]. +[T,H|_T] > [[H|T]|_T]. +[T,H|_T] > [[H|T]|_T]. +[AL|_T] > [C|_T] :- C =.. ['int_lin_ne'|AL]. +_T > [[]|_T]. +[A,C|_T] > [constraint(C,A)|_T]. +[H,T|_T] > [[H|T]|_T]. +_T > [id('X_INTRODUCED_42')|_T]. +_T > [id('X_INTRODUCED_14')|_T]. +_T > [id('X_INTRODUCED_17')|_T]. +[E|_T] > [[E]|_T]. +[T,H|_T] > [[H|T]|_T]. +[Es|_T] > [lit(Es,array(_))|_T]. +_T > [lit(0,int)|_T]. +[E|_T] > [[E]|_T]. +[T,H|_T] > [[H|T]|_T]. +[T,H|_T] > [[H|T]|_T]. +[AL|_T] > [C|_T] :- C =.. ['int_lin_ne'|AL]. +_T > [[]|_T]. +[A,C|_T] > [constraint(C,A)|_T]. +[H,T|_T] > [[H|T]|_T]. +_T > [id('X_INTRODUCED_42')|_T]. +_T > [id('X_INTRODUCED_15')|_T]. +_T > [id('X_INTRODUCED_16')|_T]. +[E|_T] > [[E]|_T]. +[T,H|_T] > [[H|T]|_T]. +[Es|_T] > [lit(Es,array(_))|_T]. +_T > [lit(0,int)|_T]. +[E|_T] > [[E]|_T]. +[T,H|_T] > [[H|T]|_T]. +[T,H|_T] > [[H|T]|_T]. +[AL|_T] > [C|_T] :- C =.. ['int_lin_ne'|AL]. +_T > [[]|_T]. +[A,C|_T] > [constraint(C,A)|_T]. +[H,T|_T] > [[H|T]|_T]. +_T > [id('X_INTRODUCED_42')|_T]. +_T > [id('X_INTRODUCED_15')|_T]. +_T > [id('X_INTRODUCED_17')|_T]. +[E|_T] > [[E]|_T]. +[T,H|_T] > [[H|T]|_T]. +[Es|_T] > [lit(Es,array(_))|_T]. +_T > [lit(0,int)|_T]. +[E|_T] > [[E]|_T]. +[T,H|_T] > [[H|T]|_T]. +[T,H|_T] > [[H|T]|_T]. +[AL|_T] > [C|_T] :- C =.. ['int_lin_ne'|AL]. +_T > [[]|_T]. +[A,C|_T] > [constraint(C,A)|_T]. +[H,T|_T] > [[H|T]|_T]. +_T > [id('X_INTRODUCED_42')|_T]. +_T > [id('X_INTRODUCED_16')|_T]. +_T > [id('X_INTRODUCED_17')|_T]. +[E|_T] > [[E]|_T]. +[T,H|_T] > [[H|T]|_T]. +[Es|_T] > [lit(Es,array(_))|_T]. +_T > [lit(0,int)|_T]. +[E|_T] > [[E]|_T]. +[T,H|_T] > [[H|T]|_T]. +[T,H|_T] > [[H|T]|_T]. +[AL|_T] > [C|_T] :- C =.. ['int_lin_ne'|AL]. +_T > [[]|_T]. +[A,C|_T] > [constraint(C,A)|_T]. +[H,T|_T] > [[H|T]|_T]. +_T > [id('X_INTRODUCED_42')|_T]. +_T > [id('X_INTRODUCED_21')|_T]. +_T > [id('X_INTRODUCED_22')|_T]. +[E|_T] > [[E]|_T]. +[T,H|_T] > [[H|T]|_T]. +[Es|_T] > [lit(Es,array(_))|_T]. +_T > [lit(0,int)|_T]. +[E|_T] > [[E]|_T]. +[T,H|_T] > [[H|T]|_T]. +[T,H|_T] > [[H|T]|_T]. +[AL|_T] > [C|_T] :- C =.. ['int_lin_ne'|AL]. +_T > [[]|_T]. +[A,C|_T] > [constraint(C,A)|_T]. +[H,T|_T] > [[H|T]|_T]. +_T > [id('X_INTRODUCED_42')|_T]. +_T > [id('X_INTRODUCED_21')|_T]. +_T > [id('X_INTRODUCED_23')|_T]. +[E|_T] > [[E]|_T]. +[T,H|_T] > [[H|T]|_T]. +[Es|_T] > [lit(Es,array(_))|_T]. +_T > [lit(0,int)|_T]. +[E|_T] > [[E]|_T]. +[T,H|_T] > [[H|T]|_T]. +[T,H|_T] > [[H|T]|_T]. +[AL|_T] > [C|_T] :- C =.. ['int_lin_ne'|AL]. +_T > [[]|_T]. +[A,C|_T] > [constraint(C,A)|_T]. +[H,T|_T] > [[H|T]|_T]. +_T > [id('X_INTRODUCED_42')|_T]. +_T > [id('X_INTRODUCED_22')|_T]. +_T > [id('X_INTRODUCED_23')|_T]. +[E|_T] > [[E]|_T]. +[T,H|_T] > [[H|T]|_T]. +[Es|_T] > [lit(Es,array(_))|_T]. +_T > [lit(0,int)|_T]. +[E|_T] > [[E]|_T]. +[T,H|_T] > [[H|T]|_T]. +[T,H|_T] > [[H|T]|_T]. +[AL|_T] > [C|_T] :- C =.. ['int_lin_ne'|AL]. +_T > [[]|_T]. +[A,C|_T] > [constraint(C,A)|_T]. +[H,T|_T] > [[H|T]|_T]. +_T > [id('X_INTRODUCED_42')|_T]. +_T > [id('X_INTRODUCED_28')|_T]. +_T > [id('X_INTRODUCED_29')|_T]. +[E|_T] > [[E]|_T]. +[T,H|_T] > [[H|T]|_T]. +[Es|_T] > [lit(Es,array(_))|_T]. +_T > [lit(0,int)|_T]. +[E|_T] > [[E]|_T]. +[T,H|_T] > [[H|T]|_T]. +[T,H|_T] > [[H|T]|_T]. +[AL|_T] > [C|_T] :- C =.. ['int_lin_ne'|AL]. +_T > [[]|_T]. +[A,C|_T] > [constraint(C,A)|_T]. +[H,T|_T] > [[H|T]|_T]. +_T > [id('X_INTRODUCED_42')|_T]. +_T > [id('X_INTRODUCED_0')|_T]. +_T > [id('X_INTRODUCED_5')|_T]. +[E|_T] > [[E]|_T]. +[T,H|_T] > [[H|T]|_T]. +[Es|_T] > [lit(Es,array(_))|_T]. +_T > [lit(-1,int)|_T]. +[E|_T] > [[E]|_T]. +[T,H|_T] > [[H|T]|_T]. +[T,H|_T] > [[H|T]|_T]. +[AL|_T] > [C|_T] :- C =.. ['int_lin_le'|AL]. +_T > [[]|_T]. +[A,C|_T] > [constraint(C,A)|_T]. +[H,T|_T] > [[H|T]|_T]. +_T > [id('X_INTRODUCED_70')|_T]. +_T > [id('X_INTRODUCED_8')|_T]. +_T > [id('X_INTRODUCED_21')|_T]. +_T > [id('X_INTRODUCED_14')|_T]. +_T > [id('X_INTRODUCED_15')|_T]. +[E|_T] > [[E]|_T]. +[T,H|_T] > [[H|T]|_T]. +[T,H|_T] > [[H|T]|_T]. +[T,H|_T] > [[H|T]|_T]. +[Es|_T] > [lit(Es,array(_))|_T]. +_T > [lit(0,int)|_T]. +[E|_T] > [[E]|_T]. +[T,H|_T] > [[H|T]|_T]. +[T,H|_T] > [[H|T]|_T]. +[AL|_T] > [C|_T] :- C =.. ['int_lin_eq'|AL]. +_T > [[]|_T]. +[A,C|_T] > [constraint(C,A)|_T]. +[H,T|_T] > [[H|T]|_T]. +_T > [id('X_INTRODUCED_70')|_T]. +_T > [id('X_INTRODUCED_9')|_T]. +_T > [id('X_INTRODUCED_22')|_T]. +_T > [id('X_INTRODUCED_15')|_T]. +_T > [id('X_INTRODUCED_16')|_T]. +[E|_T] > [[E]|_T]. +[T,H|_T] > [[H|T]|_T]. +[T,H|_T] > [[H|T]|_T]. +[T,H|_T] > [[H|T]|_T]. +[Es|_T] > [lit(Es,array(_))|_T]. +_T > [lit(0,int)|_T]. +[E|_T] > [[E]|_T]. +[T,H|_T] > [[H|T]|_T]. +[T,H|_T] > [[H|T]|_T]. +[AL|_T] > [C|_T] :- C =.. ['int_lin_eq'|AL]. +_T > [[]|_T]. +[A,C|_T] > [constraint(C,A)|_T]. +[H,T|_T] > [[H|T]|_T]. +_T > [id('X_INTRODUCED_70')|_T]. +_T > [id('X_INTRODUCED_10')|_T]. +_T > [id('X_INTRODUCED_23')|_T]. +_T > [id('X_INTRODUCED_16')|_T]. +_T > [id('X_INTRODUCED_17')|_T]. +[E|_T] > [[E]|_T]. +[T,H|_T] > [[H|T]|_T]. +[T,H|_T] > [[H|T]|_T]. +[T,H|_T] > [[H|T]|_T]. +[Es|_T] > [lit(Es,array(_))|_T]. +_T > [lit(0,int)|_T]. +[E|_T] > [[E]|_T]. +[T,H|_T] > [[H|T]|_T]. +[T,H|_T] > [[H|T]|_T]. +[AL|_T] > [C|_T] :- C =.. ['int_lin_eq'|AL]. +_T > [[]|_T]. +[A,C|_T] > [constraint(C,A)|_T]. +[H,T|_T] > [[H|T]|_T]. +_T > [id('X_INTRODUCED_70')|_T]. +_T > [id('X_INTRODUCED_15')|_T]. +_T > [id('X_INTRODUCED_28')|_T]. +_T > [id('X_INTRODUCED_21')|_T]. +_T > [id('X_INTRODUCED_22')|_T]. +[E|_T] > [[E]|_T]. +[T,H|_T] > [[H|T]|_T]. +[T,H|_T] > [[H|T]|_T]. +[T,H|_T] > [[H|T]|_T]. +[Es|_T] > [lit(Es,array(_))|_T]. +_T > [lit(0,int)|_T]. +[E|_T] > [[E]|_T]. +[T,H|_T] > [[H|T]|_T]. +[T,H|_T] > [[H|T]|_T]. +[AL|_T] > [C|_T] :- C =.. ['int_lin_eq'|AL]. +_T > [[]|_T]. +[A,C|_T] > [constraint(C,A)|_T]. +[H,T|_T] > [[H|T]|_T]. +_T > [id('X_INTRODUCED_70')|_T]. +_T > [id('X_INTRODUCED_16')|_T]. +_T > [id('X_INTRODUCED_29')|_T]. +_T > [id('X_INTRODUCED_22')|_T]. +_T > [id('X_INTRODUCED_23')|_T]. +[E|_T] > [[E]|_T]. +[T,H|_T] > [[H|T]|_T]. +[T,H|_T] > [[H|T]|_T]. +[T,H|_T] > [[H|T]|_T]. +[Es|_T] > [lit(Es,array(_))|_T]. +_T > [lit(0,int)|_T]. +[E|_T] > [[E]|_T]. +[T,H|_T] > [[H|T]|_T]. +[T,H|_T] > [[H|T]|_T]. +[AL|_T] > [C|_T] :- C =.. ['int_lin_eq'|AL]. +_T > [[]|_T]. +[A,C|_T] > [constraint(C,A)|_T]. +[H,T|_T] > [[H|T]|_T]. +_T > [id('X_INTRODUCED_70')|_T]. +_T > [id('X_INTRODUCED_22')|_T]. +_T > [id('X_INTRODUCED_35')|_T]. +_T > [id('X_INTRODUCED_28')|_T]. +_T > [id('X_INTRODUCED_29')|_T]. +[E|_T] > [[E]|_T]. +[T,H|_T] > [[H|T]|_T]. +[T,H|_T] > [[H|T]|_T]. +[T,H|_T] > [[H|T]|_T]. +[Es|_T] > [lit(Es,array(_))|_T]. +_T > [lit(0,int)|_T]. +[E|_T] > [[E]|_T]. +[T,H|_T] > [[H|T]|_T]. +[T,H|_T] > [[H|T]|_T]. +[AL|_T] > [C|_T] :- C =.. ['int_lin_eq'|AL]. +_T > [[]|_T]. +[A,C|_T] > [constraint(C,A)|_T]. +[H,T|_T] > [[H|T]|_T]. +[X|_T] > [constrs(X)|_T]. +_T > [id('costas')|_T]. +_T > [id('input_order')|_T]. +_T > [id('indomain_min')|_T]. +_T > [id('complete')|_T]. +[E|_T] > [[E]|_T]. +[T,H|_T] > [[H|T]|_T]. +[T,H|_T] > [[H|T]|_T]. +[T,H|_T] > [[H|T]|_T]. +_T > [[]|_T]. +[As, E|_T] > [[E|As]|_T]. +_T > [satisfy|_T]. +[S,A|_T] > [solve(S, A)|_T]. +[S,C,V,P|_T] > [fzn(P, V, C, S)|_T]. diff --git a/fzn-parser/fznslurp.pl b/fzn-parser/fznslurp.pl index 4157f42..42d271f 100644 --- a/fzn-parser/fznslurp.pl +++ b/fzn-parser/fznslurp.pl @@ -13,11 +13,16 @@ main([]). action(load(F)) :- !, see(F), action(load), seen. action(load) :- !, load_ast(AST), g_assign(ast, AST). +action(dump(A)) :- !, dump_ast(A). action(dump) :- !, g_read(ast, AST), dump_ast(AST). action(name) :- !, g_read(ast, AST), - sa_names(AST, NAST), - g_assign(ast, NAST). + sa_names(AST, NAST, ST), + g_assign(ast_n, NAST+ST). +action(type) :- !, + g_read(ast_n, AST+ST), + sa_types(AST, ST), + g_assign(ast_t, AST+ST). action(halt) :- !, halt. action(debug) :- g_read(ast_debug, true), !, g_assign(ast_debug, false). action(debug) :- !, g_assign(ast_debug, true). diff --git a/fzn-parser/semantic.pl b/fzn-parser/semantic.pl index 13ef5d8..6186c1c 100644 --- a/fzn-parser/semantic.pl +++ b/fzn-parser/semantic.pl @@ -1,7 +1,13 @@ % == No, Emacs this is -*-Prolog-*- code, not what you thought... ============= +% == NAMES ==================================================================== + +% -- sa_names(AST_IN, AST_OUT, ST) -------------------------------------------- +% +% sa_names/3: do name analysis (replace identifiers by their dict. entry) + sa_names(fzn(preds(IP), vars(IV), constrs(IC), SOLVE), - fzn(preds(OP), vars(OV), constrs(OC), SOLVE, ST)) :- + fzn(preds(OP), vars(OV), constrs(OC), SOLVE), ST) :- sa_n_traverse(IP, OP, ST), % predicates sa_n_traverse(IV, OV, ST), % variables sa_n_traverse(IC, OC, ST). % constraints @@ -17,14 +23,22 @@ sa_n_traverse([_|Ns], NNs, ST) :- !, % ignore failing nodes (beware!) sa_n_traverse(N, NN, ST) :- sa_n(N, NN, ST). % non-list case + % - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - % % sa_n(AST_N_IN, AST_N_OUT, ST) % +% arguments: +% AST_N_IN - input AST node +% AST_N_OUT - output AST node (same structure, rewritten) +% ST - symbol table (gets extended) +% % handle all AST cases: -% var(N,T,I,A) - variable declaration -% lit(V,T) - literal with type -% +% var(N,T,I,A) - Name, Type, Initializer, Attrib -- variable declaration +% lit(V,T) - Value, Type -- literal with type +% id(N) - Name -- identifier +% constraint(C,A) - Constraint, Attrib -- constraint +% sa_n(var(N,T,I,A), V, ST) :- sa_attribs(A, AX, ST), @@ -32,18 +46,58 @@ sa_n(var(N,T,I,A), V, ST) :- V=var(N,T,NI,AX), % new AST node becomes ST entry value st_insert(ST, N, V). + sa_n(lit(E,array(T)), lit(NE, array(T)), ST) :- sa_n_traverse(E, NE, ST). sa_n(lit(E,int), lit(E,int), _ST). sa_n(lit(E,float), lit(E,float), _ST). sa_n(lit(E,string), lit(E,string), _ST). + sa_n(id(N), V, ST) :- st_lookup(ST, N, V), !. -sa_n(id(N), V, ST) :- V=id(N,_), % type as yet unknown +sa_n(id(N), V, ST) :- V=var(N,_,_,_), % type as yet unknown st_insert(ST, N, V). + +sa_n(constraint(CE, AT), constraint(NCE, AT), ST) :- + CE=..[C|AS], + sa_n_traverse(AS, NAS, ST), + NCE=..[C|NAS]. + % - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +% == TYPES ==================================================================== + +% -- sa_types(AST, ST) -------------------------------------------------------- +% +% sa_types/2: do type analysis (traverse AST enforcing type correctness). +% as a side-effect, it will do type inference. + +sa_types(fzn(_PS, vars(VS), constrs(CS), _S), ST) :- + sa_t_traverse(VS, ST), + sa_t_traverse(CS, ST). + +% ----------------------------------------------------------------------------- + +sa_t_traverse([], _ST) :- !. +sa_t_traverse([N|Ns], ST) :- + sa_t(N, ST), !, + sa_t_traverse(Ns, ST). +sa_t_traverse([_|Ns], ST) :- !, % ignore failing nodes (beware!) + sa_t_traverse(Ns, ST). + +sa_t_traverse(N, ST) :- sa_t(N, ST). % non-list case + +% -- sa_t(NODE, ST) ----------------------------------------------------------- + +sa_t(var(_N,T,I,_A), _ST) :- type(I,T). +sa_t(lit(E,T), _ST) :- type(lit(E,T), T). +sa_t(constraint(CE, _AT), ST) :- + CE=..[_|AS], + sa_t_traverse(AS, ST). + +% ============================================================================= + sa_attribs([A|As], [NA|NAs], ST) :- sa_attrib(A, NA, ST), !, sa_attribs(As, NAs, ST). @@ -55,3 +109,4 @@ sa_attribs([], [], _). sa_attrib(id(output_var), output, _). % ----------------------------------------------------------------------------- + diff --git a/fzn-parser/types.pl b/fzn-parser/types.pl index bac9eca..a06ed22 100644 --- a/fzn-parser/types.pl +++ b/fzn-parser/types.pl @@ -1,6 +1,26 @@ % == No, Emacs this is -*-Prolog-*- code, not what you thought... ============= -% sa_type/2 - locate the TYPE field +% -- type(NODE, TYPE) --------------------------------------------------------- +% +% type/2: Extract type from AST node. -sa_type(var(_NAME,TYPE,_INIT,_ANNOT), TYPE). -sa_type(constraint(_NAME)). +type(var(_,T,_,_), T) :- type(T). +type(lit(_,T), T) :- type(T). +type(id(_,T), T) :- type(T). + +type(lit(E,array(T)), array(T)) :- type(E, T). +type(lit(_,T), T) :- type(T). + +type([], _). +type([E|Es], T) :- type(E, T), type(Es, T). + +% -- type(TYPE) --------------------------------------------------------------- +% +% type/1: generate or test valid types. + +type(int). % integer +type(int(_L,_U)). % integer interval +type(float). % floating point +type(float(_L,_U)). % floating point interval +type(string). % string +type(array(T,1,_U)) :- type(T). % array of type -- libgit2 0.21.2