Skip to content

Commit 033d894

Browse files
committed
docs: better writing of validation criteria.
1 parent 41354ac commit 033d894

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

src/linear_relation/canonical.rs

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -450,18 +450,23 @@ impl<G: PrimeGroup> TryFrom<&LinearRelation<G>> for CanonicalLinearRelation<G> {
450450
.collect::<Vec<_>>();
451451
let rhs_constant_term = G::msm(&rhs_constants, &rhs_elements);
452452

453-
// The right-hand side is trivial if it contains no scalar variables, or the weight is zero.
453+
// We say that an equation is trivial if it contains no scalar variables.
454+
// To "contain no scalar variables" means that each term in the right-hand side is a unit or its weight is zero.
454455
let is_trivial = rhs.0.iter().all(|term| {
455456
matches!(term.term.scalar, ScalarTerm::Unit) || term.weight.is_zero_vartime()
456457
});
457458

458-
// Skip processing trivially true constraints. There's nothing to prove here.
459-
if is_trivial && rhs_constant_term == lhs_value {
459+
// We say that an equation is homogenous if the constant term is zero.
460+
let is_homogenous = rhs_constant_term == lhs_value;
461+
462+
// Skip processing trivial equations that are always true.
463+
// There's nothing to prove here.
464+
if is_trivial && is_homogenous {
460465
continue;
461466
}
462467

463468
// Disallow non-trivial equations with trivial solutions.
464-
if !is_trivial && rhs_constant_term == lhs_value {
469+
if !is_trivial && is_homogenous {
465470
return Err(InvalidInstance::new("Trivial kernel in this relation"));
466471
}
467472

0 commit comments

Comments
 (0)