Re: Which Prolog implementation works with Microsoft .NET?
From: Mary Kroening (http://www.amzi.com/company/contact.htm)
Date: 06/18/04
- Previous message: Nick Wedd: "Re: Little problem please help"
- In reply to: G. Wang: "Re: Which Prolog implementation works with Microsoft .NET?"
- Next in thread: Mary Kroening: "Re: Which Prolog implementation works with Microsoft .NET?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Fri, 18 Jun 2004 12:23:19 -0400
"G. Wang" <visionsoft@hotmail.com> wrote in message
news:59199ce9.0406081050.14025616@posting.google.com...
> >
> > I am aware of several uncoordinated efforts to
> > enable mixed Java+Prolog programming, and regret
> > that there is little consensus on the APIs.
> >
> > ...
> > I'm not yet aware of any reason why an embedding
> > of Prolog in .NET need look any different to one
> > into Java (I'm not proposing JPL's API as a model)
> >
>
> Any bi-directional interface between prolog and OOP Language has to
> address some, if not all, of the following issues:
>
> 1. How to bound prolog variables to an "instance" of an object defined
> in OOP Language?
> 2. How to make sure that the bounding does not interfere with the
> memory/life cycle management of the object defined & implemented in
> OOP Language or runtime environment?
> 3. How to call a method of the instance bounded to a prolog variable?
> How do we make sure that the prolog calling code has the right method
> call signature?
> 4. How would prolog "interrogate" the instance of an object defined in
> OOP Language to find its true type and perform type conversions? This
> relates to the core idea of OOA/OOP: polymorphism.
> 5. Can prolog create an instance of an object defined by the OOP
> Language?
> 6. Can prolog define an object that both prolog and OOP can use as if
> the object was defined in the OOP Language?
>
> Some observations about Point #2:
>
> .NET runtime and JVM perform garbage collection, and can move an
> instance around anytime it likes.
>
> C++ could allocate an instance on the heap and uses some smart pointer
> technique to mange the life cycle of the instances.
>
> Some observations about Point #5 and #6:
>
> These two are nice-to-have feature. Point #6 probably has very high
> technical challenge.
When you create an extended predicate in Amzi! you can pass a pointer that
could be used to represent an instance of a .NET object. This would let you
bind an extended predicate to that instance.
However, you would need to build into the extended predicate the checks to
make sure that object pointer is properly maintained under .NET.
In general, we recommend that you build application specific Prolog and .NET
objects. For example, if you have an application that prices shipments, you
would have
a ship object. You set the attributes of that object, then query for the
shipping
options and prices.
As for binding, if you can get a memory pointer to a .NET object, you can
bind it to a
Prolog integer. Then you can pass that Prolog variable around as needed,
including to
extended predicates that could use that variable to call methods for that
object. We've done
this with C++ and Delphi, but I haven't tried it from .NET.
Mary Kroening
Amzi! inc.
- Previous message: Nick Wedd: "Re: Little problem please help"
- In reply to: G. Wang: "Re: Which Prolog implementation works with Microsoft .NET?"
- Next in thread: Mary Kroening: "Re: Which Prolog implementation works with Microsoft .NET?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|