Skip to content

Commit

Permalink
add a predicates function to theory
Browse files Browse the repository at this point in the history
  • Loading branch information
janheuer committed Nov 22, 2024
1 parent ef9777e commit 70f2c4a
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/syntax_tree/fol.rs
Original file line number Diff line number Diff line change
Expand Up @@ -906,6 +906,14 @@ pub struct Theory {
impl_node!(Theory, Format, TheoryParser);

impl Theory {
pub fn predicates(&self) -> IndexSet<Predicate> {
let mut preds = IndexSet::new();
for formula in self {
preds.extend(formula.predicates())
}
preds
}

pub fn replace_placeholders(self, mapping: &IndexMap<String, FunctionConstant>) -> Self {
self.into_iter()
.map(|f| f.replace_placeholders(mapping))
Expand Down

0 comments on commit 70f2c4a

Please sign in to comment.