diff --git a/src/language/bytecode.ts b/src/language/bytecode.ts index 980a123..3d1be9e 100644 --- a/src/language/bytecode.ts +++ b/src/language/bytecode.ts @@ -120,11 +120,15 @@ export function outputProgram(prog: IndexedProgram) { }); } }); + const indexRules = prog.indexInsertionRules.map((value) => { const varToIndex = new Map(); - for (const [index, varName] of value.introduced.entries()) { + for (const [index, varName] of value.shared.entries()) { varToIndex.set(varName, index); } + for (const [index, varName] of value.introduced.entries()) { + varToIndex.set(varName, index + value.shared.length); + } return new Rule({ is: { @@ -139,6 +143,7 @@ export function outputProgram(prog: IndexedProgram) { }, }); }); + const conclusionRules = prog.conclusionRules.map((value) => { const varToIndex = new Map(); for (const [index, varName] of value.inVars.entries()) {