[pet] PET code changes

Bernd Kiefer kiefer at dfki.de
Mon Jul 13 10:04:38 CEST 2009


Hi Stephan,

when i implemented item-printer, i was tempted to use the same solution,
but decided against it because the majority of printers does not care
about level. For those printers, the additional argument is more 
annoying than helpful.

Speaking of thread-safety, that would be oneof the first parts of cheap
that are thread safe, and besides, thread safety can also be achieved by
using independent item-printer objects, which is intended anyway (that's
why i made them as lightweight as possible).

Sorry, i'm not very happy with this change.

Best,
	Bernd

Stephan Oepen wrote:
> hi bernd,
> 
> to fix the printing of root symbols on derivations, i ended up making a
> relatively invasive change: adding an optional parameter `level' to all
> of the item printer methods.  could you take a look at:
> 
>   http://pet.opendfki.de/changeset/589/pet
> 
> i felt passing the level around as a parameter (rather than using state
> in the various objects) was more transparent and will trivially lead to
> a thread-safe solution.  if you buy into this point of view, one should
> also revise the indentation mechanics now (using the new `level'), and
> probably check that i did not break anything (i mostly cared about the
> interactive and [incr tsdb()] derivations printing).
> 
> in principle this fix (output of root nodes) should be merged into the
> trunk relatively soon.  but please see what you think of these changes
> first :-).
> 
>                                                          best  -  oe
> 
> +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
> +++ Universitetet i Oslo (IFI); Boks 1080 Blindern; 0316 Oslo; (+47) 2284 0125
> +++     CSLI Stanford; Ventura Hall; Stanford, CA 94305; (+1 650) 723 0515
> +++       --- oe at ifi.uio.no; oe at csli.stanford.edu; stephan at oepen.net ---
> +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

-- 
----------------------------------------------------------------------
Bernd Kiefer       DFKI GmbH, Stuhlsatzenhausweg, D-66123 Saarbruecken
kiefer at dfki.de     +49-681/302-5301 (phone)     +49-681/3025338  (fax)
----------------------------------------------------------------------
Deutsches Forschungszentrum fuer Kuenstliche Intelligenz GmbH
Trippstadter Strasse 122, D-67663 Kaiserslautern, Germany
Geschaeftsfuehrung: Prof. Dr. Dr. h.c. mult. Wolfgang Wahlster (Vor-
                     sitzender), Dr. Walter Olthoff
Vorsitzender des Aufsichtsrats: Prof. Dr. h.c. Hans A. Aukes
Amtsgericht Kaiserslautern, HRB 2313



More information about the pet mailing list