계산과 온톨로지를 단 4개의 공리로 기반하기 — Rei Language (0‑shiki)의 설계 철학

발행: (2026년 2월 16일 오전 11:31 GMT+9)
9 분 소요
원문: Dev.to

Source: Dev.to

죄송하지만 번역할 실제 텍스트가 제공되지 않았습니다. 번역이 필요한 본문을 알려주시면 한국어로 번역해 드리겠습니다.

Source:

숫자는 점이 아니라 필드입니다

전통적인 프로그래밍에서 숫자는 하나의 점(스칼라 값)입니다. x = 5 라고 쓰면 5 라는 점이 변수에 저장됩니다.

Rei는 이 가정을 뒤집습니다. 모든 값은 “중심”과 “주변”을 가진 필드입니다.

import { mdnum, compute } from 'rei-lang';

// A multidimensional number: center = 5, periphery = [1, 2, 3, 4]
const md = mdnum(5, [1, 2, 3, 4]);
const result = compute(md);
console.log(result.value); // 7.5 (weighted average of center + periphery)

// center = 0, no periphery → degenerates to a scalar
const scalar = mdnum(0, []);
console.log(compute(scalar).value); // 0 (same as an ordinary number)

이는 “배열로 계산하는 것”과 근본적으로 다릅니다. Rei에서는 숫자 자체의 구조가 중심‑주변 패턴을 따르며, 주변이 비어 있는 경우가 바로 스칼라라는 퇴화된 경우일 뿐입니다.

네 가지 불가분 공리

기호의미
M = (c, N, μ, w)하나의 값
c ∈ V중심
N = (n₁,…,nₖ)주변
μ ∈ Modes계산 모드
w : N → ℝ⁺가중치 함수

퇴화: k = 0 일 때, compute(c, ∅, μ, w) = c. 전통적인 프로그래밍은 바로 이 퇴화된 경우만을 다루는 것으로 볼 수 있습니다.

모든 값은 깊이 축을 따라 확장되거나 축소될 수 있습니다:

  • ⊕ : V × S → V (확장: 아래첨자 추가)
  • ⊖ : V → V    (축소: 아래첨자 제거)
Chain:   v₀ →⊕ v₀ₒ →⊕ v₀ₒₒ → …
Inverse: ⊖(⊕(v, s)) = v
import { subscript, extnum, extend, reduce, toNotation } from 'rei-lang';

// Create 0₀ₒₒ (triple extension of zero)
const sub = subscript(0, ['o', 'o', 'o']);
const en  = extnum(sub);

// Extension and reduction operations
const extended = extend(en, 'x'); // 0ooo → 0ooox (⊕)
const reduced  = reduce(extended); // 0ooox → 0ooo (⊖)

// 4‑layer notational equivalence
const notation = toNotation(sub);
console.log(notation.sensory);    // "0ooo"     (sensory layer)
console.log(notation.dialogue);   // "0_o3"     (dialogue layer)
console.log(notation.structural);// "0(o,3)"   (structural layer)
console.log(notation.semantic);  // JSON       (semantic layer)

“0 이전에 무엇이 있나요?”에 대한 답
일반적으로 0 은 불가분 원자이지만, Rei에서는 무한 구조0 안에서 펼쳐집니다. 모든 변환은 흔적을 남기며, 값은 자신의 역사를 보존합니다.

V̂ = V × Σ          // value = raw value + metadata
Σ = (H, τ, n)
  H – transformation history (memory)
  τ – tendency (direction of change)
  n – transformation count

모든 함수 적용은 자동으로 기록되므로, 값은 현재 자신이 무엇인지어디서 왔는지를 항상 알게 됩니다.

import { lang } from 'rei-lang';

// compress = function definition (the philosophy of compression)
lang.run('compress double(x) -> x * 2');
lang.run('compress inc(x)    -> x + 1');

// Chain transformations with the pipe operator
lang.run('5 |> double |> inc |> double'); // → 22
// During this process the transformation history [5, 10, 11] is
// automatically accumulated in σ

단계적 존재

존재는 단계에 걸쳐 무에서 발생합니다; 어느 단계도 건너뛸 수 없습니다.

P = { void, ・, 0₀, 0, ℕ }

