본문으로 건너뛰기
Skillpedia
분석 및 스프레드시트14k · #11155

reason

하는 일

이 스킬은 Semantica 지식 그래프의 사실에 논리 추론을 적용해 결론을 내리거나 설명을 제안합니다. 사용자가 정의한 규칙으로 그래프가 추론하기를 원하는 사람을 위한 스킬입니다.

사용하는 경우

  • ✓사실과 규칙이 있고, 그래프가 결론을 찾아내기를 원할 때.
  • ✓관찰이 있고 그에 대한 가능한 설명이 필요할 때.
  • ✓주장한 내용이 알려진 사실에서 따라 나오는지 확인하고 싶을 때.

스킬 링크

https://github.com/semantica-agi/semantica/blob/main/plugins/skills/reason/SKILL.md

복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.

사용 방법

가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/semantica-agi/semantica/blob/main/plugins/skills/reason/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

AI에게 요청하는 예시

“우리 공급업체에 대한 이 사실들과 이 규칙이 주어졌을 때, 입찰할 수 없는 공급업체가 어디인지 알아낼 수 있나요?”

매주 새 스킬 5개. 읽는 데 1분.

작동 방식

에이전트는 사실과 규칙을 추론 엔진에 넣고 결론을 도출합니다. 각 결론과 그것을 만든 규칙을 함께 보고합니다. 진술을 증명해 보거나, 관찰을 설명할 가설을 만들 수도 있습니다.

기술 내용 (원본 SKILL.md)

작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.

/semantica:reason

Apply reasoning over the knowledge graph. Usage: /semantica:reason <mode> [args]

$ARGUMENTS = reasoning mode + rules/observations/query.


deductive [--facts '<json-list>'] [--rules '<rule1>|<rule2>']

Apply deductive rules to known facts to derive new conclusions.

from semantica.reasoning.deductive_reasoner import DeductiveReasoner, Premise

reasoner = DeductiveReasoner()

# Add base facts to working memory
# Facts can be strings like "Person(John)" or structured dicts
import json
facts = json.loads(facts_json) if facts_json else []
reasoner.add_facts(facts)

# Apply logic with explicit premises
# Premise objects have: statement, confidence, source
premises = [
    Premise(statement=fact, confidence=1.0)
    for fact in facts
]

conclusions = reasoner.apply_logic(premises=premises)

Return: | Conclusion | Triggering Premises | Confidence | Rule Applied |

If zero rules given, run reasoner.prove_theorem() on any provided theorem:

proof = reasoner.prove_theorem(theorem=theorem_text)

Output: Proof: <proof.steps> | Valid: YES / NO


prove <theorem> [--facts '<json-list>']

Prove or disprove a theorem against known facts.

from semantica.reasoning.deductive_reasoner import DeductiveReasoner

reasoner = DeductiveReasoner()
import json
reasoner.add_facts(json.loads(facts_json) if facts_json else [])

proof = reasoner.prove_theorem(theorem=theorem)

Output:

Theorem: "<theorem>"
Result:  PROVED ✓  |  DISPROVED ✗  |  UNDECIDABLE ⚠

Proof steps:
  1. <premise> — <justification>
  2. ...
  → QED: <theorem>

Confidence: <proof.confidence>

abductive <observation> [--knowledge '<json-list>'] [--top N]

Generate and rank hypotheses that explain an observation.

from semantica.reasoning.abductive_reasoner import (
    AbductiveReasoner, Observation
)

reasoner = AbductiveReasoner()

import json
if knowledge_json:
    reasoner.add_knowledge(json.loads(knowledge_json))

obs = Observation(description=observation)

# Generate all hypotheses then rank them
hypotheses = reasoner.generate_hypotheses(observations=[obs])
ranked = reasoner.rank_hypotheses(hypotheses)
best = reasoner.get_best_explanation(obs)

# Also get full explanations with evidence
explanations = reasoner.find_explanations(observations=[obs])

Output:

Abductive Reasoning for: "<observation>"

Best explanation:
  <best.description>  (confidence: 0.87)

All hypotheses (ranked):
  | Rank | Hypothesis | Confidence | Supporting Evidence |
  |  1   | <hyp>      | 0.87       | <evidence>         |
  |  2   | ...

Full explanations:
  Explanation 1: <explanation.summary>
    Evidence: <evidence items>

datalog <program>

Evaluate a Datalog program over graph facts.

from semantica.reasoning.datalog_reasoner import DatalogReasoner
from semantica.context import ContextGraph

graph = ContextGraph()
reasoner = DatalogReasoner()

# program is a string of Datalog rules and queries
results = reasoner.evaluate(program=program, graph=graph)

Return derived tuples as a relation table. Show rule derivation counts.


sparql <query>

Run a SPARQL query over the knowledge graph and return results.

from semantica.reasoning.sparql_reasoner import SPARQLReasoner
from semantica.context import ContextGraph

graph = ContextGraph()
reasoner = SPARQLReasoner()

results = reasoner.query(sparql_query=query, graph=graph)

Return as a Markdown table with bound variable columns matching the SELECT clause.


rete [--rules '<rule1>|<rule2>'] [--facts '<json-list>']

Incremental rule evaluation using the Rete network with working memory.

from semantica.reasoning.rete_engine import ReteEngine
import json

engine = ReteEngine()

rules = rules_str.split("|") if rules_str else []
facts = json.loads(facts_json) if facts_json else []

engine.load_rules(rules)
engine.process_facts(facts)
activations = engine.get_activations()

Return: | Rule Fired | Variable Bindings | Working Memory Delta | Activation Order |


hypotheses "<scenario>" [--knowledge '<json-list>'] [--top N]

Generate the top-N most probable explanations for a complex scenario.

from semantica.reasoning.abductive_reasoner import AbductiveReasoner, Observation
import json

reasoner = AbductiveReasoner()
if knowledge_json:
    reasoner.add_knowledge(json.loads(knowledge_json))

obs = Observation(description=scenario)
hypotheses 
자주 묻는 질문

가추 추론이란 무엇인가요?

관찰에서 가장 가능성 높은 설명으로 거슬러 올라가는 추론입니다.

진술을 증명할 수 있나요?

네. 알려진 사실에 대해 정리를 검사하고, 증명이 성립하는지 보고할 수 있습니다.

어떤 규칙 방식을 지원하나요?

Datalog 프로그램, SPARQL 쿼리, Rete 네트워크 평가 등 여러 방식을 지원합니다.

상세 정보

작성자의 원본 설명

Run reasoning over the Semantica knowledge graph — deductive logic, abductive hypothesis generation, Datalog programs, SPARQL queries, Rete network evaluation. Uses DeductiveReasoner, AbductiveReasoner, DatalogReasoner, SPARQLReasoner, ReteEngine. Sub-commands: deductive, abductive, datalog, sparql, rete, prove, hypotheses.

repo: semantica-agi/semantica

인기도

GitHub 스타
14k
순위
#11155
라이선스
MIT
업데이트
2026. 11. 2.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