Skip to content

Commit 6e7e0fc

Browse files
committed
minor documentation fixes
1 parent f7d2285 commit 6e7e0fc

File tree

22 files changed

+47
-65
lines changed

22 files changed

+47
-65
lines changed

src/algos/beam_search/cache.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,8 +158,8 @@ impl EnumFormulaCacheLine<BoolCharac> for BeamSearchBoolCacheLine<'_> {
158158
}
159159
}
160160

161-
// Stores a SatVec together with the hash of the corresponding Boolean formula.
162-
// Used when removing dominated formulas in a single to canonicalize the entries at the end of the push round.
161+
// Stores a SatVec together with the hash of the corresponding boolean formula.
162+
// Used when removing dominated formulas in a single pass to canonicalize the entries at the end of the push round.
163163
#[derive(Debug, PartialEq, Eq)]
164164
struct PcoBoolFormula {
165165
pub(crate) f: BoolFormula,

src/algos/beam_search/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//! Beam Search algorithm for Boolean Synthesis.
1+
//! Beam Search Algorithm for Boolean Set Cover.
22
//!
33
//! Bottom-up enumeration with fixed width.
44
//! Implemented using a fixed-width cache ([`BeamSearchCache`])
@@ -22,7 +22,7 @@ use super::{BoolAlgoParams, meta::cache::InitialBoolCache};
2222
pub struct BeamSearchParams {
2323
/// Number of formulas to keep at each level.
2424
pub beam_width: usize,
25-
/// Maximum enumeration size
25+
/// Maximum enumeration size.
2626
pub max_size_bool: usize,
2727
}
2828

src/algos/enumeration/aux.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ where
130130
continue;
131131
}
132132

133-
// For non-commutative operations
133+
// For non-commutative operations.
134134
let g = apply_binary(op, f_r, f_l);
135135
if g.eq_target(target) {
136136
return Ok(g);

src/algos/enumeration/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//! Semanting Enumration algorithm for LTL and Boolean Synthesis.
1+
//! Semantic Enumeration algorithm for LTL Learning and Boolean Set Cover.
22
33
pub(crate) mod aux;
44

src/algos/meta/cache.rs

Lines changed: 2 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
//! Boolean cache used after LTL search
2-
//! given as input to the boolean algorithms.
2+
//! given as input to the boolean set cover algorithms.
33
use std::{
44
collections::BinaryHeap,
55
hash::{Hash, Hasher},
@@ -138,24 +138,6 @@ impl InitialBoolCache {
138138
}
139139
}
140140

141-
// let (lines, best_sv) = (res.lines, res.best_sv);
142-
143-
// res.lines = lines
144-
// .into_iter()
145-
// .map(|l| {
146-
// l.into_iter()
147-
// .filter(|(_, lsv, _)| {
148-
// best_sv[..lsv.size - 1]
149-
// .iter()
150-
// .flatten()
151-
// .any(|lsv2| lsv2.dominates(lsv))
152-
// })
153-
// .collect_vec()
154-
// })
155-
// .collect();
156-
157-
// res.best_sv = best_sv;
158-
159141
debug!("Creating Initial Cache: {count} formulas, {hits} cache hits");
160142

161143
res
@@ -378,7 +360,7 @@ mod test {
378360
hash: 0,
379361
});
380362

381-
// Ensure that we get min popcount first
363+
// Ensure that we get min popcount first.
382364
assert_eq!(h.pop().unwrap().popcount, 1);
383365
}
384366
}

src/algos/meta/mod.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,9 @@ where
3535
let start = Instant::now();
3636

3737
let atoms = atoms(traces, atomic_propositions);
38-
// Add initial formulas
38+
// Add initial formulas.
3939
let (atom, mut ltl_cache) = create_initial_cache(atoms, &target);
40-
// Check if target is an atom
40+
// Check if target is an atom.
4141
if let Some(f) = atom {
4242
let ltl_time = start.elapsed();
4343
let f_str = rebuild_formula(&f, &ltl_cache);
@@ -51,7 +51,7 @@ where
5151
};
5252
}
5353

54-
// Ltl search
54+
// LTL search
5555
let ltl_res = enum_aux(&mut ltl_cache, &operators, &target, max_size_ltl);
5656

5757
let ltl_time = start.elapsed();
@@ -87,7 +87,7 @@ where
8787
}
8888
}
8989

90-
/// Solve Boolean Synthesis problem using Divide and Conquer and the algorithm specified in `params`.
90+
/// Solve Boolean Set Cover problem using Divide and Conquer and the algorithm specified in `params`.
9191
///
9292
/// If the number of traces is more than 128, split immediately.
9393
/// Otherwise, try to solve the instance with the algorithm implemented by `params`.
@@ -104,7 +104,7 @@ where
104104
P: BoolAlgoParams + Clone,
105105
{
106106
let nb_traces = target.len();
107-
// Check whether the fom
107+
// Check whether the formula is already in the cache.
108108
if let Some(f) = initial_cache.get_from_cv(target, target) {
109109
// Due to hash collisions, the formula may not be right; we check that
110110
// the formula has the right characteristic vector.
@@ -170,7 +170,7 @@ where
170170
})
171171
}
172172

