SSM-Infinity — Practical Code Snippets & Usage Patterns

How to use directional infinity safely inside real symbolic workflows.


This final page gives ready-to-use, minimal, clean Python examples that demonstrate how SSM-Infinity works in actual symbolic workflows.

All examples below use only the public v1.0 engine (ssm_infinity_core.py).


1. Creating Directional Infinity

from ssm_infinity_core import SymbolicInfinity

# +∞ with posture 0.6
x = SymbolicInfinity(+1, 0.6)

# -∞ with posture -0.3
y = SymbolicInfinity(-1, -0.3)

print(x)
print(y)

Output:

<+∞, a=0.600000>
<-∞, a=-0.300000>


2. Addition & Subtraction

x = SymbolicInfinity(+1, 0.8)
y = SymbolicInfinity(-1, 0.2)

print(x + y)    # zero-class or infinite-class
print(x - y)    # infinite-class (direction depends on posture)

Behaviour:

  • Same sign → infinite-class
  • Opposite signs → zero-class
  • Alignment is preserved via atanh/tanh merging.

3. Multiplication

x = SymbolicInfinity(+1, 0.4)

print(x * 5)     # infinite-class (+∞)
print(x * -2)    # infinite-class (-∞)
print(x * 0)     # zero-class

Interpretation:

  • Multiplying by positive → direction stays
  • Multiplying by negative → direction flips
  • Multiplying by zero → zero-class (deterministic)

4. Division

x = SymbolicInfinity(-1, 0.7)
y = SymbolicInfinity(-1, 0.2)

print(x / y)     # finite-class
print(x / 3)     # infinite-class
print(x / 0)     # undefined

Division has clean symbolic outcomes:

  • ∞ / ∞ → finite-class
  • finite / ∞ → zero-class
  • ∞ / 0 → undefined (only undefined case)

5. Exponentiation

x = SymbolicInfinity(+1, 0.9)

print(x ** 3)     # infinite-class
print(x ** -4)    # zero-class

Meaning:

  • Positive exponent → infinite-class
  • Negative exponent → zero-class
  • Lane remains stable and bounded

6. Unary Operations

x = SymbolicInfinity(+1, 0.5)

print(-x)   # <−∞, posture preserved>

Negation flips direction but keeps posture.


7. Using SSM-Infinity in Calculus / Asymptotics

Example: symbolic asymptotic comparison.

f = SymbolicInfinity(+1, 0.2)   # slower divergence
g = SymbolicInfinity(+1, 0.9)   # sharper divergence

print(f - g)   # zero-class or finite-class, depending on posture
print(f + g)   # infinite-class with merged alignment

Now asymptotic comparisons carry posture rather than becoming undefined.


8. Pattern for Safe Integration in Pipelines

To integrate SSM-Infinity into symbolic pipelines:

def safe_combine(a, b):
    # Accept real numbers or infinite values
    if isinstance(a, SymbolicInfinity) or isinstance(b, SymbolicInfinity):
        return a + b
    return a + b   # classical fallback

This pattern lets SSM-Infinity sit beside any classical system.


9. The Universal Rule

Every expression will always evaluate to one of:

("infinite-class", SymbolicInfinity)
("zero-class", lane)
("finite-class", lane)
("undefined", None)

Nothing else is possible.
This is the clean, closed algebra that makes SSM-Infinity mathematically safe.


Page Navigation

Previous: SSSM-Infinity — Practical Scenarios & Real-World Examples
End of Series


Directory of Pages
SSM-Infinity – Table of Contents


Disclaimer

This page demonstrates symbolic usage patterns of Shunyaya Symbolic Mathematical Infinity (SSM-Infinity) and is not intended for operational or critical decision-making.