Skip to content

Commit

Permalink
relationalization changes
Browse files Browse the repository at this point in the history
moving equality expansion out of relationalization
adding Relational wrapper around Formula
resetting Relationalizer before each transformation so it can be used to translate multiple formulae
  • Loading branch information
salmans committed Oct 28, 2020
1 parent 700dd5e commit f0992b3
Show file tree
Hide file tree
Showing 9 changed files with 182 additions and 148 deletions.
5 changes: 5 additions & 0 deletions razor-fol/src/syntax/symbol.rs
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,11 @@ impl Generator {
self.counter += 1;
result
}

/// Resets the generator by setting its internal counter to 0.
pub fn reset(&mut self) {
self.counter = 0;
}
}

#[cfg(test)]
Expand Down
1 change: 1 addition & 0 deletions razor-fol/src/transform.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ pub use dnf::DNF;
pub use gnf::GNF;
pub use nnf::NNF;
pub use pnf::PNF;
pub use relationalize::Relational;
pub use snf::SNF;
pub use substitution::{Substitution, TermBased, VariableRenaming};

Expand Down
1 change: 1 addition & 0 deletions razor-fol/src/transform/cnf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ pub struct CNF(Formula);

impl CNF {
/// Returns a reference to the formula wrapped in the receiver CNF.
#[inline(always)]
pub fn formula(&self) -> &Formula {
&self.0
}
Expand Down
1 change: 1 addition & 0 deletions razor-fol/src/transform/dnf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ pub struct DNF(Formula);

impl DNF {
/// Returns a reference to the formula wrapped in the receiver DNF.
#[inline(always)]
pub fn formula(&self) -> &Formula {
&self.0
}
Expand Down
1 change: 1 addition & 0 deletions razor-fol/src/transform/gnf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ pub struct GNF(Formula);

impl GNF {
/// Returns a reference to the formula wrapped in the receiver NNF.
#[inline(always)]
pub fn formula(&self) -> &Formula {
&self.0
}
Expand Down
1 change: 1 addition & 0 deletions razor-fol/src/transform/nnf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ pub struct NNF(Formula);

impl NNF {
/// Returns a reference to the formula wrapped in the receiver NNF.
#[inline(always)]
pub fn formula(&self) -> &Formula {
&self.0
}
Expand Down
1 change: 1 addition & 0 deletions razor-fol/src/transform/pnf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ pub struct PNF(Formula);

impl PNF {
/// Returns a reference to the formula wrapped in the receiver PNF.
#[inline(always)]
pub fn formula(&self) -> &Formula {
&self.0
}
Expand Down
Loading

0 comments on commit f0992b3

Please sign in to comment.