Skip to content

Commit

Permalink
Undo reverted changes
Browse files Browse the repository at this point in the history
  • Loading branch information
JonasAlaif committed Oct 24, 2024
1 parent 326da6f commit 61f9c92
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 deletions.
8 changes: 8 additions & 0 deletions smt-log-parser/src/parsers/z3/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,14 @@ impl VersionInfo {
self.version()
.is_some_and(|v| v == &semver::Version::new(major, minor, patch))
}

pub fn is_version_minor(&self, major: u64, minor: u64) -> bool {
self.version().is_some_and(|v| {
&semver::Version::new(major, minor, 0) <= v
&& v <= &semver::Version::new(major, minor, u64::MAX)
})
}

pub fn is_ge_version(&self, major: u64, minor: u64, patch: u64) -> bool {
self.version()
.is_some_and(|v| v >= &semver::Version::new(major, minor, patch))
Expand Down
12 changes: 6 additions & 6 deletions smt-log-parser/src/parsers/z3/z3parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -710,12 +710,12 @@ impl Z3LogParser for Z3Parser {
z3_generation,
yields_terms: Default::default(),
};
// In version 4.12.2, I have on very rare occasions seen an `[instance]`
// repeated twice with the same fingerprint (without an intermediate
// `[new-match]`). We can try to remove the `can_duplicate` in the future.
let iidx =
self.insts
.new_inst(fingerprint, inst, self.version_info.is_version(4, 12, 2))?;
// In version 4.12.2 & 4.12.4, I have on very rare occasions seen an
// `[instance]` repeated twice with the same fingerprint (without an
// intermediate `[new-match]`). We can try to remove the `can_duplicate`
// in the future.
let can_duplicate = self.version_info.is_version_minor(4, 12);
let iidx = self.insts.new_inst(fingerprint, inst, can_duplicate)?;
self.inst_stack.try_reserve(1)?;
self.inst_stack.push((iidx, Vec::new()));
Ok(())
Expand Down

0 comments on commit 61f9c92

Please sign in to comment.