|
|
"""Deep dive into BridgeFaculty and Kleene fixed-point matching."""
|
|
|
import sys
|
|
|
import os
|
|
|
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..')))
|
|
|
import champion_gen42 as champ
|
|
|
|
|
|
print("=" * 70)
|
|
|
print("🌉 BRIDGE FACULTY - Kleene Fixed-Point Data Bridging")
|
|
|
print("=" * 70)
|
|
|
|
|
|
|
|
|
print("\n=== BridgeFaculty Class ===")
|
|
|
BridgeFaculty = champ.BridgeFaculty
|
|
|
print(f"Type: {BridgeFaculty}")
|
|
|
print(f"Methods: {[m for m in dir(BridgeFaculty) if not m.startswith('_')]}")
|
|
|
|
|
|
|
|
|
if BridgeFaculty.__doc__:
|
|
|
print(f"\nDocstring:\n{BridgeFaculty.__doc__}")
|
|
|
|
|
|
|
|
|
import inspect
|
|
|
try:
|
|
|
source = inspect.getsource(BridgeFaculty)
|
|
|
print(f"\n=== Source Code ===")
|
|
|
print(source[:3000])
|
|
|
except Exception as e:
|
|
|
print(f"Can't get source: {e}")
|
|
|
|
|
|
|
|
|
print("\n=== Instantiate Bridge ===")
|
|
|
try:
|
|
|
bridge = BridgeFaculty()
|
|
|
print(f"Bridge instance: {bridge}")
|
|
|
print(f"Instance methods: {[m for m in dir(bridge) if not m.startswith('_')]}")
|
|
|
|
|
|
|
|
|
print("\n=== Test Bridge Transformation ===")
|
|
|
old_form = {"position": [1, 2, 3], "health": 100}
|
|
|
new_form = {"pos_x": None, "pos_y": None, "pos_z": None, "hp": None}
|
|
|
|
|
|
print(f"Old form: {old_form}")
|
|
|
print(f"New form template: {new_form}")
|
|
|
|
|
|
result = bridge.bridge(old_form, new_form)
|
|
|
print(f"Bridged result: {result}")
|
|
|
|
|
|
except Exception as e:
|
|
|
print(f"Error: {e}")
|
|
|
import traceback
|
|
|
traceback.print_exc()
|
|
|
|