-
Hi, a) GetEmail(name) = x :- Email(name:, email:x); can also be written as b) GetEmail(name) = email :- If I use definition a) I can compile it (%%logica GetEmail) and use the function as a look up as well as "materialize it". Why 2 ways - any significance ? Thanks. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
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:
These two ways are defining different mathematical predicates and are used for different purposes. Another difference is what you pointed out: predicate a) is Predicate b) is not concrete because there is no way to assign Predicate b) is actually doing what's called This is a subtle subject. Let me know if you have further questions. |
Beta Was this translation helpful? Give feedback.
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:
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…