File tree Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments