smt_scope/
util.rs

1#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
2#[derive(Debug, Clone, Copy)]
3pub struct F64Ord(pub f64);
4impl std::cmp::PartialEq for F64Ord {
5    fn eq(&self, other: &Self) -> bool {
6        self.0.total_cmp(&other.0).is_eq()
7    }
8}
9impl std::cmp::Eq for F64Ord {}
10impl std::cmp::PartialOrd for F64Ord {
11    fn partial_cmp(&self, other: &Self) -> Option<std::cmp::Ordering> {
12        Some(self.cmp(other))
13    }
14}
15impl std::cmp::Ord for F64Ord {
16    fn cmp(&self, other: &Self) -> std::cmp::Ordering {
17        self.0.total_cmp(&other.0)
18    }
19}
20
21#[cfg(test)]
22pub(crate) fn test_parser() -> crate::Z3Parser {
23    use crate::LogParser;
24    let file = include_str!("../tests/data/z3.log");
25    crate::Z3Parser::from_str(file).process_all().unwrap()
26}