ychr-0.1.0.0: test/golden/arith_int/arith_int.chr
:- module(arith_int, [t/2, type(tags/0)]).
:- use_module(prelude).
:- chr_constraint t/2.
:- chr_type tags ---> add_pos ; add_zero ; add_neg ; sub_pos ; sub_neg ; mul_pos ; mul_neg ; mul_zero ; div_pos ; div_neg_num ; div_neg_den ; div_both_neg ; div_exact ; mod_pos ; mod_zero ; mod_neg_num ; mod_neg_den ; rem_pos ; rem_zero ; rem_neg_num ; rem_neg_den ; rem_both_neg ; big.
t(add_pos, R) <=> R is 3 + 5.
t(add_zero, R) <=> R is 7 + 0.
t(add_neg, R) <=> R is 3 + (-5).
t(sub_pos, R) <=> R is 10 - 4.
t(sub_neg, R) <=> R is 4 - 10.
t(mul_pos, R) <=> R is 6 * 7.
t(mul_neg, R) <=> R is 6 * (-7).
t(mul_zero, R) <=> R is 6 * 0.
t(div_pos, R) <=> R is 20 div 3.
t(div_neg_num, R) <=> R is (-20) div 3.
t(div_neg_den, R) <=> R is 20 div (-3).
t(div_both_neg, R) <=> R is (-20) div (-3).
t(div_exact, R) <=> R is 21 div 3.
t(mod_pos, R) <=> R is 20 mod 3.
t(mod_zero, R) <=> R is 21 mod 3.
t(mod_neg_num, R) <=> R is (-20) mod 3.
t(mod_neg_den, R) <=> R is 20 mod (-3).
t(rem_pos, R) <=> R is 20 rem 3.
t(rem_zero, R) <=> R is 21 rem 3.
t(rem_neg_num, R) <=> R is (-20) rem 3.
t(rem_neg_den, R) <=> R is 20 rem (-3).
t(rem_both_neg, R) <=> R is (-20) rem (-3).
t(big, R) <=> R is 1000000 * 1000000.