Skip to content

Commit

Permalink
Include both introduced and shared vars for index rule translation
Browse files Browse the repository at this point in the history
  • Loading branch information
robsimmons committed Jan 1, 2024
1 parent 4549773 commit 76d2814
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/language/bytecode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,11 +120,15 @@ export function outputProgram(prog: IndexedProgram) {
});
}
});

const indexRules = prog.indexInsertionRules.map((value) => {
const varToIndex = new Map<string, number>();
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: {
Expand All @@ -139,6 +143,7 @@ export function outputProgram(prog: IndexedProgram) {
},
});
});

const conclusionRules = prog.conclusionRules.map((value) => {
const varToIndex = new Map<string, number>();
for (const [index, varName] of value.inVars.entries()) {
Expand Down

0 comments on commit 76d2814

Please sign in to comment.