Skip to content

Commit

Permalink
simple property with expected cex
Browse files Browse the repository at this point in the history
  • Loading branch information
graydon committed May 18, 2020
1 parent 452c45a commit d68537c
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/stateright_tests.rs
Expand Up @@ -7,6 +7,7 @@ use pretty_env_logger;
use stateright::actor::system::*;
use stateright::actor::*;
use stateright::checker::*;
use std::sync::Arc;

type ObjLD = pergola::MaxDef<u16>;
type ObjLE = pergola::LatticeElt<ObjLD>;
Expand Down Expand Up @@ -86,8 +87,9 @@ fn model(sys: System<ConcordeActor>) -> Model<'static, System<ConcordeActor>> {
Model {
state_machine: sys,
properties: vec![Property::always(
"proposed",
|_sys: &System<ConcordeActor>, _state: &SystemState<ConcordeActor>| true,
"all-fini",
|_sys: &System<ConcordeActor>, _state: &SystemState<ConcordeActor>|
_state.actor_states.iter().all(|state:&Arc<Part>| (**state).propose_is_fini()),
)],
boundary: None,
}
Expand All @@ -99,4 +101,9 @@ fn model_check() {
pretty_env_logger::init();
let mut checker = model(system()).checker_with_threads(num_cpus::get());
checker.check_and_report(&mut std::io::stdout());
match checker.counterexample("all-fini") {
None => println!("no cex"),
Some(cex) => println!("cex: {:?}", cex)
}

}

0 comments on commit d68537c

Please sign in to comment.