arkworks-rs / snark

Interfaces for Relations and SNARKs for these relations
https://www.arkworks.rs
Apache License 2.0
769 stars 203 forks source link

`PartialOrd` for `Variable` violates `transitivity` and `duality` properties #360

Open BoyuanFeng opened 2 years ago

BoyuanFeng commented 2 years ago

Summary of Bug

PartialOrd for Variable violates transitivity and duality properties.

This code prints both 0<1 and 1<0.

See playground for example:

one is Some(Less) than zero
zero is Some(Less) than one

Version

v0.3.0 8bb375e51be184d495c82969bd1d9a3f8fe7d27a

Steps to Reproduce

https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=51b860bb4a8854d6636e740e8be1c9ce