| Alexei A. Morozov 2004-07-14, 3:59 pm |
| Hi, All
> The closest idea to this, is "design by contract". But that's only a
> small part of what a logical language could do!
I think that you are right. I feel a deep link between the imperative
programming design-by-contract concept and the logic programming too.
But I would add the following notes:
1) I suppose, that one should associate design-by-contract with the
object-oriented logic programming, but not with the plain one. A goal
that checks the state of logical object is very similar to the logical
invariant in the design-by-contract concept. Moreover, one can
consider the clauses being invoked from external objects as a rules
that consist of preconditions, actions, and postconditions. But
actually all these parts are the usual sub-goals of the clauses. So,
logic language could implement the design-by-contract concept in a
more elegant and consistent way. It's an area for future research.
2) Design-by-contract, I suppose, is a concept that was added to
existing technology of imperative programming. So, one can write
programs without the design-by-contract method, and it is a weakness
of this idea. In contrast to this, logic programmer thinks in the
terms of logical check. So, logic programming may give more
straightforward implementation of the idea of logical contracts.
> The flat structure of Prolog mean it doesn't scale up easily, the built-in
> search with backtracking is only really effective on small examples, it
> doesn't handle interaction at all well.
Yes, it is a problem and the object-oriented concept can solve it.
> A good type system is far more effective, but Prolog is untyped.
Yes, I suppose that any modern logic language should support type
declarations. Actually, there are a lot of typed logic languages now.
Another question is what method of inserting type declarations into
logic programming is the best one.
Sincerely yours,
Alexei A. Morozov
Senior Researcher, Ph.D.
Institute of Radio Engineering and Electronics RAS
http://www.cplire.ru/Lab144/
|