Skip to content

Commit

Permalink
chore(explain): Add env param to enable/disable equality logic.
Browse files Browse the repository at this point in the history
  • Loading branch information
arbimo committed Mar 5, 2024
1 parent fe0aad5 commit b7ddc1f
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion solver/src/model/lang/expr.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
use crate::core::literals::Disjunction;
use crate::core::*;
use crate::model::extensions::AssignmentExt;
use crate::model::lang::{Atom, FAtom, IAtom, SAtom};
use crate::model::{Label, Model};
use crate::reif::{DifferenceExpression, ReifExpr, Reifiable};
use env_param::EnvParam;
use std::ops::Not;

static USE_EQUALITY_LOGIC: EnvParam<bool> = EnvParam::new("ARIES_USE_EQ_LOGIC", "true");

pub fn leq(lhs: impl Into<IAtom>, rhs: impl Into<IAtom>) -> Leq {
Leq(lhs.into(), rhs.into())
}
Expand Down Expand Up @@ -144,6 +146,9 @@ impl<Lbl: Label> Reifiable<Lbl> for Eq {
and([lr, rl]).into()
}
(Int(a), Int(b)) => int_eq(a, b, model),
(Sym(_), Sym(_)) if !USE_EQUALITY_LOGIC.get() => {
int_eq(a.int_view().unwrap(), b.int_view().unwrap(), model)
}
(Sym(va), Sym(vb)) => match (va, vb) {
(SAtom::Var(a), SAtom::Var(b)) => {
if a.var <= b.var {
Expand Down

0 comments on commit b7ddc1f

Please sign in to comment.