Working MILP version of predicate splitter
This commit is contained in:
parent
e9e3241263
commit
2443f85520
4 changed files with 705 additions and 600 deletions
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue