Use ordered sets for declarations

This replaces the unordered sets used for function and predicate
declarations with ordered sets. This is useful when these declarations
are supposed to be processed in a stable and meaningful order.
This commit is contained in:
Patrick Lühne 2020-02-02 17:39:41 +01:00
parent e1d616d8b4
commit 3e6e68f6ea
Signed by: patrick
GPG Key ID: 05F3611E97A70ABF
2 changed files with 4 additions and 4 deletions

View File

@ -47,7 +47,7 @@ impl FunctionDeclaration
}
}
pub type FunctionDeclarations = std::collections::HashSet<std::rc::Rc<FunctionDeclaration>>;
pub type FunctionDeclarations = std::collections::BTreeSet<std::rc::Rc<FunctionDeclaration>>;
#[derive(Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct PredicateDeclaration
@ -68,7 +68,7 @@ impl PredicateDeclaration
}
}
pub type PredicateDeclarations = std::collections::HashSet<std::rc::Rc<PredicateDeclaration>>;
pub type PredicateDeclarations = std::collections::BTreeSet<std::rc::Rc<PredicateDeclaration>>;
#[derive(Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct VariableDeclaration

View File

@ -211,7 +211,7 @@ impl<'formula> std::fmt::Debug for FormulaDisplay<'formula>
let mut separator = " ";
for parameter in &exists.parameters
for parameter in exists.parameters.iter()
{
write!(format, "{}{:?}", separator, parameter)?;
@ -226,7 +226,7 @@ impl<'formula> std::fmt::Debug for FormulaDisplay<'formula>
let mut separator = " ";
for parameter in &for_all.parameters
for parameter in for_all.parameters.iter()
{
write!(format, "{}{:?}", separator, parameter)?;