Skip to content

Commit 032cf32

Browse files
authored
Merge pull request #1352 from cryspen/prop-eq-any-type
hax-lib: prop: allow equality on every type
2 parents 610708e + 847299d commit 032cf32

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

hax-lib/src/prop.rs

+12-4
Original file line numberDiff line numberDiff line change
@@ -21,18 +21,24 @@ pub mod constructors {
2121
pub fn not(lhs: Prop) -> Prop {
2222
Prop(!lhs.0)
2323
}
24-
pub fn eq(lhs: Prop, other: Prop) -> Prop {
25-
Prop(lhs.0 == other.0)
24+
25+
/// Logical equality between two value of *any* type
26+
pub fn eq<T>(_lhs: T, _rhs: T) -> Prop {
27+
Prop(true)
2628
}
27-
pub fn ne(lhs: Prop, other: Prop) -> Prop {
28-
Prop(lhs.0 != other.0)
29+
30+
pub fn ne<T>(_lhs: T, _rhs: T) -> Prop {
31+
Prop(true)
2932
}
33+
3034
pub fn implies(lhs: Prop, other: Prop) -> Prop {
3135
Prop(lhs.0 || !other.0)
3236
}
37+
3338
pub fn forall<A, F: Fn(A) -> Prop>(_pred: F) -> Prop {
3439
Prop(true)
3540
}
41+
3642
pub fn exists<A, F: Fn(A) -> Prop>(_pred: F) -> Prop {
3743
Prop(true)
3844
}
@@ -136,3 +142,5 @@ pub fn exists<T, U: Into<Prop>>(f: impl Fn(T) -> U) -> Prop {
136142
pub fn implies(lhs: impl Into<Prop>, rhs: impl Into<Prop>) -> Prop {
137143
constructors::implies(lhs.into(), rhs.into())
138144
}
145+
146+
pub use constructors::eq;

0 commit comments

Comments
 (0)