Skip to content

Commit 191b586

Browse files
committed
this commit restructures the interaction generation in order to have
better counterexample minimization. - it separates interaction plans from their state of execution - it removes closures from the property definitions, encoding properties as an enum variant, and deriving the closures from the variants. - it adds some naive counterexample minimization capabilities to the Limbo simulator and reduces the plan sizes considerably. - it makes small changes to various points of the simulator for better error reporting, enhancing code readability, small fixes to handle previously missed cases
1 parent cc56276 commit 191b586

File tree

11 files changed

+979
-501
lines changed

11 files changed

+979
-501
lines changed

simulator/generation/mod.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ use anarchist_readable_name_generator_lib::readable_name_custom;
44
use rand::{distributions::uniform::SampleUniform, Rng};
55

66
pub mod plan;
7+
pub mod property;
78
pub mod query;
89
pub mod table;
910

@@ -21,7 +22,7 @@ pub(crate) fn frequency<
2122
R: rand::Rng,
2223
N: Sum + PartialOrd + Copy + Default + SampleUniform + SubAssign,
2324
>(
24-
choices: Vec<(N, Box<dyn FnOnce(&mut R) -> T + 'a>)>,
25+
choices: Vec<(N, Box<dyn Fn(&mut R) -> T + 'a>)>,
2526
rng: &mut R,
2627
) -> T {
2728
let total = choices.iter().map(|(weight, _)| *weight).sum::<N>();

0 commit comments

Comments
 (0)