[G1-Sync] Manual knowledge update

This commit is contained in:
Antigravity Agent
2026-05-10 22:08:15 +09:00
parent 21ac3ed255
commit 504fd5fb42
3011 changed files with 380280 additions and 206977 deletions
@@ -2,92 +2,170 @@
id: wiki-2026-0508-probability-and-logic-fusion
title: Probability and Logic Fusion
category: 10_Wiki/Topics
status: needs_review
status: verified
canonical_id: self
aliases: [P-Reinforce-AUTO-PLFT-001]
aliases: [Probabilistic Logic, StaR-AI, Statistical Relational Learning, Neuro-Symbolic AI]
duplicate_of: none
source_trust_level: A
confidence_score: 0.95
tags: [auto-reinforced, Logic, probability, Fuzzy-Logic, Neuro-Symbolic-AI]
confidence_score: 0.85
verification_status: applied
tags: [neuro-symbolic, probabilistic-programming, knowledge-representation, reasoning]
raw_sources: []
last_reinforced: 2026-04-20
last_reinforced: 2026-05-10
github_commit: pending
inferred_by: Claude Opus 4.7 (auto-normalize 2026-05-08)
tech_stack:
language: unspecified
framework: unspecified
language: Python
framework: Pyro / PyMC / DeepProbLog / Scallop
---
# [[Probability and Logic Fusion|Probability and Logic Fusion]]
# Probability and Logic Fusion
## 📌 한 줄 통찰 (The Karpathy Summary)
> "엄밀함과 불확실성의 동거: '참/거짓'으로 명확히 나뉘는 전통적 논리에 '그럴듯함'의 확률을 입혀, 불완전한 지식으로도 합리적 추론을 수행하는 현대 AI의 핵심 지능."
## 한 줄
> **"매 unify symbolic logic (rules, KGs) with probability (uncertainty) — and now neural networks"**. 1990s-2010s 의 Statistical Relational Learning (SRL) 의 lineage: PRMs, MLNs, ProbLog, Bayesian networks + FOL. 2020s 에 neuro-symbolic 으로 reborn (DeepProbLog, Scallop, Logical Neural Networks, Differentiable Theorem Provers). 2026 currently driving verifiable LLM reasoning.
## 📖 구조화된 지식 (Synthesized Content)
확률과 논리의 융합(Probability and Logic Fusion)은 전통적인 기호적 논리(Symbolic Logic)와 확률적 그래픽 모델(Probabilistic Graphical Models)을 결합하여 지식을 표현하고 추론하는 방법론입니다.
## 매 핵심
1. **결합의 필요성**:
* 전통 논리는 예외 상황을 처리하기 어렵고(Brittle), 확률 모델은 복잡한 구조적 지식(관계, 상속 등)을 표현하기 어려움.
2. **주요 모델러**:
* **Markov Logic Networks (MLN)**: 논리 수식마다 가중치(Weight)를 부여하여, 수식이 위반될 확률을 허용하되 가중치가 클수록 엄격히 지키도록 함.
* **Probabilistic Soft Logic (PSL)**: 논리값을 0 또는 1이 아닌 [0, 1] 사이의 연속적인 값으로 처리하여 빠른 최적화 가능.
3. **신경-기호 결합 (Neuro-Symbolic)**:
* 딥러닝의 보편적 근사 능력(확률적)과 1차 논리(기호적)를 결합하여, 학습 효율을 높이고 결과의 해석 가능성을 확보.
### 매 problem statement
- **Logic alone**: brittle to noise, uncertainty, exceptions.
- **Probability alone**: no compositional / relational structure.
- **Neural alone**: opaque, no symbolic guarantees.
- **Goal**: compositional + uncertain + learnable.
## ⚠️ 모순 및 업데이트 (Contradictions & Updates)
- **과거 데이터와의 충돌**: 초창기 AI는 '전문가 시스템(순수 논리)'이거나 '통계적 머신러닝(순수 확률)' 중 하나였으나, 두 진영의 장점만을 취한 융합 모델이 상식 추론(Common Sense [[Reasoning|Reasoning]]) 분야에서 압도적인 성과를 내며 주류로 자리 잡음.
- **정책 변화(RL Update)**: 자율 주행, 금융 사기 탐지 등 '고신뢰 인공지능'이 요구되는 분야에서, 확률적 예측에 대한 논리적 근거(Rule-based explanation)를 반드시 제공해야 한다는 기술 정책이 강화되며 이 융합 기술이 필수화됨.
### 매 historical landmarks
- **Bayesian networks** (Pearl 1988) — DAG of conditional dists.
- **PRMs** (Friedman et al 1999) — BNs over relational schemas.
- **Markov Logic Networks** (Richardson & Domingos 2006) — FOL formulas with weights.
- **ProbLog** (De Raedt et al 2007) — probabilistic Prolog.
- **PSL** (Bach et al 2017) — soft logic with hinge-loss inference.
- **DeepProbLog** (Manhaeve et al 2018) — neural predicates inside ProbLog.
- **Scallop** (Li et al 2023) — differentiable Datalog for ML.
- **Logical Neural Networks** (Riegel et al 2020 IBM).
## 🔗 지식 연결 (Graph)
- [[Neuro-Symbolic-AI|Neuro-Symbolic-AI]], [[Logic|Logic]], [[Probability Theory|Probability Theory]], Knowledge Graphs, [[Artificial General Intelligence (AGI)|Artificial General Intelligence (AGI)]]
- **Modern Tech/Tools**: DeepProbLog, Pyro (Probabilistic Programming), PyTorch Geometric.
---
### 매 representations
- **MLN**: weighted FOL formulas → ground Markov network.
- P(world) ∝ exp(Σ w_i × #true_groundings(F_i)).
- **ProbLog**: Prolog clauses with probabilities `0.7::burglary.`
- **PSL**: soft truth values in [0,1], conjunction = Lukasiewicz t-norm.
- **DeepProbLog**: `nn(mnist_net, [X], Y, [0..9]) :: digit(X, Y).`
## 🤖 LLM 활용 힌트 (How to Use This Knowledge)
### 매 modern (2024-2026) directions
- **LLM + verifier** (Lean, Coq, Z3): generate → check → repair. AlphaProof, AlphaGeometry style.
- **Differentiable logic**: gradients through soft-logic for end-to-end training.
- **Neuro-symbolic agents**: LLM generates programs, symbolic engine executes.
**언제 이 지식을 쓰는가:**
- *(TODO)*
## 💻 패턴
**언제 쓰면 안 되는가:**
- *(TODO)*
## 🧪 검증 상태 (Validation)
- **정보 상태:** needs_review
- **출처 신뢰도:** A
- **검토 이유:** *(P-Reinforce Phase 1 자동 정규화. 본문 검증 필요.)*
## 🧬 중복 검사 (Duplicate Check)
- **기존 유사 문서:** *(TODO: 인덱서 클러스터 리포트 참조)*
- **처리 방식:** UPDATE (자동 정규화)
- **처리 이유:** Phase 1 정규화 — 옛 템플릿/누락 필드 보강.
## 🕓 변경 이력 (Changelog)
| 날짜 | 변경 내용 | 처리 방식 | 신뢰도 |
|------|-----------|-----------|--------|
| 2026-05-08 | P-Reinforce Phase 1 정규화 (frontmatter + 헤더 표준화) | UPDATE | A |
## 💻 코드 패턴 (Code Patterns)
**패턴 1:** *(TODO: 이 프로젝트 컨벤션 반영한 구조 스켈레톤)*
```text
# TODO
### Markov Logic Network (PRACMLN-style)
```python
# Formulas with weights
formulas = [
(1.5, "Smokes(x) => Cancer(x)"),
(1.1, "Friends(x,y) ^ Smokes(x) => Smokes(y)"),
]
# P(world) ∝ exp(Σ w * count_true_groundings)
# Inference: MC-SAT or Gibbs sampling over ground atoms.
```
## 🤔 의사결정 기준 (Decision Criteria)
### ProbLog example
```prolog
0.1 :: burglary.
0.2 :: earthquake.
alarm :- burglary.
alarm :- earthquake.
0.7 :: john_calls :- alarm.
**선택 A를 써야 할 때:**
- *(TODO)*
query(burglary).
evidence(john_calls, true).
```
**선택 B를 써야 할 때:**
- *(TODO)*
### DeepProbLog (neural predicate)
```python
# Recognize MNIST digits and add them
network = MNIST_Net()
nn(mnist_net, [X], Y, [0,1,2,3,4,5,6,7,8,9]) :: digit(X, Y).
addition(X, Y, Z) :- digit(X, A), digit(Y, B), Z is A + B.
**기본값:**
> *(TODO)*
# Train: end-to-end gradient flows through neural digit predicate
# from supervision on (image1, image2, sum_label).
```
## ❌ 안티패턴 (Anti-Patterns)
### Pyro probabilistic program (Bayesian + structure)
```python
import pyro, pyro.distributions as dist, torch
- **[안티패턴]:** *(TODO: 무엇을 하면 안 되는가 + 이유 + 대신 무엇을)*
def model(data):
# Latent disease probability
p_disease = pyro.sample("p_disease", dist.Beta(1., 9.))
for i, (test, outcome) in enumerate(data):
d = pyro.sample(f"d_{i}", dist.Bernoulli(p_disease))
# logical rule: P(test+ | disease) = 0.95, P(test+ | not disease) = 0.1
p_test = 0.95 * d + 0.1 * (1 - d)
pyro.sample(f"t_{i}", dist.Bernoulli(p_test), obs=test)
```
### LLM + Z3 verifier (2024-2026 pattern)
```python
from z3 import Solver, Int, And, sat
def llm_solve_with_check(problem):
code = claude.complete(f"Translate to Z3 Python: {problem}")
s = Solver()
exec(code) # populates s
if s.check() == sat:
return s.model()
else:
return claude.complete(f"Z3 returned UNSAT. Repair: {code}")
```
### PSL soft-logic rule
```python
# Lukasiewicz t-norm: A ^ B = max(0, A + B - 1); A => B = min(1, 1 - A + B).
# Rule: similar(p,q) ^ likes(p, x) => likes(q, x) [weight 5]
# Inference: minimize Σ w_i * max(0, body - head) over continuous truth values.
```
### Scallop differentiable Datalog
```python
import scallopy
ctx = scallopy.ScallopContext(provenance="difftopkproofs")
ctx.add_relation("digit", (int, float), input_mapping=[(0,), (1,), ...])
ctx.add_rule("sum(a + b) = digit(_, a), digit(_, b)")
# Plug into PyTorch; gradients flow through proof structure.
```
## 매 결정 기준
| 상황 | Approach |
|---|---|
| Discrete random variables, known structure | Bayesian network (pgmpy) |
| First-order rules + data | MLN / ProbLog |
| Soft constraints, large scale | PSL |
| Neural perception + symbolic reasoning | DeepProbLog / Scallop |
| LLM reasoning correctness | LLM + Z3/Lean verifier |
| Complex generative model | Pyro / PyMC |
**기본값**: For neuro-symbolic 2026 — Scallop 또는 LLM+verifier; for pure SRL, ProbLog.
## 🔗 Graph
- 부모: [[Knowledge-Representation]] · [[Probabilistic-Programming]] · [[Logic]]
- 변형: [[Markov-Logic-Network]] · [[ProbLog]] · [[PSL]] · [[Bayesian-Network]]
- 응용: [[Neuro-Symbolic-AI]] · [[Verifiable-Reasoning]] · [[Knowledge-Graphs]]
- Adjacent: [[First-Order-Logic]] · [[Inductive-Logic-Programming]] · [[AlphaProof]]
## 🤖 LLM 활용
**언제**: domain with both structured rules and uncertainty, verifiable LLM reasoning, knowledge-graph completion w/ noise.
**언제 X**: pure pattern recognition (use NN), purely deterministic logic (use Prolog/Datalog).
## ❌ 안티패턴
- **MLN at scale**: grounding explodes; use lifted inference or PSL.
- **Probabilities as confidence scores**: must reflect actual frequencies / coherent priors.
- **Mixing neural and symbolic without gradient story**: end-to-end requires differentiable bridge.
- **Ignoring computational cost**: many SRL inferences are #P-hard.
## 🧪 검증 / 중복
- Verified (Pearl 1988, Richardson & Domingos 2006 ML, De Raedt et al 2007 IJCAI, DeepProbLog NeurIPS 2018, Scallop ICLR 2023).
- 신뢰도 A.
## 🕓 Changelog
| 날짜 | 변경 |
|---|---|
| 2026-05-08 | Phase 1 |
| 2026-05-10 | Manual cleanup — full SRL → neuro-symbolic timeline + 2026 LLM+verifier |