Skip to content

Commit

Permalink
chore: Add convenience method for extracting variables from an SAtom
Browse files Browse the repository at this point in the history
  • Loading branch information
arbimo committed Apr 18, 2024
1 parent ccbdbeb commit 77b0aae
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions solver/src/model/lang/sym.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,13 @@ impl SAtom {
SAtom::Cst(s) => IAtom::new(IVar::ZERO, usize::from(s.sym) as IntCst),
}
}

pub fn variable(&self) -> VarRef {
match self {
SAtom::Var(v) => v.var,
SAtom::Cst(_) => VarRef::ZERO,
}
}
}

impl From<SVar> for VarRef {
Expand Down

0 comments on commit 77b0aae

Please sign in to comment.