Skip to content

Commit

Permalink
Bump Clap version. Ghost to Snapshot in Scratch and NewDB
Browse files Browse the repository at this point in the history
  • Loading branch information
sarsko committed Apr 10, 2024
1 parent 4d653b9 commit a8b3b92
Show file tree
Hide file tree
Showing 8 changed files with 219 additions and 60 deletions.
177 changes: 168 additions & 9 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion NewDB/src/clause_allocator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ impl ClauseAllocator {
let cref = self.buffer.len() as CRef;
self.buffer.push(Lit::raw(lits.len() as u32));

let old_self: Ghost<&mut ClauseAllocator> = ghost!(self);
let old_self: Snapshot<&mut ClauseAllocator> = snapshot!(self);

#[invariant(self.num_vars == old_self.num_vars)] // TODO: Don't like this
#[invariant(^*old_self == ^self)]
Expand Down
2 changes: 1 addition & 1 deletion NewDB/src/clause_manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ impl ClauseManager {
//#[requires(self@.len() + (@lits).len() + @HEADER_LEN <= @u32::MAX)] // TODO: May have to move this to a runtime check
#[requires(clause_invariant_seq(lits@, self.clause_allocator.num_vars@))]
pub(crate) fn learn_clause(&mut self, lits: &[Lit]) -> CRef {
let old_self: Ghost<&mut ClauseManager> = ghost!(self);
let old_self: Snapshot<&mut ClauseManager> = snapshot!(self);
proof_assert!(self.learnt_core.are_implied_by(self.original_clauses, self.clause_allocator));
let cref = self.clause_allocator.add_clause(lits);
proof_assert!(^*old_self == ^self);
Expand Down
2 changes: 1 addition & 1 deletion Scratch/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ authors = ["Sarek Høverstad Skotåm <sarek.skotam@gmail.com>"]
edition = "2021"

[dependencies]
clap = "2.33.3"
clap = "4.5.4"
creusot-contracts = { git = "https://github.com/xldenis/creusot", version = "^0", rev = "1357cc97" }

# This is just copied verbatim from CreuSAT.
Expand Down
2 changes: 1 addition & 1 deletion Scratch/src/clause.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
extern crate creusot_contracts;
use creusot_contracts::{std::*, Clone, Ghost, *};
use creusot_contracts::{std::*, Clone, Snapshot, *};

use crate::{assignments::*, formula::*, lit::*};

Expand Down
2 changes: 1 addition & 1 deletion Scratch/src/scratch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ pub fn lemma_clause_permuted_maintains_unsat(c: Clause, a: Assignments) {}
#[ensures(f.clauses@.len() == (^f).clauses@.len())]
#[ensures(f.equisat(^f))] // This one is hard (both ways equisat)
fn swap(f: &mut Formula, cref: usize, j: usize, k: usize, assignments: Assignments) {
let old_f: Ghost<&mut Formula> = ghost! { f };
let old_f: Snapshot<&mut Formula> = snapshot! { f };

f.clauses[cref].lits.swap(j, k);

Expand Down
Loading

0 comments on commit a8b3b92

Please sign in to comment.