Re: dynamic programming

Kilián Imre <[email protected]>
Newsgroups gmane.comp.ai.prolog.swi
Organization Univ Pécs/Informatika
Message-ID <[email protected]>
> > if I add a new clause from a module x to a dynamic module, let say:
> > 
> > assert((a:b:-c)).
> 
> 1#. You should be writing assert(a:(b :- c)).
> 2#. Some people prefer a:assert((b :- c)).

Thank you for your comment... 1# I had tried out something similar, it might have been my mistake, but now it works!

#2. The problem is, that the module name is a parameter.
Congratulations for the implementor! X=a, X:assert((b:-c)) works!

> > In my opinion the implementation of assert should notice, if right hand calls are made to the same module where the clause is placed (in our case 'a'),
> You are asking for the impossible.  For one thing,
> when you write assert((a:b :- c)) you are *specifying* that
> the right hand calls are *NOT* made to the module 'a'.

I am another opinion: I expect "assert((H:-B)), clause(H,B)" to work invariably under each circumstances. Just because of your explanation below: if I dont specify module prefix for call c, than it should take the default one, that is "a"...

> 
> > and optimize eventual chained ":" operators out...
> 
> If any Prolog system sees a:x:c as a goal, it is at liberty
> to generate whatever executable code it likes as like as it
> has the same effect, just as seeing X is 1 + 1 it is allowed
> to compile code for X is 2.

But again thankx for the comments! 

yours:

-- 
Kilián Imre/Univ.Pécs Informatics
<[email protected]>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.