vampire-prover 0.5.1

Safe Rust bindings to the Vampire theorem prover for first-order logic
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
use std::sync::{Mutex, MutexGuard};

pub struct Ctx {
    pub free_var: u32,
}

static GLOBAL_LOCK: Mutex<Ctx> = Mutex::new(Ctx { free_var: 0 });

pub fn synced<R, F: FnOnce(&mut MutexGuard<Ctx>) -> R>(f: F) -> R {
    let mut handle = GLOBAL_LOCK.lock().unwrap();
    let res = f(&mut handle);
    drop(handle);
    res
}