:- module rational.
:- pragma termination_info(rational.'<'((builtin.in), (builtin.in)), finite(0, [no, no]), can_loop).
:- pragma termination_info(rational.'>'((builtin.in), (builtin.in)), finite(0, [no, no]), can_loop).
:- pragma termination_info(rational.'=<'((builtin.in), (builtin.in)), finite(0, [no, no]), can_loop).
:- pragma termination_info(rational.'>='((builtin.in), (builtin.in)), finite(0, [no, no]), can_loop).
:- pragma termination_info(rational.rational((builtin.in)) = (builtin.out), infinite, can_loop).
:- pragma termination_info(rational.rational((builtin.in), (builtin.in)) = (builtin.out), infinite, can_loop).
:- pragma termination_info(rational.from_integer((builtin.in)) = (builtin.out), infinite, can_loop).
:- pragma termination_info(rational.from_integers((builtin.in), (builtin.in)) = (builtin.out), infinite, can_loop).
:- pragma termination_info(rational.'+'((builtin.in)) = (builtin.out), finite(0, [yes, no]), cannot_loop).
:- pragma termination_info(rational.'-'((builtin.in)) = (builtin.out), infinite, cannot_loop).
:- pragma termination_info(rational.'+'((builtin.in), (builtin.in)) = (builtin.out), infinite, can_loop).
:- pragma termination_info(rational.'-'((builtin.in), (builtin.in)) = (builtin.out), infinite, can_loop).
:- pragma termination_info(rational.'*'((builtin.in), (builtin.in)) = (builtin.out), infinite, can_loop).
:- pragma termination_info(rational.'/'((builtin.in), (builtin.in)) = (builtin.out), infinite, can_loop).
:- pragma termination_info(rational.numer((builtin.in)) = (builtin.out), finite(-2, [yes, no]), cannot_loop).
:- pragma termination_info(rational.denom((builtin.in)) = (builtin.out), finite(-2, [yes, no]), cannot_loop).
:- pragma termination_info(rational.abs((builtin.in)) = (builtin.out), infinite, cannot_loop).
:- pragma termination_info(rational.reciprocal((builtin.in)) = (builtin.out), infinite, can_loop).
:- pragma termination_info((rational.one) = (builtin.out), finite(10, [no]), cannot_loop).
:- pragma termination_info((rational.zero) = (builtin.out), finite(8, [no]), cannot_loop).
:- pragma termination_info(rational.rational_norm((builtin.in), (builtin.in)) = (builtin.out), infinite, can_loop).
:- pragma termination_info(rational.cmp((builtin.in), (builtin.in)) = (builtin.out), finite(0, [no, no, no]), can_loop).
:- pragma exceptions(predicate, (rational.(<)), 2, 0, may_throw(user_exception)).
:- pragma exceptions(predicate, (rational.(>)), 2, 0, may_throw(user_exception)).
:- pragma exceptions(predicate, (rational.(=<)), 2, 0, may_throw(user_exception)).
:- pragma exceptions(predicate, (rational.(>=)), 2, 0, may_throw(user_exception)).
:- pragma exceptions(function, (rational.rational), 2, 0, may_throw(user_exception)).
:- pragma exceptions(function, (rational.rational), 3, 0, may_throw(user_exception)).
:- pragma exceptions(function, (rational.from_integer), 2, 0, may_throw(user_exception)).
:- pragma exceptions(function, (rational.from_integers), 3, 0, may_throw(user_exception)).
:- pragma exceptions(function, (rational.(+)), 2, 0, will_not_throw).
:- pragma exceptions(function, (rational.(-)), 2, 0, will_not_throw).
:- pragma exceptions(function, (rational.(+)), 3, 0, may_throw(user_exception)).
:- pragma exceptions(function, (rational.(-)), 3, 0, may_throw(user_exception)).
:- pragma exceptions(function, (rational.(*)), 3, 0, may_throw(user_exception)).
:- pragma exceptions(function, (rational.(/)), 3, 0, may_throw(user_exception)).
:- pragma exceptions(function, (rational.numer), 2, 0, will_not_throw).
:- pragma exceptions(function, (rational.denom), 2, 0, will_not_throw).
:- pragma exceptions(function, (rational.abs), 2, 0, will_not_throw).
:- pragma exceptions(function, (rational.reciprocal), 2, 0, may_throw(user_exception)).
:- pragma exceptions(function, (rational.one), 1, 0, will_not_throw).
:- pragma exceptions(function, (rational.zero), 1, 0, will_not_throw).
:- pragma exceptions(function, (rational.rational_norm), 3, 0, may_throw(user_exception)).
:- pragma exceptions(function, (rational.cmp), 3, 0, may_throw(user_exception)).
