Skip to main content

Semantic Pattern Address — reference implementation of the MORPH semantic canonicalization standard

Project description

SEMPA — Semantic Pattern Address

SEMPA is the reference implementation of the MORPH semantic canonicalization standard.

MORPH is the standard. SEMPA is the implementation.

What is MORPH?

MORPH (Multidimensional Executable Patterns) is a semantic canonicalization standard that computes a language-independent PatternAddress for any function or program — based on its semantic structure, not its syntax.

Two functions that do the same thing, written differently or in different languages, get the same PatternAddress.

Python function
    ↓
SEMPA extractor
    ↓
PatternAddress: 0xa727d60b670188b9...
    ↓
Veralog attestation (Ed25519 signed, publicly verifiable)

Key Concepts

  • PatternAddress — SHA3-256 of the canonical semantic representation. Language-independent.
  • SourceHash — SHA-256 of the exact source text. Language-specific.
  • PatternFamily — semantic category: Decision, PureFunction, StateMachine, Loop, etc.

Status

Currently in early development (Alpha). Full SDK coming in 0.2.0.

Live demo: app.vrlg.tech/morph-demo

Quick Start

pip install sempa
import sempa
print(sempa.version())  # 0.1.0

Full API (coming in 0.2.0):

from sempa import analyze, attest

result = analyze("""
def approve_loan(credit_score: int, amount: float):
    if credit_score >= 700 and amount > 0:
        return "Approved"
    return "Rejected"
""")

print(result.pattern_address)   # 0x40f5d23e...
print(result.pattern_family)    # Decision
print(result.source_hash)       # 0x65593b32...

# Attest to Veralog (cryptographic proof)
proof = attest(result, api_key="vrlg_...")
print(proof.verify_url)         # https://vrlg.tech/verify/.../page

Architecture

MORPH Standard
    └── SEMPA SDK (this package)
            ├── sempa.analyze()     — compute PatternAddress
            ├── sempa.attest()      — sign via Veralog
            ├── sempa.verify()      — verify a PatternAddress
            └── sempa.store         — semantic deduplication store

Links

License

Apache 2.0

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sempa-0.1.0.tar.gz (2.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

sempa-0.1.0-py3-none-any.whl (2.7 kB view details)

Uploaded Python 3

File details

Details for the file sempa-0.1.0.tar.gz.

File metadata

  • Download URL: sempa-0.1.0.tar.gz
  • Upload date:
  • Size: 2.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.9

File hashes

Hashes for sempa-0.1.0.tar.gz
Algorithm Hash digest
SHA256 66cddfd24feda62920e036e2081dfa57f1fbaeb2b521b99fcca4e1d7659244f1
MD5 6427c4b3a5904cf98daa902f0d502822
BLAKE2b-256 ea65863461828dedb738c172f180cbd8a6b5d4eccf8828e10cfd2af0f399614f

See more details on using hashes here.

File details

Details for the file sempa-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: sempa-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 2.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.9

File hashes

Hashes for sempa-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 00a3615430a0463bcf34ded14c25517a62588051a5b6ca5c25b1649fec59abbd
MD5 8af99747bbfe310c31b3aeafe4ef704b
BLAKE2b-256 5d77e51f0ad86128f5a496615b1c49675e9c2685f3637bdf30a0113711ead6d4

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page