@@ -245,6 +245,14 @@ pub type Obligations<'tcx, O> = Vec<Obligation<'tcx, O>>;
245
245
pub type PredicateObligations < ' tcx > = Vec < PredicateObligation < ' tcx > > ;
246
246
pub type TraitObligations < ' tcx > = Vec < TraitObligation < ' tcx > > ;
247
247
248
+ /// The following types:
249
+ /// * `WhereClauseAtom`
250
+ /// * `DomainGoal`
251
+ /// * `Goal`
252
+ /// * `Clause`
253
+ /// are used for representing the trait system in the form of
254
+ /// logic programming clauses. They are part of the interface
255
+ /// for the chalk SLG solver.
248
256
#[ derive( Clone , Copy , PartialEq , Eq , Hash , Debug ) ]
249
257
pub enum WhereClauseAtom < ' tcx > {
250
258
Implemented ( ty:: TraitPredicate < ' tcx > ) ,
@@ -270,6 +278,7 @@ pub enum QuantifierKind {
270
278
271
279
#[ derive( Clone , PartialEq , Eq , Hash , Debug ) ]
272
280
pub enum Goal < ' tcx > {
281
+ // FIXME: use interned refs instead of `Box`
273
282
Implies ( Vec < Clause < ' tcx > > , Box < Goal < ' tcx > > ) ,
274
283
And ( Box < Goal < ' tcx > > , Box < Goal < ' tcx > > ) ,
275
284
Not ( Box < Goal < ' tcx > > ) ,
@@ -289,8 +298,11 @@ impl<'tcx> From<DomainGoal<'tcx>> for Clause<'tcx> {
289
298
}
290
299
}
291
300
301
+ /// This matches the definition from Page 7 of "A Proof Procedure for the Logic of Hereditary
302
+ /// Harrop Formulas".
292
303
#[ derive( Clone , PartialEq , Eq , Hash , Debug ) ]
293
304
pub enum Clause < ' tcx > {
305
+ // FIXME: again, use interned refs instead of `Box`
294
306
Implies ( Vec < Goal < ' tcx > > , DomainGoal < ' tcx > ) ,
295
307
DomainGoal ( DomainGoal < ' tcx > ) ,
296
308
ForAll ( Box < ty:: Binder < Clause < ' tcx > > > ) ,
0 commit comments