Skip to content

Commit 68732fb

Browse files
committed
Revert "Implement Eq and Hash for Type"
This reverts commit 91af963.
1 parent 26316e3 commit 68732fb

2 files changed

Lines changed: 14 additions & 14 deletions

File tree

src/chc.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -389,7 +389,7 @@ impl Function {
389389
}
390390

391391
/// A logical term.
392-
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
392+
#[derive(Debug, Clone)]
393393
pub enum Term<V = TermVarIdx> {
394394
Null,
395395
Var(V),
@@ -988,7 +988,7 @@ impl Pred {
988988
}
989989

990990
/// An atom is a predicate applied to a list of terms.
991-
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
991+
#[derive(Debug, Clone)]
992992
pub struct Atom<V = TermVarIdx> {
993993
pub pred: Pred,
994994
pub args: Vec<Term<V>>,
@@ -1081,7 +1081,7 @@ impl<V> Atom<V> {
10811081
/// While it allows arbitrary [`Atom`] in its `Atom` variant, we only expect atoms with known
10821082
/// predicates (i.e., predicates other than `Pred::Var`) to appear in formulas. It is our TODO to
10831083
/// enforce this restriction statically. Also see the definition of [`Body`].
1084-
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
1084+
#[derive(Debug, Clone)]
10851085
pub enum Formula<V = TermVarIdx> {
10861086
Atom(Atom<V>),
10871087
Not(Box<Formula<V>>),
@@ -1300,7 +1300,7 @@ impl<V> Formula<V> {
13001300
}
13011301

13021302
/// The body part of a clause, consisting of atoms and a formula.
1303-
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
1303+
#[derive(Debug, Clone)]
13041304
pub struct Body<V = TermVarIdx> {
13051305
pub atoms: Vec<Atom<V>>,
13061306
/// NOTE: This doesn't contain predicate variables. Also see [`Formula`].

src/rty.rs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ impl FunctionAbi {
118118
/// In Thrust, function types are closed. Because of that, function types, thus its parameters and
119119
/// return type only refer to the parameters of the function itself using [`FunctionParamIdx`] and
120120
/// do not accept other type of variables from the environment.
121-
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
121+
#[derive(Debug, Clone)]
122122
pub struct FunctionType {
123123
pub params: IndexVec<FunctionParamIdx, RefinedType<FunctionParamIdx>>,
124124
pub ret: Box<RefinedType<FunctionParamIdx>>,
@@ -203,7 +203,7 @@ impl FunctionType {
203203
}
204204

205205
/// The kind of a reference, which is either mutable or immutable.
206-
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
206+
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
207207
pub enum RefKind {
208208
Mut,
209209
Immut,
@@ -228,7 +228,7 @@ where
228228
}
229229

230230
/// The kind of a pointer, which is either a reference or an owned pointer.
231-
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
231+
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
232232
pub enum PointerKind {
233233
Ref(RefKind),
234234
Own,
@@ -268,7 +268,7 @@ impl PointerKind {
268268
}
269269

270270
/// A pointer type.
271-
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
271+
#[derive(Debug, Clone)]
272272
pub struct PointerType<T> {
273273
pub kind: PointerKind,
274274
pub elem: Box<RefinedType<T>>,
@@ -381,7 +381,7 @@ impl<T> PointerType<T> {
381381
/// Note that the current implementation uses tuples to represent structs. See
382382
/// implementation in `crate::refine::template` module for details.
383383
/// It is our TODO to improve the struct representation.
384-
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
384+
#[derive(Debug, Clone)]
385385
pub struct TupleType<T> {
386386
pub elems: Vec<RefinedType<T>>,
387387
}
@@ -505,7 +505,7 @@ impl EnumDatatypeDef {
505505
/// An enum type.
506506
///
507507
/// An enum type includes its type arguments and the argument types can refer to outer variables `T`.
508-
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
508+
#[derive(Debug, Clone)]
509509
pub struct EnumType<T> {
510510
pub symbol: chc::DatatypeSymbol,
511511
pub args: IndexVec<TypeParamIdx, RefinedType<T>>,
@@ -607,7 +607,7 @@ impl<T> EnumType<T> {
607607
}
608608

609609
/// A type parameter.
610-
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
610+
#[derive(Debug, Clone)]
611611
pub struct ParamType {
612612
pub idx: TypeParamIdx,
613613
}
@@ -636,7 +636,7 @@ impl ParamType {
636636
}
637637

638638
/// An underlying type of a refinement type.
639-
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
639+
#[derive(Debug, Clone)]
640640
pub enum Type<T> {
641641
Int,
642642
Bool,
@@ -1042,7 +1042,7 @@ impl<T> ShiftExistential for RefinedTypeVar<T> {
10421042
/// A formula, potentially equipped with an existential quantifier.
10431043
///
10441044
/// Note: This is not to be confused with [`crate::chc::Formula`] in the [`crate::chc`] module, which is a different notion.
1045-
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
1045+
#[derive(Debug, Clone)]
10461046
pub struct Formula<V> {
10471047
pub existentials: IndexVec<ExistentialVarIdx, chc::Sort>,
10481048
pub body: chc::Body<V>,
@@ -1283,7 +1283,7 @@ impl<T> Instantiator<T> {
12831283
}
12841284

12851285
/// A refinement type.
1286-
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
1286+
#[derive(Debug, Clone)]
12871287
pub struct RefinedType<FV = Closed> {
12881288
pub ty: Type<FV>,
12891289
pub refinement: Refinement<FV>,

0 commit comments

Comments
 (0)