Lazy Eval and Parallel Processing in Python!

Ha! Yeah I looked at the union version and saw it was completely contradicting the point of why I was using Neumann Natural Numbers

Yeah his frozen set idea helped with one thing: it is hashable, meaning I can use “such that” (in python “is” operator) and use constructive ordinals to describe the state of being…

Unfortunately I need an infinite list of set interpolations (mostly one to describe something which is completely non-temporary)

Perhaps you could use a generator, depending on what your needs are. But as others have said, it seems like a computer algebra system like sympy, or some sort of custom class, are likely close to what you have in mind. Computers do not have infinite memory, therefore one cannot have an infinite list (or set).

1 Like

Isn’t there an algorithm for to infinity and beyond?

Yes. It is colloquially called “flying”, but the more technical terminology is “falling with style”. Here’s a demonstration of its application:

1 Like

What is an ASI?

From acronym finder:

What does ASI stand for? Your abbreviation search returned 158 meanings

Is this “Artificial Super Intelligence”?

What do you mean by “a hierarchy of presence”? It isn’t mentioned in the wikipedia page about set interpolation. I only know that term from marketing bullshit related to internet influencers.

Why don’t you just use plain old natural numbers?

To represent 100 using a Python int requires 28 bytes and is almost as fast as native machine arithmetic.

To represent 100 using a nested frozen set requires 21816 bytes and looks like this:

frozenset({frozenset({frozenset({frozenset({frozenset({frozenset({frozenset({frozenset({frozenset({frozenset({frozenset({frozenset({frozenset({frozenset({frozenset({frozenset({frozenset({frozenset({frozenset({frozenset({frozenset({frozenset({frozenset({frozenset({frozenset({frozenset({frozenset({frozenset({frozenset({frozenset({frozenset({frozenset({frozenset({frozenset({frozenset({frozenset({frozenset({frozenset({frozenset({frozenset({frozenset({frozenset({frozenset({frozenset({frozenset({frozenset({frozenset({frozenset({frozenset({frozenset({frozenset({frozenset({frozenset({frozenset({frozenset({frozenset({frozenset({frozenset({frozenset({frozenset({frozenset({frozenset({frozenset({frozenset({frozenset({frozenset({frozenset({frozenset({frozenset({frozenset({frozenset({frozenset({frozenset({frozenset({frozenset({frozenset({frozenset({frozenset({frozenset({frozenset({frozenset({frozenset({frozenset({frozenset({frozenset({frozenset({frozenset({frozenset({frozenset({frozenset({frozenset({frozenset({frozenset({frozenset({frozenset({frozenset({frozenset({frozenset({frozenset({frozenset({frozenset()})})})})})})})})})})})})})})})})})})})})})})})})})})})})})})})})})})})})})})})})})})})})})})})})})})})})})})})})})})})})})})})})})})})})})})})})})})})})})})})})})})})})})})})})})})})})})})})})})})})})

A nested set 1000 levels deep cannot even be printed:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
RecursionError: maximum recursion depth exceeded while getting the repr of an object

You can’t do any arithmetic on it each find the successor, so you would have to define your own add, multiply etc functions, which would be horrifically slow.

And your end result, “the best possible output under any conditions”, isn’t even well-defined. Best according to what?

3 Likes

Yeah true I should be making these algorithms myself…

Thanks for the advice

Oooh use an if statement
Wtf

I have another problem…


Q = set()
N = []
if len(N) <= float('inf'):
 N.append(Q)
 Q = set(Q)
v = i = k = n = N.index()
N_inf = N[-1]

N.index() doesn’t make various subsets of N

I’m trying to make v, i, k, and n any (not just all) of the subsets in N

I’m going to assume the above is merely a snippit of some larger file, since it doesn’t appear to do anything at all useful (or really, much of anything at all).

As a sidenote, the one-space intents make the code harder than it should be to read and follow and I’ve never seen them used in real-world Python code; I’d suggest using standard four space intents (or, if you absolutely must, two spaces).

As others have already explained to you, it should be abundantly obvious that that it is both theoretically and practically impossible for the length of a collection to be greater than infinity (or even equal to it).

Conceptually, infinity is mathematically defined as being larger than any integer number; therefore, how could the a collection’s length, an integer, ever be equal to (much less greater than) infinity? Concretely, this would imply that not only would the list occupy infinite memory (which does not exist), but greater than infinite memory, which cannot possibly exist even as an abstract concept, and indeed, neither could any numeric value reprisentable by Python compare greater than infinity.

Concretely, it means this if statement does nothing and can simply be elided. Conceptually, particularly given others have already explained it to you and yet this misunderstanding persists, it implies you might want to fundamentally re-evaluate both your theoretical and practical understanding of this matter, as this suggests a broader pattern of fundamentally flawed reasoning.

As mentioned previously by others, this simply creates a copy of the existing set Q. Since Q is the empty set, it is simpler and more efficient to simply do Q = set(). This may be unnecessary to begin with, since at least in the code snippit above, Q is never used again after this line, and you may or may not actually want a copy of Q rather than the original, depending on your intent.

Of course it doesn’t, as N.index() doesn’t have anything to do with “mak[ing] various subsets” of a sequence; rather, if you read the documentation, N.index(x, [i, [j]]) returns the

index of the first occurrence of x in s (at or after index i and before index j )

This returns at most a single item, not a “subset”; for the latter, you want slicing, comprehensions or other methods. Furthermore, the code above is not valid; you must pass at least one argument, the value of the item x from your sequence that you want to get the index of. From your description, it is not obvious what that might be, given the code has no logical connection to the purpose stated for it.

While syntactically, there is nothing wrong with this statement, the variable name would imply that the result should have something to do with infinity; given this is merely the last item in a necessarily finite sequence, I don’t really see how it does.