correct inference counting over index backtracking, built-ins (#1977, #1987)

This commit is contained in:
Mark
2023-09-04 17:15:05 -06:00
parent 2ccc238119
commit 5585e83fd6
8 changed files with 153 additions and 102 deletions

View File

@@ -753,14 +753,16 @@ impl Machine {
match &indexing_lines[self.machine_st.oip as usize] {
IndexingLine::IndexedChoice(indexed_choice) => {
match &indexed_choice[(self.machine_st.iip + inner_offset) as usize] {
&IndexedChoiceInstruction::Retry(o) => {
&IndexedChoiceInstruction::Retry(o) |
&IndexedChoiceInstruction::DefaultRetry(o) => {
if self.next_clause_applicable(self.machine_st.p + o) {
return Some(inner_offset);
}
inner_offset += 1;
}
&IndexedChoiceInstruction::Trust(o) => {
&IndexedChoiceInstruction::Trust(o) |
&IndexedChoiceInstruction::DefaultTrust(o) => {
return if self.next_clause_applicable(self.machine_st.p + o) {
Some(inner_offset)
} else {
@@ -1268,4 +1270,4 @@ impl Machine {
}
}
}
}
}