add support for algebraic functions in minpoly
fix test failures
add tests for minpoly over fraction fields
Fix bug in _choose_factor
minpoly: check that the variable is not contained in the ground domain
minpoly: fix test failures
minpoly: add support for algebraic extensions of QQ
minpoly: update documentation

also rename _minpoly_op_algebraic_number to _minpoly_op_algebraic_element
and update error messages
minpoly: add more tests
minpoly: fix doctest error
Report test name in case of runtest failure; add missing print_function.

Make runtests.py report the name of a test if an exception is thrown
before it outputs the test name normally. This makes sure that the
name of a test is printed even in the face of runtest machinery failure.

Added a print_function import from __future__ to test_codegen, which
would make tests fail all over the place when --enhance-asserts was
active.
Make degree(0) == -oo in the polys

Previously, degree(0) was -1. This makes sense for the dense representation,
because then one can use degree in place of len(f) - 1, but outside of that,
it makes little sense. In particular, the very important formula regarding
degree, deg(f*g) == deg(f) + deg(g), does not hold unless deg(0) == -oo.
Therefore, any code that does arithmetic on a degree and then makes a
comparison against it (like "if degree(f) - 1 > 0"), such as some code in the
Risch algorithm) was previously for 0 but generally correct now.

Fixing this just means being more careful about when you mean degree(f) and
when you mean len(f) - 1 in the dense representation algorithms.  Another
argument for this is that the change in the sparse code required no additional
changes anywhere; apparently the degree does not correspond to any natural
quantity in the sparse representation.
Fix typo
Fix some additional issues caused by degree(0) == -oo
Drop unused skip_abs option for Expr.compute_leading_term and calculate_series

    This was introduced in 89c7626 and then this option was unused since 9c46974
Drop obsoleted docs about skip_log option of compute_leading_term()

    This was replaced by logx option in 9c46974d
Issue 4009: Fix predicate detection in simplify_logic.

Previously, simplify_logic would assume all free symbols were predicates, and
would construct a truth table based on results of substituting True/False for
each.  This would sometimes result in incorrect simplifications when Boolean
structures were made containing other expressions.  Now, it takes anything
that is not a BooleanFunction as a predicate, then simplifies the predicates
before reassembling.
Add optional simplify parameter to simplify_logic.

Specifies whether to apply recursive simplification to predicates contained
within the boolean function being simplified.
Use xreplace instead of subs in simplify_logic.

Subs had an issue where one predicate of a boolean function was contained
entirely within another predicate of a boolean function (eg. predicates x,
and x+1).  The smaller predicate would sometimes be substituted before the
larger, causing the larger to not be substituted, and potentially causing
the simplification to produce incorrect results.  This appeared to happen
on only some invocations of the interpreter: the added test would sometimes
pass and sometimes fail.

Xreplace instead searches for all predicates simultaneously, matching the
largest predicate that it can in any expression, thereby preventing this
issue.
Wester test cases N12-O3 added