libprop_sat_solver/formula/variable.rs
1//! Propositional variable.
2
3/// A propositional formula variable.
4#[derive(Debug, Clone, Hash, PartialEq, Eq, PartialOrd)]
5pub struct Variable {
6 name: String,
7}
8
9impl Variable {
10 /// Construct a new propositional variable from a given `name`.
11 pub fn new<S>(name: S) -> Self
12 where
13 S: Into<String>,
14 {
15 Self { name: name.into() }
16 }
17
18 /// Get the name of the propositional variable.
19 pub fn name(&self) -> &str {
20 &self.name
21 }
22}