Re: Transmit free variables via socket -> solved

From: Steffen Mazanek <steffen.mazanek_at_unibw.de>
Date: Tue, 04 Mar 2008 18:10:48 +0100

Thank you, Wolfgang and Michael. showAnyQTerm
is my new best friend :-) Now, I have a curry-based
graph completion server, nice.

2008/3/4, Wolfgang Lux <wlux_at_uni-muenster.de>:
> Hello Steffen!
>
>
> > Hello again,
> >
> > I have successfully set up socket communication
> > between a curry program (using MCC) and a
> > java program. However, in the result computed
> > by the curry server may be free variables. In this
> > case I get a deadlock error in MCC. It would be
> > possible in my scenario to supply a number to
> > uniquely numerate the free variables starting
> > from this particular number. How can this be
> > realized?
> >
> > For instance, I might get the following result
> > from my curry program:
> >
> > [(1,_a),(_a,2),(_b,_c)]
> >
> > This is a graph (as an edge list) where some
> > nodes are not instantiated. Given a number
> > n=5 as the next free node number I would
> > like to submit something like the following
> > as a result:
> >
> > [(1,5),(5,2),(6,7)]
> >
> > At the moment, I only submit the head of
> > the findall result list. Is it possible to filter
> > the results of findall such that only
> > completely instantiated terms remain?
>
>
>
> As Michael already already answered, you could use Unsafe.isVar
> for that purpose.
>
> MCC's Unsafe module currently lacks showAnyQTerm and friends, but
> you can define showAnyQTerm yourself as follows:
>
> showAnyQTerm:: a -> String
> showAnyQTerm x = (dvals $!! x) ""
> where foreign import primitive dvals :: a -> ShowS
>
> This definition makes use of one of MCC's internal primitives. Don't
> worry that this primitive is undocumented. It is used by MCC's
> declarative
> debugger and therefore supposed to stay.
>
> Regards
>
> Wolfgang
>
>


-- 
Dipl.-Inform. Steffen Mazanek
Institut für Softwaretechnologie
Fakultät Informatik
Universität der Bundeswehr München
85577 Neubiberg
Tel: +49 (0)89 6004-2505
Fax: +49 (0)89 6004-4447
E-Mail: steffen.mazanek_at_unibw.de
_______________________________________________
curry mailing list
curry_at_lists.RWTH-Aachen.DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/curry
Received on Mi Mär 05 2008 - 08:47:19 CET

This archive was generated by hypermail 2.3.0 : Do Jun 20 2024 - 07:15:09 CEST