Working MILP version of predicate splitter

This commit is contained in:
Rob Knight 2026-04-30 16:56:42 +01:00
parent e9e3241263
commit 2443f85520
No known key found for this signature in database
4 changed files with 705 additions and 600 deletions

View file

@ -134,6 +134,18 @@ pub struct StatementTmpl {
pub span: Option<Span>,
}
impl StatementTmpl {
/// Names of all wildcards referenced by this statement's arguments,
/// in argument order with duplicates included.
pub fn wildcard_names(&self) -> impl Iterator<Item = &str> {
self.args.iter().filter_map(|arg| match arg {
StatementTmplArg::Wildcard(id) => Some(id.name.as_str()),
StatementTmplArg::AnchoredKey(ak) => Some(ak.root.name.as_str()),
StatementTmplArg::Literal(_) | StatementTmplArg::SelfPredicateHash(_) => None,
})
}
}
/// Reference to a predicate (local or qualified with module name)
#[derive(Debug, Clone, PartialEq)]
pub enum PredicateRef {