File size: 2,556 Bytes
046282a
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
"""
Project Norn V18: Quickstart Inference Demonstration
Osakra Research — 9B Frontier Neuro-Symbolic Intelligence
Powered by Qwen3.8-9B-Distill Backbone
"""

import os
import sys
import json
import time
import urllib.request

OLLAMA_API = "http://localhost:11434/api/generate"
MODEL_NAME = "norn-v18"

def test_inference(query: str, title: str):
    print("\n" + "=" * 70)
    print(f"  {title}")
    print("=" * 70)
    print(f"[Prompt]: {query}\n")

    payload = {
        "model": MODEL_NAME,
        "prompt": query,
        "stream": False,
        "options": {
            "num_ctx": 8192,
            "temperature": 0.2,
            "top_p": 0.95,
            "repeat_penalty": 1.15
        }
    }

    t0 = time.time()
    req = urllib.request.Request(
        OLLAMA_API,
        data=json.dumps(payload).encode("utf-8"),
        headers={"Content-Type": "application/json"}
    )
    with urllib.request.urlopen(req) as res:
        data = json.loads(res.read().decode("utf-8"))
        dt = time.time() - t0
        resp = data.get("response", "").strip()

    print(f"[Norn V18 Response ({dt:.2f}s)]:\n{resp}\n")

def run_demos():
    print("=" * 80)
    print("  PROJECT NORN V18: INFERENCE DEMONSTRATION")
    print("=" * 80)

    # Demo 1: Formal Logic & Self-Awareness
    test_inference(
        "Introduce yourself, explain your 9B architecture, and describe your 1024-d Relational HRR memory.",
        "DEMO 1: Self-Identity & Architecture Verification"
    )

    # Demo 2: Mathematical Deduction & Constraint Traps
    test_inference(
        "Tank A and Tank B start empty. Pump 1 fills Tank A at 4 L/min. Pump 2 fills Tank B at 6 L/min. "
        "Tank A has a hole that leaks 1 L/min once it reaches 20 L. Tank B has no leak. At time t = 0, "
        "both pumps are turned on. For what positive time t (in minutes, t > 0) is Tank B's volume exactly "
        "twice Tank A's volume? Explain clearly.",
        "DEMO 2: Mathematical Equation & Constraint Trap"
    )

    # Demo 3: Negative Constraints & Discipline
    test_inference(
        "List exactly 5 European capital cities. Rule 1: Do NOT include any city whose English name "
        "contains the letters 'a' or 'e'. Rule 2: Provide the list as a numbered list with country name in parentheses. "
        "Rule 3: Output ONLY the list with no preamble or intro.",
        "DEMO 3: Strict Negative Constraint Following"
    )

    print("=" * 80)
    print("  Demonstration completed successfully!")
    print("=" * 80)

if __name__ == "__main__":
    run_demos()