@@ -17,7 +17,7 @@ pub type Fallible<T> = anyhow::Result<T>;
17
17
/// Atomic predicates are the base goals we can try to prove; the rules for proving them
18
18
/// are derived (at least in part) based on the Rust source declarations.
19
19
#[ term]
20
- pub enum AtomicPredicate {
20
+ pub enum Predicate {
21
21
/// True if a trait is fully implemented (along with all its where clauses).
22
22
#[ cast]
23
23
IsImplemented ( TraitRef ) ,
@@ -53,29 +53,29 @@ impl std::ops::BitAnd for Coinductive {
53
53
}
54
54
}
55
55
56
- impl AtomicPredicate {
56
+ impl Predicate {
57
57
/// True if this goal can be proven via a cycle. For example,
58
58
/// it is ok for a `T: Debug` impl to require `T: Debug`.
59
59
pub fn is_coinductive ( & self ) -> Coinductive {
60
60
match self {
61
- AtomicPredicate :: IsImplemented ( _) => Coinductive :: Yes ,
62
- AtomicPredicate :: NormalizesTo ( _, _) => Coinductive :: No ,
63
- AtomicPredicate :: WellFormedAlias ( _, _)
64
- | AtomicPredicate :: WellFormedAdt ( _, _)
65
- | AtomicPredicate :: WellFormedTraitRef ( _) => Coinductive :: Yes ,
61
+ Predicate :: IsImplemented ( _) => Coinductive :: Yes ,
62
+ Predicate :: NormalizesTo ( _, _) => Coinductive :: No ,
63
+ Predicate :: WellFormedAlias ( _, _)
64
+ | Predicate :: WellFormedAdt ( _, _)
65
+ | Predicate :: WellFormedTraitRef ( _) => Coinductive :: Yes ,
66
66
}
67
67
}
68
68
}
69
69
70
70
impl AliasName {
71
- pub fn well_formed ( & self , t : impl Upcast < Vec < Parameter > > ) -> AtomicPredicate {
72
- AtomicPredicate :: WellFormedAlias ( self . clone ( ) , t. upcast ( ) )
71
+ pub fn well_formed ( & self , t : impl Upcast < Vec < Parameter > > ) -> Predicate {
72
+ Predicate :: WellFormedAlias ( self . clone ( ) , t. upcast ( ) )
73
73
}
74
74
}
75
75
76
76
impl AliasTy {
77
- pub fn normalizes_to ( & self , t : impl Upcast < Ty > ) -> AtomicPredicate {
78
- AtomicPredicate :: NormalizesTo ( self . clone ( ) , t. upcast ( ) )
77
+ pub fn normalizes_to ( & self , t : impl Upcast < Ty > ) -> Predicate {
78
+ Predicate :: NormalizesTo ( self . clone ( ) , t. upcast ( ) )
79
79
}
80
80
}
81
81
@@ -113,35 +113,35 @@ pub enum AtomicSkeleton {
113
113
Outlives ,
114
114
}
115
115
116
- impl AtomicPredicate {
116
+ impl Predicate {
117
117
/// Separate an atomic predicate into the "skeleton" (which can be compared for equality using `==`)
118
118
/// and the parameters (which must be related).
119
119
pub fn debone ( & self ) -> ( AtomicSkeleton , Vec < Parameter > ) {
120
120
match self {
121
- AtomicPredicate :: IsImplemented ( TraitRef {
121
+ Predicate :: IsImplemented ( TraitRef {
122
122
trait_id,
123
123
parameters,
124
124
} ) => (
125
125
AtomicSkeleton :: IsImplemented ( trait_id. clone ( ) ) ,
126
126
parameters. clone ( ) ,
127
127
) ,
128
- AtomicPredicate :: NormalizesTo ( AliasTy { name, parameters } , ty) => (
128
+ Predicate :: NormalizesTo ( AliasTy { name, parameters } , ty) => (
129
129
AtomicSkeleton :: NormalizesTo ( name. clone ( ) ) ,
130
130
parameters
131
131
. iter ( )
132
132
. cloned ( )
133
133
. chain ( Some ( ty. to_parameter ( ) ) )
134
134
. collect ( ) ,
135
135
) ,
136
- AtomicPredicate :: WellFormedAdt ( id, parameters) => (
136
+ Predicate :: WellFormedAdt ( id, parameters) => (
137
137
AtomicSkeleton :: WellFormedAdt ( id. clone ( ) ) ,
138
138
parameters. clone ( ) ,
139
139
) ,
140
- AtomicPredicate :: WellFormedAlias ( id, parameters) => (
140
+ Predicate :: WellFormedAlias ( id, parameters) => (
141
141
AtomicSkeleton :: WellFormedAlias ( id. clone ( ) ) ,
142
142
parameters. clone ( ) ,
143
143
) ,
144
- AtomicPredicate :: WellFormedTraitRef ( TraitRef {
144
+ Predicate :: WellFormedTraitRef ( TraitRef {
145
145
trait_id,
146
146
parameters,
147
147
} ) => (
@@ -153,18 +153,18 @@ impl AtomicPredicate {
153
153
}
154
154
155
155
impl TraitRef {
156
- pub fn is_implemented ( & self ) -> AtomicPredicate {
157
- AtomicPredicate :: IsImplemented ( self . clone ( ) )
156
+ pub fn is_implemented ( & self ) -> Predicate {
157
+ Predicate :: IsImplemented ( self . clone ( ) )
158
158
}
159
159
160
- pub fn well_formed ( & self ) -> AtomicPredicate {
161
- AtomicPredicate :: WellFormedTraitRef ( self . clone ( ) )
160
+ pub fn well_formed ( & self ) -> Predicate {
161
+ Predicate :: WellFormedTraitRef ( self . clone ( ) )
162
162
}
163
163
}
164
164
165
165
impl AdtId {
166
- pub fn well_formed ( & self , parameters : impl Upcast < Vec < Parameter > > ) -> AtomicPredicate {
167
- AtomicPredicate :: WellFormedAdt ( self . clone ( ) , parameters. upcast ( ) )
166
+ pub fn well_formed ( & self , parameters : impl Upcast < Vec < Parameter > > ) -> Predicate {
167
+ Predicate :: WellFormedAdt ( self . clone ( ) , parameters. upcast ( ) )
168
168
}
169
169
}
170
170
@@ -253,7 +253,7 @@ impl TraitId {
253
253
#[ term]
254
254
pub enum APR {
255
255
#[ cast]
256
- AtomicPredicate ( AtomicPredicate ) ,
256
+ AtomicPredicate ( Predicate ) ,
257
257
#[ cast]
258
258
AtomicRelation ( AtomicRelation ) ,
259
259
}
@@ -282,9 +282,9 @@ macro_rules! debone_impl {
282
282
}
283
283
284
284
debone_impl ! ( APR ) ;
285
- debone_impl ! ( AtomicPredicate ) ;
285
+ debone_impl ! ( Predicate ) ;
286
286
debone_impl ! ( AtomicRelation ) ;
287
287
288
288
// Transitive casting impls:
289
289
290
- cast_impl ! ( ( TraitRef ) <: ( AtomicPredicate ) <: ( APR ) ) ;
290
+ cast_impl ! ( ( TraitRef ) <: ( Predicate ) <: ( APR ) ) ;
0 commit comments