Skip to content

Commit

Permalink
this commit restructures the interaction generation in order to have
Browse files Browse the repository at this point in the history
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
  • Loading branch information
alpaylan committed Jan 10, 2025
1 parent cc56276 commit 191b586
Show file tree
Hide file tree
Showing 11 changed files with 979 additions and 501 deletions.
3 changes: 2 additions & 1 deletion simulator/generation/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ use anarchist_readable_name_generator_lib::readable_name_custom;
use rand::{distributions::uniform::SampleUniform, Rng};

pub mod plan;
pub mod property;
pub mod query;
pub mod table;

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

0 comments on commit 191b586

Please sign in to comment.