_ => {}
}
- println!("Warning: overwriting {}/{}", key.0.as_str(), key.1);
+ println!("Warning: overwriting {}/{} because the clauses are discontiguous", key.0.as_str(), key.1);
}
impl<'a, LS: LoadState<'a>> Loader<'a, LS> {
let payload_compilation_target = self.payload.compilation_target;
- let local_predicate_info = self
+ let mut local_predicate_info = self
.wam_prelude
.indices
.get_local_predicate_skeleton(
let is_cross_module_clause =
payload_compilation_target != self.payload.predicates.compilation_target;
+ local_predicate_info.is_discontiguous = predicate_info.is_discontiguous;
+
if local_predicate_info.must_retract_local_clauses(is_cross_module_clause) {
self.retract_local_clauses(&key, predicate_info.is_dynamic);
}
* loader.pl does a few high-level things more easily handled from
* Prolog that are not supported (or needed) during bootstrapping:
* term and goal expansion, loading modules from different streams,
- * verifying certain kinds of declarations, perhaps (in the future?)
- * compiling inline disjunctions.
+ * and verifying certain kinds of declarations.
*
* Since the loader can operate incrementally, it uses an intermittent
* structure to rebuild the loader between invocations. Preprocessor
name: Atom,
arity: usize,
) -> Result<(), SessionError> {
+ let key = (name, arity);
+
+ let predicate_info = self
+ .wam_prelude
+ .indices
+ .get_predicate_skeleton(&self.payload.predicates.compilation_target, &key)
+ .map(|skeleton| skeleton.predicate_info())
+ .unwrap_or_default();
+
+ self.retract_local_clauses(&key, predicate_info.is_dynamic);
+
self.add_extensible_predicate_declaration(
compilation_target,
name,
use crate::predicate_queue;
+use fxhash::FxBuildHasher;
use indexmap::IndexSet;
use std::collections::VecDeque;
pub(super) compilation_target: CompilationTarget,
pub(super) retraction_info: RetractionInfo,
pub(super) module_op_exports: ModuleOpExports,
- pub(super) non_counted_bt_preds: IndexSet<PredicateKey>,
+ pub(super) non_counted_bt_preds: IndexSet<PredicateKey, FxBuildHasher>,
pub(super) predicates: PredicateQueue,
pub(super) clause_clauses: Vec<(Term, Term)>,
}
compilation_target: CompilationTarget::default(),
retraction_info: RetractionInfo::new(code_repo_len),
module_op_exports: vec![],
- non_counted_bt_preds: IndexSet::new(),
+ non_counted_bt_preds: IndexSet::with_hasher(FxBuildHasher::default()),
predicates: predicate_queue![],
clause_clauses: vec![],
- }
+ }
}
}