Currently first-order relations live in a separate space and don't have types associated with them. For example, consider the following code:
clausedef(foo, [], [int, int]).
foo(5, 6).
Intuitively foo is of type relation([int, int]), though currently this is not correct. We may want to consider this to be true. This avoids highly annoying situations where we have to wrap things inside lambda, as with:
clausedef(increment, [], [int, int]).
increment(X, Y) :-
Y is X + 1.
clausedef(incrementList, [], [list(int), list(int)]).
incrementList(List, NewList) :-
% preferable: map(List, increment, NewList).
map(List,
lambda([X, Y], increment(X, Y)),
NewList).
We could also employ currying here, though that may be overkill. To be clear, this situation hasn't come up all too frequently; usually there is at least some change that occurs to at least one of the parameters, which would prevent us from doing this.
Currently first-order relations live in a separate space and don't have types associated with them. For example, consider the following code:
Intuitively
foois of typerelation([int, int]), though currently this is not correct. We may want to consider this to be true. This avoids highly annoying situations where we have to wrap things insidelambda, as with:We could also employ currying here, though that may be overkill. To be clear, this situation hasn't come up all too frequently; usually there is at least some change that occurs to at least one of the parameters, which would prevent us from doing this.