Re: "dict"ionary typing?
"Richard A. O'Keefe" <[email protected]>
| Newsgroups | gmane.comp.ai.prolog.swi |
|---|---|
| Message-ID | <[email protected]> |
On 12/12/2013, at 3:06 PM, Shon Feder wrote: > > What I was trying to suggest -- albeit with too much verbiage, too little clarity, and, doubtless, too many errors -- was that Russell's concept of a "descriptive function" might be a good fit here. The concept of "function" usually appealed to in computing is Dana Scott's. If we want a *logic* programming language with functions, there's HiLog. http://en.wikipedia.org/wiki/HiLog > To recap, 'father of x' is a "descriptive function" I presume you mean "father" rather than "father of x"; the latter is either not a function at all but a designator for a person, or else (in Montague semantics) a function from world, time, &c to a person. > If you would be willing to oblige, I could use some clarification on your remark about the relation between a "declaration based preprocessor" and unadulterated runtime semantics. Supposing we have (using Ciao notation, but we could use Michael's or Carlo's) > > father_of(enoch, cain). > brother_of(able, cain). > uncle_of(Y, X) :- brother_of( ~father_of(Y), X). > > And the last clause gets expanded to > > uncle_of(Y, X) :- father_of(Y, Z), brother_of(Y, X). > > Is this for some reason detrimental to the runtime semantics in a way that it wouldn't be if `father_of/2` were declared as you suggested? I'm a little confused here because Enoch was neither the father nor the son of cain. There's Enosh who was the father of Kenan, but we have no reason to believe that Kenan had a brother called Able. In a declaration-based semantics you would define :- func father/1. uncle(Uncle, Nephew) :- brother(Uncle, father(Nephew)). You don't need a weird wiggle operator. (There's an apparent ambiguity with the wiggle operator; is it "eval" or "apply"?) The point of the declaration-based approach is to eliminate functional syntax entirely at "compile" time so that it has only "static" semantics, not "dynamic" semantics. With something like brother_of(~father_of(Y), X) there is a worry about T =.. [~,father_of(Y)], brother_of(T, X) Maybe we should all go and read the HiLog documentation.