Re: Storing data and code in a Db with LISP-like interface
Date: Wed, 03 May 2006 01:42:17 +0200
Message-ID: <4457ee15$0$31639$e4fe514c_at_news.xs4all.nl>
Neo wrote:
> I will state it again and demo it with examples: dbd's method of
> representing things is more general/flexible/systematic than Prolog in
> a few areas.:
>
> 1) The data represented in a Prolog function's name is not as
> flexible/systematic. It cannot be systematically selected, renamed,
> unnamed, named multiple times, etc as in dbd. In dbd, when representing
> "john like mary", like is a thing just like john and mary and can be
> select via "select john * mary". Please show how in Prolog. ( I see
> below you needed to restructure your orignal script).
No, you got wrong what I did. I just took your statements as specs - can I say in prolog what you say in english? The comments in the script are your texts. Verbatim. I didn't even look at earlier scripts.
> > 2) In Prolog, an atom must be named. Thus creating an unnamed atom is
> impossible and results in situation such as an atom named "un_named".
> So the droid thinks it actual name is "un_named" unless told to ignore
> it, but then what if he meets ups with a thing actually named
> "un_named". Also adding multiple names to an atom is inherently
> different than the first name embedded in the atom. This is
> unsystematic. All names for a things are represented systematically in
> dbd.
Name/reference/designator/pointer - how does one distinguish between two unnamed things - and keep the possiblity open that they might be the same? Prolog does this externally by the anonymous variable, depicted by a single underscore, internally by numbered uninstantiated variables (just try tracing the evaluation of a query).
> 3) Prolog is similar to RM in that new data requirements can impact
> existing schema/scripts more so than dbd. See the example where I
> extended "john likes mary" twice once with "like opposite hate" and
> another time with "reverse similar opposite". In each case it impacted
> the prior prolog script, while it did not affect dbd.
> 4) In Prolog, one cannot add new data/function on the fly (as far as I
> can tell). One must edit the script, recompile it and reload it into
> memory. Ddb can do it on the fly.
?- help(assert).
assert(+Term)
Assert a fact or clause in the database. Term is asserted as the last fact or clause of the corresponding predicate. assert(+Term, -Reference) Equivalent to assert/1, but Reference is unified with a unique reference to the asserted clause. This key can later be used with clause/3 or erase/1.
?- help(clause).
...
%-----------neorel.pro
:-dynamic thing/1.
thing(john). % John is a thing to represent. thing(mary). % Mary is a thing to represent. thing(like). % Like a thing to represent. thing(relationship(john, like, mary)). % The relationship "john like mary" % is a thing to represent.%---------(Queries after consulting neorel.pro) ?- clause(thing(Thing), true).
Thing = john ;
Thing = mary ;
Thing = like ;
Thing = relationship(john, like, mary) ;
No
?- assert(thing(relationship(john, hate, bob))), clause(thing(Thing), true).
Thing = john ;
Thing = mary ;
Thing = like ;
Thing = relationship(john, like, mary) ;
Thing = relationship(john, hate, bob) ;
No
(This time I /did/ use and modify an older script).
>>You might read it as just: Please be specific when stating what you want to know. See below
>
>
> Sometimes the actual examples conveys my thoughts more accurately :)
>
>
>>You had demos of dbd's previous incarnation at a site, but it seems down.
>
>
> I had to relinquish it to the proper owner of the xdb trademark :( and
> was moved to another site which currently doesn't have the version I am
> demo-ing here.
>
>
>>You have created vocabulary of your own - it isn't allways easy to see what needs some translation. I can't read your mind and I did not read all your previous posts. It helps if you are specific about the information needs. I took some of your statements rather literal to bitplumb the following:
>
>
> thing(john). % John is a thing to represent.
> thing(mary). % Mary is a thing to represent.
> thing(like). % Like is a thing to represent.
> thing(relationship(john, like, mary)).
> % The relationship "john like mary"
> % is a thing to represent.
>
> ?- thing(relationship(john, Relator_Verb, mary)). Relator_Verb = like ;
>
>
> Sometimes the best way is to look at the dbd script which shows the
> above is similar but not equivalent. For example, john and mary are
> persons, and person is a thing. Also it does not represent relationship
> which now appears in the prolog code.
Yet you specifically stated that 'the relationship "john like mary" is a thing to represent.' You did't follow that statement in your dbd db? You can't query it about 'relationship'?
> Ok, so now you have restructured your original data to determine the
No I did not.
> relator between john and mary, but now how do I access the
> relator/relationship between john and thing. mary and thing, like and
> thing. What is the relationship/relator between "john, verb, mary" and
> relationship. What is the relator/relationship between thing and
> (relationship(john, like, mary)). At first you will immediately say
> those are obvious.
No I won't. What I will do is ask you to be clearer: I will immediately ask: what, specifically, do you want to know about relator/relationships? Why do you want to know it? Can you give 'real' examples?
> Try replacing them with letters. Also why are
> various things and relationships being reprsented with different
> methods. It is unsystematic and difficult for an AI or driod-like app
> to figure out. Can it use the same rules here on new data? See prior
> post on this very same topic.
>
>
>>> Enter the following relationships in prolog: >>>class (john, person). meaning one of john's class is person >>>instance (person, john). meaning one of person's instance is john >> >>Are you stating the same fact in two ways or are these two facts?
>
>
> Your question is difficult to answer as the word "fact" has no meaning
> in dbd's method of representing things.
Received on Wed May 03 2006 - 01:42:17 CEST