<commit_before>//! This crate searches for the solutions to logic puzzles.
//! The puzzle rules are expressed as constraints.

extern crate bit_set;

pub use puzzle::Puzzle;

/// A puzzle variable token.
#[derive(Copy,Clone,Debug,Eq,PartialEq)]
pub struct VarToken(usize);

/// The type of a puzzle variable's value (i.e. the candidate type).
pub type Val = i32;

mod puzzle;<commit_msg>Add solution type.<commit_after>//! This crate searches for the solutions to logic puzzles.
//! The puzzle rules are expressed as constraints.

extern crate bit_set;

use std::ops::Index;

pub use puzzle::Puzzle;

/// A puzzle variable token.
#[derive(Copy,Clone,Debug,Eq,PartialEq)]
pub struct VarToken(usize);

/// The type of a puzzle variable's value (i.e. the candidate type).
pub type Val = i32;

/// A dictionary mapping puzzle variables to the solution value.
#[derive(Debug)]
pub struct Solution {
    vars: Vec<Val>,
}

mod puzzle;

impl Index<VarToken> for Solution {
    type Output = Val;
    fn index(&self, var: VarToken) -> &Val {
        let VarToken(idx) = var;
        &self.vars[idx]
    }
}
{'fraction_non_alphanumeric': 0.11930783242258652, 'fraction_numerical': 0.0036429872495446266, 'mean_word_length': 3.7370689655172415, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 6, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1937666', 'n_tokens_mistral': 343, 'n_tokens_neox': 333, 'n_words': 130}