# Changelog
Changes to the Logic-Thinking MCP Server will be documented in this file.
## [0.4.0] - 2025-10-12
### Phase 7 Features: Reasoning Intelligence for Claude
#### Added
- **Proof Library & Reuse System** (`src/proofLibrary.ts`)
- Persistent storage of logical proofs across sessions using SQLite
- Full-text search with FTS5 for finding relevant proofs
- Save proofs with metadata: name, description, system, tags, author
- Lemma storage and composition for building complex proofs
- Usage tracking and success rate metrics
- System compatibility checking for lemma composition
- Five new MCP tools:
- `logic-proof-save`: Save proofs to the library
- `logic-proof-search`: Full-text search with filtering
- `logic-proof-get`: Retrieve specific proofs by ID
- `logic-proof-list`: List all proofs with pagination
- `logic-proof-stats`: View library statistics
- **Assumption Extraction & Analysis** (`src/assumptionExtractor.ts`)
- Automatically detect hidden assumptions in arguments
- Six assumption types:
- Hidden Premise: Missing logical premises
- Background Knowledge: Domain-specific knowledge assumed
- Definitional: Assumed definitions or meanings
- Causal: Causal relationships assumed
- Normative: Value judgments or norms assumed
- Existential: Existence assumptions
- Three detection methods:
- Pattern-based extraction (regex for common forms)
- Validity gap analysis (using formal validation)
- Background knowledge heuristics (scientific, mathematical, legal domains)
- Confidence scoring and necessity classification
- Argument strength assessment (strong/moderate/weak)
- Actionable recommendations for improvement
- New `logic-extract-assumptions` MCP tool
- **Argument Strength Scoring** (`src/argumentScorer.ts`)
- Objective 0-100 scoring with A-F letter grades
- Six scoring components with weighted combination:
- Validity (30%): Logical correctness via formal validation
- Premise Plausibility (20%): Quality and support of premises
- Inference Strength (20%): Connection between premises and conclusion
- Structure Quality (10%): Organization and clarity
- Fallacy Penalty (10%): Detects and penalizes logical fallacies
- Assumption Complexity (10%): Hidden assumptions and gaps
- Automatic strength/weakness identification
- Specific improvement recommendations
- Comparison to historical average (baseline: 65)
- Added "score" operation to `logic-thinking` tool
#### Enhanced
- Extended `logic-thinking` tool with new "score" operation
- Added comprehensive input parsing for argument scoring
- Detailed component-by-component analysis with explanations
#### Testing
- 23 tests for proof library (100% passing)
- 20 tests for assumption extraction (100% passing)
- 28 tests for argument scoring (100% passing)
- 71 total Phase 7 tests passing
#### Fixed
- **Database Search Error (2025-10-12)**
- Fixed FTS5 search throwing "no such column: proof" error for non-existent proofs
- Added comprehensive error handling to `searchProofs()` method in `proofLibrary.ts`
- Implemented query sanitization to remove special characters that break FTS5
- Added empty query detection to return graceful empty results
- Improved error logging for debugging
- Impact: System grade improved from B+ (85/100) to A- (90/100)
## [0.3.0] - 2025-10-11
### Phase 5 & 6 Features: AI Optimizations and Meta-Logical Capabilities
#### Added
- **Batch Processing System** (`src/batchProcessor.ts`)
- Process up to 50 logic requests in a single batch
- Concurrent or sequential execution modes
- Fail-fast or continue-on-error options
- Per-request timing and success/failure tracking
- Safety limits (MAX_BATCH_SIZE = 50, MAX_CONCURRENT = 10)
- New `logic-batch` MCP tool for batch operations
- **Cross-System Logic Translation** (`src/logicTranslator.ts`)
- Translate logical statements between different systems
- Supported translations:
- Propositional → Modal (lossless embedding)
- Propositional → Predicate (variables → 0-ary predicates)
- Syllogistic → Predicate (categorical → quantified)
- Modal → Propositional (lossy: strips modalities)
- Predicate → Propositional (lossy: removes quantifiers)
- Temporal → Modal (G→□, F→◇)
- Fuzzy → Propositional (lossy: threshold binarization)
- Automatic limitation tracking for lossy translations
- Detailed translation notes and recommendations
- **Contradiction Detection** (`src/contradictionDetector.ts`)
- Detect contradictions in sets of statements
- Three severity levels:
- Direct: Syntactic contradictions (A and ¬A)
- Logical: Semantic contradictions (joint entailment of false)
- Contextual: Domain-specific contradictions
- Find maximal consistent subsets
- Generate actionable recommendations
- Support for propositional, predicate, and modal systems
#### Enhanced
- Async request handling in index.ts for batch operations
- Extended MCP tool list with logic-batch tool
- Improved error handling and logging
## [0.2.1] - 2025-10-11
### Modal Logic Improvements
#### Added
- **Extended Modal Systems Support**
- Added B, K4, KB, KD45 systems (now supporting 9 total systems: K, T, D, B, K4, KB, S4, S5, KD45)
- System-specific axioms: T (reflexivity), D (seriality), B (symmetry), 4 (transitivity), 5 (Euclidean)
- **Bounded Model Checking**
- Implemented finite model property with modal depth tracking
- Adaptive model bounds based on formula complexity (2-4 worlds)
- Representative valuation generation (max 20 instead of 2^(w×a))
- Prevents combinatorial explosion in frame generation
- **Natural Deduction Proof Generator** (`src/proof/modalProofGenerator.ts`)
- Step-by-step proof construction with justifications
- System-specific axiom applications
- K axiom, Necessitation rule, and duality transformations
- Proper premise numbering and rule tracking
- **Countermodel Extraction**
- Detailed Kripke frame countermodels for invalid arguments
- Shows worlds, accessibility relations, and valuations
- Explains why premises hold but conclusion fails
- Added `Countermodel` type to `src/types.ts`
- **Modal Transformations Utility** (`src/utils/modalTransforms.ts`)
- Duality transformations: □φ ≡ ¬◇¬φ and ◇φ ≡ ¬□¬φ
- Formula normalization (convert to box or diamond)
- Negation pushing (De Morgan's laws for modalities)
- Double negation elimination and simplification
- **Enhanced Natural Language Parsing**
- 23 natural language patterns for modal operators (up from 4)
- Support for "must be", "has to be", "required", "certain" (necessity)
- Support for "might be", "could be", "can be", "may be", "perhaps", "maybe" (possibility)
#### Fixed
- **State Persistence Bug**
- Modal system now resets to K before each tool call
- Prevents "sticky" system state across requests
- **Cache Isolation Bug**
- Cache keys now include modal system in additionalContext
- Different systems correctly return different cached results
- Updated `logicManager.ts` to pass additionalContext to cache key generation
#### Performance
- Reduced frame generation from O(2^(w×a)) to bounded O(n) where n ≤ 100
- System constraint caching for faster validation
- Early termination on counterexample discovery
## [0.2.0] - 2025-06-24
### Added
- **Temporal Logic System**
- Operators: G (globally), F (eventually), X (next), U (until), R (release), W (weak until)
- Trace validation and generation
- Timeline visualizations
- Property checking (safety, liveness, fairness)
- **Fuzzy Logic System**
- Membership functions (triangular, trapezoidal, gaussian)
- Linguistic hedges (very, somewhat, slightly, extremely)
- Fuzzy operators (AND, OR, NOT, IMPLIES)
- Fuzzy set visualizations
- Degree of truth calculations
- **Deontic Logic System**
- Operators: O (obligatory), P (permitted), F (forbidden)
- Conditional operators: OB (obligatory given), PM (permitted given)
- Deontic world models
- Consistency checking (D axiom)
- Normative reasoning support
### Fixed
- Method signature mismatches in logic systems
- Logger imports and initialization
- Parser type comparison errors
- Array type inference issues
### Updated
- Command handler to include new logic systems
- Help system with logic descriptions
- LogicManager to route to new systems
- Documentation to reflect new capabilities
## [0.1.5] - 2025-06-24
### Added
- **Modal Logic Implementation (Phase 3)**
- Modal logic system with □ (necessity) and ◇ (possibility)
- Modal systems support (K, T, S4, S5)
- Kripke model generation and visualization
- Modal formula validation
### Updated
- Error handling with suggestions
- Natural language processing for modal expressions
- Visualization capabilities for modal structures
## [0.1.0] - 2025-05-03
### Initial Release
- **Core Logic Systems**
- Syllogistic logic with figure and mood validation
- Propositional logic with natural deduction
- Predicate logic with quantifiers
- Mathematical logic for equations and sequences
- **Core Features**
- MCP server implementation
- Auto-detection of logical systems
- Natural language processing
- Caching system
- Multiple visualization types
- Explanations
### Infrastructure
- TypeScript implementation
- Test suite
- Documentation and examples
- Error recovery system
## [Pre-release Development]
### Phase 2 (2025-04-29)
- Natural language processing
- Visualizations
- Mathematical logic implementation
- Performance updates
### Phase 1 (2025-04-29)
- Foundation and core logic systems
- MCP server structure
- Validation and visualization