group predicate subsequences by first instantiated arg (#1053)

This commit is contained in:
Mark Thom
2022-02-08 23:34:42 -07:00
parent e4ea547623
commit 42da543980
2 changed files with 64 additions and 57 deletions

View File

@@ -219,7 +219,6 @@ pub enum PredicateClause {
}
impl PredicateClause {
// TODO: add this to `Term` in `crate::parser` like `first_arg`.
pub(crate) fn args(&self) -> Option<&[Term]> {
match self {
PredicateClause::Fact(term, ..) => match term {
@@ -237,6 +236,13 @@ impl PredicateClause {
}
}
#[derive(Debug)]
pub struct ClauseSpan {
pub left: usize,
pub right: usize,
pub instantiated_arg_index: usize,
}
#[derive(Debug, Clone)]
pub enum ModuleSource {
Library(Atom),