Re: Which Prolog implementation works with Microsoft .NET?

From: Mary Kroening (http://www.amzi.com/company/contact.htm)
Date: 06/18/04

  • Next message: name: "examples of websites employing prolog"
    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.


  • Next message: name: "examples of websites employing prolog"

    Relevant Pages

    • Re: Which Prolog implementation works with Microsoft .NET?
      ... > that there is little consensus on the APIs. ... Any bi-directional interface between prolog and OOP Language has to ... technique to mange the life cycle of the instances. ...
      (comp.lang.prolog)
    • Re: Function prologs emitted by VC++ compiler
      ... see ebp being used as a frame pointer reliably. ... there is no hard guarantee that ebp will be used as a frame ... InterlockedIncrementwhere the prolog is optimized away and the ... When do compilers decide to do such prolog optimizations. ...
      (microsoft.public.win32.programmer.kernel)
    • Re: Possible to register a foreign function dynamically?
      ... Passing data from VB to the DLL written in V.Prolog is direct and retrieving data is quite simple thanks to 2 primitives; one allowing to get a pointer to a string and another allowing to move a block of memory. ... The first one has been allocated by vb, the second has been computed by Prolog. ... getdummystring_vb (vbstring) ' calls prolog "predicate" ...
      (comp.lang.prolog)
    • Re: Possible to register a foreign function dynamically?
      ... PL_get_atom_charsprovides a pointer to the actual string that is ... part of the Prolog atom. ... sum += ord&0xFF ...
      (comp.lang.prolog)
    • Re: Question about memory and Garbage Collection, usage of SAUV_REGISTR and MOVERSU
      ... I´m able to allocate my memory and I build a table as a replacment for ... I can find the Adress Pointer to the ROMPTR ... Pointer + 10 for prolog and the size everything works fine, ...
      (comp.sys.hp48)