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

@@ -3190,6 +3190,9 @@ impl Machine {
(self.machine_st.increment_call_count_fn)(&mut self.machine_st)
);
}
&IndexedChoiceInstruction::DefaultRetry(l) => {
self.retry(l);
}
&IndexedChoiceInstruction::Trust(l) => {
self.trust(l);
@@ -3198,6 +3201,9 @@ impl Machine {
(self.machine_st.increment_call_count_fn)(&mut self.machine_st)
);
}
&IndexedChoiceInstruction::DefaultTrust(l) => {
self.trust(l);
}
}
}
IndexingLine::DynamicIndexedChoice(_) => {
@@ -5192,11 +5198,6 @@ impl Machine {
if self.machine_st.fail {
self.machine_st.backtrack();
} else {
try_or_throw!(
self.machine_st,
(self.machine_st.increment_call_count_fn)(&mut self.machine_st)
);
}
}
&Instruction::ExecuteFastCallN(arity) => {
@@ -5208,11 +5209,6 @@ impl Machine {
if self.machine_st.fail {
self.machine_st.backtrack();
} else {
try_or_throw!(
self.machine_st,
(self.machine_st.increment_call_count_fn)(&mut self.machine_st)
);
}
}
&Instruction::CallGetClauseP => {