Module programinduction::domains::circuits
source · Expand description
The Boolean circuit domain.
As in the paper “Bootstrap Learning for Modular Concept Discovery” (2013).
Examples
use programinduction::domains::circuits;
use programinduction::{ECParams, EC};
use rand::{rngs::SmallRng, SeedableRng};
let dsl = circuits::dsl();
let rng = &mut SmallRng::from_seed([1u8; 32]);
let tasks = circuits::make_tasks(rng, 250);
let ec_params = ECParams {
frontier_limit: 100,
search_limit_timeout: None,
search_limit_description_length: Some(9.0),
};
let frontiers = dsl.explore(&ec_params, &tasks);
let hits = frontiers.iter().filter_map(|f| f.best_solution()).count();
assert!(40 < hits && hits < 80, "hits = {}", hits);
Structs
- An
Evaluator
for the circuits domain.
Functions
- The circuit representation, a
lambda::Language
, only defines the binarynand
operation. - Randomly sample a number of circuits into
Task
s. - Like
make_tasks
, but with a configurable circuit distribution.
Type Aliases
- All values in the circuits domain can be represented in this
Space
.