173-
/// Divide and conquer subrouting to split into two subproblems with clever merging.
173+
/// Divide and conquer subroutine to split into two subproblems with clever merging.
174174
///
175175
/// We use [`find_split`] to get indices for the left subproblem, and solve it recursively.
176176
/// If we get a solution, use the set of unsatisfied indices for the right subproblem,
@@ -259,7 +259,7 @@ where
259259
/// of traces to keeps in each split.
260260
///
261261
/// If the split was on the positives, the returned operation is [`LtlBinaryOp::Or`],
262-
/// and otherwise it's [`LtlBinaryOp::And`].
262+
/// and otherwise it is [`LtlBinaryOp::And`].
263263
fn find_split(target: &[bool]) -> Option<(LtlBinaryOp, Vec<usize>, Vec<usize>)> {
264264
let nb_traces = target.len();
265265
let nb_pos = target.iter().filter(|b| **b).count();

src/algos/mod.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
1-
//! (Meta-)Algorithms for LTL and Boolean Synthesis.
1+
//! (Meta-)Algorithms for LTL and Boolean Set Cover
22
//!
33
//! Meta-algorithms first run an LTL enumeration algorithm for a fixed number of iterations,
4-
//! if no solution is found, they run a Boolean Synthesis on the set of LTL formulas to
4+
//! if no solution is found, they run a Boolean Set Cover on the set of LTL formulas to
55
//! find a solution.
66
//!
77
//! This module contains the following meta-algorithms:
88
//! - [Divide and conquer](self::meta)
99
//!
10-
//! This module contains the following Boolean Synthesis algorithms:
10+
//! This module contains the following Boolean Set Cover algorithms:
1111
//! - [Set Cover](self::set_cover)
1212
//! - [Semantic Enumeration](self::enumeration)
1313
//! - [Beam Search](self::beam_search)
1414
//!
15-
//! Implementing a Boolean Synthesis for use with meta-algorithms is done via
15+
//! Implementing a Boolean Set Cover for use with meta-algorithms is done via
1616
//! the [`BoolAlgoParams`] trait.
1717
use std::rc::Rc;
1818

@@ -36,7 +36,7 @@ pub mod enumeration;
3636
pub mod meta;
3737
pub mod set_cover;
3838

39-
/// Abstraction for the hyperparameters of Boolean Synthesis algo, used to launch multiple runs.
39+
/// Abstraction for the hyperparameters of Boolean Set Cover algorithm, used to launch multiple runs.
4040
pub trait BoolAlgoParams {
4141
/// Additional info returned by a run, e.g. for collecting data for experiments.
4242
/// If unneeded, just use `()`.
@@ -92,7 +92,7 @@ pub(crate) fn create_initial_cache(
9292
target: &[bool],
9393
) -> (Option<LtlFormula>, LtlCache) {
9494
let mut ltl_cache = LtlCache::new();
95-
// Add empty line for size 0 in cache
95+
// Add empty line for size 0 in cache.
9696
ltl_cache.new_line(0);
9797

9898
let mut initial_line = ltl_cache.new_line(1);

src/algos/set_cover/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//! Set cover algorithm for Boolean Synthesis.
1+
//! Set cover algorithm for Boolean Set Cover.
22
//!
33
//! Produces Or-of-And or And-of-Or formulas in a greedy fashion.
44

src/bin/experiments.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,8 @@ fn get_name_time_sol<P: BoolAlgoParams + Clone>(
8080
struct CliArgs {
8181
/// Name of the .json file to read.
8282
input_filename: PathBuf,
83-
/// Run LTL enumeration until `max_size_ltl`
84-
/// before switching to boolean algorithm.
83+
/// Run LTL enumeration until size `max_size_ltl`
84+
/// before switching to boolean set cover algorithm.
8585
max_size_ltl: usize,
8686
/// Number of candidates to use for domination checking
8787
/// in the step that converts LTL formulas to boolean formulas.

src/bool/cache.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -189,8 +189,8 @@ impl EnumFormulaCacheLine<BoolCharac> for BoolCacheLine<'_> {
189189
}
190190
}
191191

192-
/// Stores a SatVec together with the hash of the corresponding Boolean formula.
193-
/// Used when removing dominated formulas in a single to canonicalize the entries at the end of the push round.
192+
/// Stores a SatVec together with the hash of the corresponding boolean formula.
193+
/// Used when removing dominated formulas in a single pass to canonicalize the entries at the end of the push round.
194194
#[derive(Debug, PartialEq, Eq)]
195195
pub(crate) struct SvHash {
196196
sv: SatVec,

0 commit comments

Comments
 (0)