/**
* Step-by-Step Explanation Types
* Part of simplified Phase 4d Implementation
*/
import { LogicalSystem, SolutionStep } from './types.js';
/**
* Enhanced solution step with detailed explanations.
*/
export interface EnhancedSolutionStep {
/** Step number or identifier */
index: number;
/** The logical statement at this step */
statement: string;
/** The logical rule or principle applied */
rule: string;
/** Basic justification for this step */
justification: string;
/** Detailed step-by-step explanation */
detailedExplanation: string;
/** Any prerequisite steps this step depends on */
dependencies: number[];
/** Visual representation of this step (if applicable) */
visualization?: string;
/** Educational context for this rule or principle */
educationalNotes?: string;
/** Difficulty level of understanding this step (1-5) */
difficulty: number;
}
/**
* Enhanced solution with detailed explanations.
*/
export interface EnhancedLogicalSolution {
/** All steps in the proof */
steps: EnhancedSolutionStep[];
/** The conclusion of the proof */
conclusion: string;
/** Overview of the proof strategy */
proofStrategy: string;
/** Key insights from this proof */
keyInsights: string[];
/** Alternative approaches that could have been used */
alternativeApproaches?: string[];
}
/**
* Options for generating explanations.
*/
export interface ExplanationOptions {
/** Detail level (1-3) */
detailLevel?: 1 | 2 | 3;
/** Include educational notes */
includeEducationalNotes?: boolean;
/** Include visualizations */
includeVisualizations?: boolean;
/** Include alternative approaches */
includeAlternatives?: boolean;
}
/**
* Context for the proof, including premises, previous steps, etc.
*/
export interface ProofContext {
/** The logical system being used */
system: LogicalSystem;
/** Original input that was processed */
originalInput: string;
/** Previous steps in the proof */
previousSteps: SolutionStep[];
/** Premises of the argument */
premises: any[];
/** The conclusion being proved */
conclusion: any;
/** Additional context like domain knowledge */
additionalContext?: any;
}
/**
* Interface for explanation generators for different logical systems.
*/
export interface ExplanationGenerator {
/**
* Generate a detailed explanation for a proof step.
*/
generateStepExplanation(
step: SolutionStep,
context: ProofContext,
options: ExplanationOptions
): string;
/**
* Generate visual representation for a step.
*/
generateVisualization?(
step: SolutionStep,
context: ProofContext
): string;
/**
* Generate educational notes for a logical rule.
*/
generateEducationalNotes?(
rule: string,
context: ProofContext
): string;
/**
* Determine the difficulty level of a step.
*/
determineDifficulty(
step: SolutionStep,
context: ProofContext
): number;
/**
* Enhance a solution with detailed explanations.
*/
enhanceSolution(
solution: SolutionStep[],
context: ProofContext,
options: ExplanationOptions
): EnhancedLogicalSolution;
}
/**
* Extended Command Types for explanations
*/
export type ExplanationCommandType =
'explain' |
'explainStep' |
'explainRule' |
'setExplanationDetail';
/**
* Parameters for the explain command.
*/
export interface ExplainCommandParams {
/** Detail level for explanations (1-3) */
detailLevel?: 1 | 2 | 3;
/** Include educational notes */
includeEducationalNotes?: boolean;
/** Include visualizations */
includeVisualizations?: boolean;
/** Include alternative approaches */
includeAlternatives?: boolean;
}
/**
* Parameters for the explainStep command.
*/
export interface ExplainStepCommandParams {
/** The step index to explain (starts at 1) */
stepIndex: number;
/** Detail level for the explanation (1-3) */
detailLevel?: 1 | 2 | 3;
}
/**
* Parameters for the explainRule command.
*/
export interface ExplainRuleCommandParams {
/** The logical rule to explain */
rule: string;
/** The logical system context */
system?: LogicalSystem;
}
/**
* Parameters for the setExplanationDetail command.
*/
export interface SetExplanationDetailCommandParams {
/** Detail level for explanations (1-3) */
detailLevel: 1 | 2 | 3;
}