Expand description
§Sequent Calculus for Proof-Theoretic Foundations
This module implements sequent calculus representations and inference rules for TensorLogic. Sequent calculus provides a formal foundation for logical reasoning and proof construction.
§Overview
A sequent is a formal statement of the form Γ ⊢ Δ where:
Γ(Gamma) is a multiset of antecedent formulas (hypotheses)Δ(Delta) is a multiset of consequent formulas (conclusions)⊢(turnstile) represents the entailment relation
The sequent Γ ⊢ Δ is valid if: assuming all formulas in Γ are true,
at least one formula in Δ must be true.
§Inference Rules
This module implements the following sequent calculus rules:
§Structural Rules
- Identity:
A ⊢ A - Weakening: From
Γ ⊢ ΔderiveΓ, A ⊢ ΔorΓ ⊢ Δ, A - Contraction: From
Γ, A, A ⊢ ΔderiveΓ, A ⊢ Δ - Exchange: Reorder formulas in Γ or Δ
- Cut: From
Γ ⊢ Δ, AandA, Γ' ⊢ Δ'deriveΓ, Γ' ⊢ Δ, Δ'
§Logical Rules (Left and Right)
- AND-Left: From
Γ, A, B ⊢ ΔderiveΓ, A ∧ B ⊢ Δ - AND-Right: From
Γ ⊢ Δ, AandΓ ⊢ Δ, BderiveΓ ⊢ Δ, A ∧ B - OR-Left: From
Γ, A ⊢ ΔandΓ, B ⊢ ΔderiveΓ, A ∨ B ⊢ Δ - OR-Right: From
Γ ⊢ Δ, A, BderiveΓ ⊢ Δ, A ∨ B - NOT-Left: From
Γ ⊢ Δ, AderiveΓ, ¬A ⊢ Δ - NOT-Right: From
Γ, A ⊢ ΔderiveΓ ⊢ Δ, ¬A - IMPLY-Left: From
Γ ⊢ Δ, AandΓ, B ⊢ ΔderiveΓ, A → B ⊢ Δ - IMPLY-Right: From
Γ, A ⊢ Δ, BderiveΓ ⊢ Δ, A → B
§Quantifier Rules
- EXISTS-Left: From
Γ, A[t/x] ⊢ ΔderiveΓ, ∃x.A ⊢ Δ(t is fresh) - EXISTS-Right: From
Γ ⊢ Δ, A[t/x]deriveΓ ⊢ Δ, ∃x.A - FORALL-Left: From
Γ, A[t/x] ⊢ ΔderiveΓ, ∀x.A ⊢ Δ - FORALL-Right: From
Γ ⊢ Δ, A[t/x]deriveΓ ⊢ Δ, ∀x.A(t is fresh)
§Applications
- Proof Search: Construct proofs by applying inference rules backward
- Proof Checking: Verify that a derivation tree is valid
- Proof Normalization: Transform proofs to normal forms (cut-elimination)
- Compilation: Use sequent calculus to guide tensor compilation strategies
§Example
use tensorlogic_ir::{TLExpr, Term, Sequent, InferenceRule, ProofTree};
// Construct a sequent: P(x) ∧ Q(x) ⊢ P(x)
let p = TLExpr::pred("P", vec![Term::var("x")]);
let q = TLExpr::pred("Q", vec![Term::var("x")]);
let and_pq = TLExpr::and(p.clone(), q);
let conclusion = Sequent::new(vec![and_pq], vec![p.clone()]);
// Construct a proof tree: Identity axiom as premise, then apply AndLeft
let identity_premise = ProofTree::identity(p.clone());
let proof = ProofTree::new(
conclusion,
InferenceRule::AndLeft { index: 0 },
vec![identity_premise]
);
assert!(proof.is_valid());Structs§
- CutElimination
- Cut elimination transformation.
- Proof
Search Engine - Proof search engine for automated theorem proving.
- Proof
Search Stats - Statistics about proof search.
- Proof
Tree - A proof tree in sequent calculus.
- Sequent
- A sequent is a formal statement
Γ ⊢ Δrepresenting an entailment relation.
Enums§
- Inference
Rule - Inference rules in sequent calculus.
- Proof
Search Strategy - Proof search strategies for automated theorem proving.