Skip to content

Commit

Permalink
Fix 'forall' and 'exists' quantifiers
Browse files Browse the repository at this point in the history
  • Loading branch information
octalsrc committed Aug 2, 2024
1 parent 8f912e6 commit 142f027
Showing 1 changed file with 18 additions and 18 deletions.
36 changes: 18 additions & 18 deletions src/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -655,15 +655,15 @@ impl Context {
I: IntoIterator<Item = (N, SExpr)>,
N: Into<String> + AsRef<str>,
{
let args: Vec<_> = std::iter::once(self.atoms.forall)
.chain(
vars.into_iter()
.map(|(n, s)| self.list(vec![self.atom(n), s])),
)
.chain(std::iter::once(body))
.collect();
assert!(args.len() >= 3);
self.list(args)
let vars_iter =
vars
.into_iter()
.map(|(n, s)| self.list(vec![self.atom(n), s]));
self.list(vec![
self.atoms.forall,
self.list(vars_iter.collect()),
body,
])
}

/// Existentially quantify sorted variables in an expression.
Expand All @@ -672,15 +672,15 @@ impl Context {
I: IntoIterator<Item = (N, SExpr)>,
N: Into<String> + AsRef<str>,
{
let args: Vec<_> = std::iter::once(self.atoms.exists)
.chain(
vars.into_iter()
.map(|(n, s)| self.list(vec![self.atom(n), s])),
)
.chain(std::iter::once(body))
.collect();
assert!(args.len() >= 3);
self.list(args)
let vars_iter =
vars
.into_iter()
.map(|(n, s)| self.list(vec![self.atom(n), s]));
self.list(vec![
self.atoms.exists,
self.list(vars_iter.collect()),
body,
])
}

/// Perform pattern matching on values of an algebraic data type.
Expand Down

0 comments on commit 142f027

Please sign in to comment.