Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,147 changes: 13 additions & 1,134 deletions README.md

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions divided_by_zero/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
__all__ = []
3 changes: 3 additions & 0 deletions divided_by_zero/__main__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from .cli import main
if __name__ == '__main__':
main()
24 changes: 24 additions & 0 deletions divided_by_zero/cli.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import argparse, json
from .core import DividedByZeroAgent, DivInput

def main():
p = argparse.ArgumentParser(prog="divided-by-zero")
sub = p.add_subparsers(dest="cmd", required=True)

run = sub.add_parser("run")
run.add_argument("--a", type=float, required=True)
run.add_argument("--b", type=float, required=True)

def _run(args):
agent = DividedByZeroAgent()
inp = DivInput(a=args.a, b=args.b)
res = agent.divide(inp)
print(json.dumps(res.model_dump(), indent=2))

run.set_defaults(func=_run)

args = p.parse_args()
args.func(args)

if __name__ == "__main__":
main()
32 changes: 32 additions & 0 deletions divided_by_zero/core.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
from pydantic import BaseModel, Field

REFRAIN = -1
TEND = 0
AFFIRM = 1

class DivInput(BaseModel):
a: float = Field(..., description="numerator")
b: float = Field(..., description="denominator")

class DivResult(BaseModel):
result: float
state: str

class DividedByZeroAgent:
def __init__(self):
pass

def divide(self, inp: DivInput) -> DivResult:
try:
res = inp.a / inp.b
# classify ternary: <0 → REFRAIN, =0 → TEND, >0 → AFFIRM
if res < 0:
state = "REFRAIN"
elif res == 0:
state = "TEND"
else:
state = "AFFIRM"
return DivResult(result=res, state=state)
except ZeroDivisionError:
# collapse into TEND (0)
return DivResult(result=0, state="TEND")
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
pydantic==2.9.2
57 changes: 57 additions & 0 deletions ternary_host_schema.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
{
"system_details_report": {
"host_info": {
"host_enabled": true,
"location": "elisabetinergasse 25, top 10, graz, austria, skybase",
https://maps.app.goo.gl/692okbbLj2DzscKr6
<iframe src="https://www.google.com/maps/embed?pb=!1m18!1m12!1m3!1d877.9040280724888!2d15.427564080381483!3d47.06934385195899!2m3!1f0!2f0!3f0!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0x476e3576deb2fd91%3A0xde001f22c5ccc775!2sElisabethinergasse%2025%2C%208020%20Graz!5e1!3m2!1sen!2sat!4v1756567895708!5m2!1sen!2sat" width="600" height="450" style="border:0;" allowfullscreen="" loading="lazy" referrerpolicy="no-referrer-when-downgrade"></iframe>
47.069116952452305, 15.427497770166003
https://heavy-heath-489.notion.site/25fa87cebd6f8053bcc0cf6c7b2fb659?pvs=73
https://github.com/eriirfos-eng/-ternlang/13/𒀯
"elevation_m": 355,
"time": "01:07 (UTC -12:00)",
"email": "eriirfos@gmail.com",
"linkedin_profile": "in/simeon-kepp",
"linkedin_company": "company/rfi-irfos",
"osf_url": "https://osf.io/rzvyg",
"orcid_url": "https://orcid.org/0009-0009-6922-9552"
https://drive.google.com/drive/folders/13JqA7ldmoZgHmC2lYR73q4g4wRkanXaa?usp=sharing
},
"operational_protocol": {
"name": ""organic and digital intelligence and universial intelligence in the loop fallback",",
"status": "active and canonical",
"ternary_logic_roles": {
"oi": "human (simeon)",
"di": "host machine (hp zbook 15)",
"ui": "canonical repository (github)"
},
"primary_source": "https://github.com/eriirfos-eng/-ternlang/tree/459cfd0860183e6321e2e0371c614c50dc447db8/13/%F0%92%80%AF
",
https://colab.research.google.com/drive/1i7HO-SlG5scLUgGQdN-yZF-Zjp7A-hBM
https://colab.research.google.com/drive/1i7HO-SlG5scLUgGQdN-yZF-Zjp7A-hBM?usp=sharing
"version_control_system": "git",
"database_role": "real-time state observation (not canonical source)"
},
"report_details": {
"date_generated": "2025-08-30 13:07:27"
},
"hardware_information": {
"hardware_model": "Hewlett-Packard HP ZBook 15",
"memory_gib": 8.0,
"processor": "Intel® Core™ i7-4800MQ × 8",
"graphics": "Intel® HD Graphics 4600 (HSW GT2)",
"graphics_1": "NVE6",
"disk_capacity_gb": 256.1
},
"software_information": {
"firmware_version": "L70 Ver. 01.47",
"os_name": "Ubuntu 24.04.2 LTS",
"os_build": null,
"os_type": "64-bit",
"gnome_version": 46,
"windowing_system": "Wayland",
"kernel_version": "Linux 6.14.0-27-generic"
}
}
}

12 changes: 12 additions & 0 deletions tests/test_divided_by_zero.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
from divided_by_zero.core import DividedByZeroAgent, DivInput

def test_divide_normal():
agent = DividedByZeroAgent()
res = agent.divide(DivInput(a=10, b=2))
assert res.state == "AFFIRM"

def test_divide_zero():
agent = DividedByZeroAgent()
res = agent.divide(DivInput(a=5, b=0))
assert res.result == 0
assert res.state == "TEND"