void → ・   // 무언가가 존재할 수 있음
 ・  → 0₀   // 값과 구조가 분리됨
0₀  → 0    // 값이 고정되고 계산 가능해짐
 0  → ℕ    // 자연수 체계가 등장
import { genesis } from 'rei-lang';
const { runFullGenesis, verifyTheoremS0, verifyTheoremS1 } = genesis;

// Run the full genesis process: void → ・ → 0₀ → 0 → ℕ
const state = runFullGenesis();
console.log(state.phase); // 'number'

// Verify uniqueness theorems
const s0 = verifyTheoremS0(state); // ・→0₀ transition is unique
const s1 = verifyTheoremS1(state); // 0₀→0 transition is unique
console.log(s0.valid, s1.valid); // true true

차단 규칙void 에서 바로 0 으로 점프할 수 없습니다. 전환은 반드시 한 단계씩 진행해야 합니다: void → ・ → 0₀ → 0

. 이것은 “존재에 대한 지름길은 없다.” 라는 원칙이다.

네 가지 공리 (독립 축)

공리답변하는 질문
A1공간 (구조)“값은 어떤 형태를 가지고 있나요?”
A2깊이 (중첩)“값 안으로 얼마나 깊이 들어갈 수 있나요?”
A3시간 (역사)“값은 어떻게 변했나요?”
A4기원 (시작)“값은 어디에서 왔나요?”

각 공리가 다른 공리들에 의해 대체될 수 없는 이유

공리필수적인 이유
A1A2, A3, A4는 값의 구조를 정의하지 않는다
A2A1, A3, A4는 깊이라는 개념을 포함하지 않는다
A3A1, A2, A4는 역사의 보존을 의미하지 않는다
A4A1, A2, A3는 존재의 기원을 다루지 않는다

비교 개요

시스템# 공리범위
λ‑calculus3계산
Peano5자연수
ZFC9집합
Rei4계산 + 존재론

레이의 구문은 네 가지 공리를 반영한다

import { lang } from 'rei-lang';

// A1: Multidimensional number literal [center; periphery...]
lang.run('[5; 1, 2, 3, 4]');

// A2: Extension ⊕ / Reduction ⊖
lang.run('0oo ⊕ x'); // 0oo → 0oox
lang.run('0oox ⊖'); // 0oox → 0oo

// A3: Pipe (function composition with σ‑accumulation)
lang.run('compress inc(x) -> x + 1');
lang.run('41 |> inc'); // 42

// A4: bind (value fixation = solidification of existence)
lang.run('bind x = 42');

구문 – 공리 매핑

구문공리디자인 의도
[c; n₁, n₂, …]A1다차원 숫자를 직접 표현
/ A2확장 / 축소를 일급 연산자로
`>` (pipe)A3
bindA4값 고정 = 존재의 고체화

모든 코드 스니펫은 최신 버전의 rei-lang가 설치되어 있다고 가정합니다.

Rei‑lang 하이라이트

> (pipe)          →  A3
bind               →  A4  
*Irreversibly fix the existence of a value*

compress           →  A1+A3  
*Compress computation into a reusable form*

Center‑Periphery 패턴의 실제 세계 성능 이점

작업기존 대비설명
이미지 커널 연산4× 감소컨볼루션 코드 양
다차원 데이터 집계3.7× 개선집계 파이프라인 복잡도
그래프 구조 변환3.7× 개선네트워크 구조 조작
평균 코드 감소74 %전체 표현성

Phase 7 (v0.5.5+) 기능

  • σ‑속성 상호작용 (7a)
  • 자체 복구 (7b)
  • 자체 생성 (7c)
  • 출현 (7d)
  • 마이크로‑매크로 이중 한계 메타‑브리지 (7e)

이 언어는 이제 7개 분야—자연과학, 정보공학, 인문학, 예술, 음악, 경제학, 언어학—를 36방향 브리지로 연결합니다. 5개의 대안 공리 체계 간 변환은 compress/expand 펑터를 통해 구현됩니다.

리소스

  • GitHub:
  • npm:
  • Zenodo DOI:
  • SSRN:

피드백, 이슈, 그리고 별표를 환영합니다!

0 조회
Back to Blog

관련 글

더 보기 »