Skip to content
Discussion options

You must be logged in to vote

Hello!

The fact that a) can be rendered and b) can't is irrelevant to them being written as functions. It would work the same way if they were regular predicates:

GetEmailA(name:, email:) :- Email(name:, email:);
GetEmailB(name:, email:) :-
  email AnyValue= (x :- Email(name:, email: x));

These two ways are defining different mathematical predicates and are used for different purposes.
Predicate a) is finite, it has as many rows as original Email table.
Predicate b) is mathematically infinite it has as many rows as there are names, for each name that's in the original Email table having one of emails of the person and for each name that's not in the original table having null value.

Anot…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by jedi1992
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants