#16676: Cardinality of infinite sets loops forever
--------------------------------------+------------------------
Reporter: defeo | Owner:
Type: defect | Status: new
Priority: major | Milestone: sage-6.3
Component: combinatorics | Resolution:
Keywords: sets infinite_loop | Merged in:
Authors: | Reviewers:
Report Upstream: N/A | Work issues:
Branch: | Commit:
Dependencies: | Stopgaps:
--------------------------------------+------------------------
Comment (by vdelecroix):
Hi,
This is not a bug. Deciding if an iterator is finite is semi-decidable and
I do not want that because only half of the answer is known we do not give
it a try. There are many problems which are known to be undecidable (like
equality of symblolic stuff, or the word problem in fg groups). But it is
worth it to design the best algorithm that answer most of the cases.
One way to "fix" this non-problem would be to through a warning before we
start the enumeration:
{{{
sage: QQ.difference(ZZ).cardinality()
Warning: Sage does not know whether this set is finite or infinite
and will try to enumerate of all its element to see... (you can
interrupt the computation with Ctrl-C in the console or Echap
in the notebook)
}}}
Vincent
--
Ticket URL: <http://trac.sagemath.org/ticket/16676#comment:1>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/d/optout.