Re: Storing data and code in a Db with LISP-like interface
Date: Thu, 27 Apr 2006 09:24:56 +0200
Message-ID: <4450718b$0$31643$e4fe514c_at_news.xs4all.nl>
Neo wrote:
>>... I thought: /this/ is much easier in prolog.
>
> Prolog is definitely more compact. We will soon see (next extension of
> example) if it's compactness will allow it to represent anything.
>
>
>>>If "likes (john, apple1)" implies "john likes apple1" >>>why isn't "john isa person" written as "isa (john, person)" >>>or is "person (john)" an alternate/equivalent method? >> >>Re-engineering your program forced me to do some interpretation.
>
>
> :) I think re-engineering is too strong a word here.
Do you have a better word for looking at one implementation and providing another without having an implementation-independent problem-statement?
> It is like calling
> the local gas attendant a fuel transfer engineer.
Ok. Bitplumbing. :-)
> For example,
> representing the things is verbose but very systematic with dbd. With
> Prolog, representing the same things is more compact and there might be
> several ways. With RM, representing the same things can result in a
> wide variety of schemas by different "engineers".
This is not a RM-specific phenomenon.
Given a protocol (a list of inputs/outputs), the algorithm to
get from the input to the output is indetermined: There
is an indefine number of algorithms satisfying the protocol.
>>>[ person (john) ] how does one determine the name of the relationship
>>>via code?
There is no how, because I did not provide a name for this relationship.
>>"person(john)." looked to me as a reasonable prolog representation for
>>"john isa person". It may be that there are some subtleties
>>in "isa" it did not catch. You might provide some tests.
>
>
> For example in dbd, it is possible for the app to determine the name of
> that relationship between john and person.
Because you provided a name for it. Was that necessary? For what?
> A relationship is just
> another thing that is represented in the db.
>
> The following displays "class"
> (msgbox (and (select verb instance *) (select john * person)))
>
> And the following display "instance"
> (msgbox (and (select verb instance *) (select person * john)))
>
> How would one do this in Prolog?
Why?
[snip] I have to go now. Received on Thu Apr 27 2006 - 09:24:56 CEST