2 * Block representation for proof structure.
3 */
5import { Expression } from './expression.js';
7/**
8 * Represents a block in the proof tree.
9 */
10export class Block {
11 constructor(
12 public readonly lineNum: number,
13 public readonly blockType: string,
14 public readonly args: Expression[] = [],
15 public children: Block[] = []
16 ) {}
18 /**
19 * String representation of the block.
20 */
21 toString(): string {
22 const argsStr = this.args.length > 0
23 ? ` ${this.args.map(a => a.toString()).join(' ')}`
24 : '';
25 return `${this.blockType}${argsStr}`;
26 }
27}