From 76d2814b64b7dac9fded0d0ea3b57a3979b69edd Mon Sep 17 00:00:00 2001 From: Rob Simmons Date: Mon, 1 Jan 2024 16:30:37 -0500 Subject: [PATCH] Include both introduced and shared vars for index rule translation --- src/language/bytecode.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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()) {