% declaration of append/3 as used in many conventional type systems
:- pred append_old(list(T), list(T), list(T)).
% implicitly converted to :- pred append_old(list(@T1), list(@T2),
list(@T3)) with T1=<T, T2=<T, T3=<T.
% new, more precise declaration, using anchored type parameters and
type constraints
:- pred append (list(T), list(T), list(@T)).
% :- pred append (list(@T1), list(@T2), list(@T3)) with T1=<T3,
T2=<T3.
Keyword | Examples | |
---|---|---|
pred | declaration of a predicate with the genericity condition imposed | |
predl | declaration of a predicate without the genericity condition | meta_sort.pl |
pred_neg | declaration of a negatively defined predicate | overlap.pl |
:- pred_neg disjoint(list(@S),list(@T)) with U=<S, U=<T. | ||
rule | simplified declaration of a DCG grammar rule | dcg.pl |
PREV: Type definition |
NEXT: Predicate declaration examples |