H
Hendrik Maryns
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hi folks,
I’d appreciate some input on a design problem I’m having trouble with.
I have a class CompactFunction, which is basically an implementation of
an MDD (Multi-Valued Decision Diagram), a generalisation of a BDD
(http://en.wikipedia.org/wiki/Binary_decision_diagram). This is
expanded to model non-determinism, with a whole bunch of methods that
make it suitable for modelling the transition function of a tree automaton.
The class Automaton models, guess what, an automaton. It is immutable.
(I like immutability, it helps keeping an overview.) Since it contains
a function, which can be asked for, CompactFunction should be immutable too.
OTOH, I want to be able to create this function step-by-step, adding
transitions one after the other. This is needed for some manipulations
(determinisation, minimisation), and to offer a way to create initial
functions in the first place. Until now, I had a CompactFunctionBuilder
for this. It builds a decision tree from the transitions it gets, and
reduces that tree when getFunction() is invoked.
However, my preliminary implementation of reduction has an error, which
makes a reduction of the function that has been built necessary. The
problem is the following: no function builder is used here, since
transitions are not computed one by one, but based on the graph
structure of MDD. However, reduction is implemented in the builder.
This leads me to think I should get rid of the builder class and put the
reduction logic in the function itself. But then I would have to allow
adding single transitions too, which would loose the immutability of the
CompactFunction class.
And here’s my query, for anyone so kind to read this far: what would be
the right way to go here?
- - implement the reduction in CompactFunction too (sort of duplicating
most of the work of the builder), and keeping the builder
- - make CompactFunction mutable, providing some sort of protection if one
asks for an automaton’s function (mind that an MDD is a graph, so
copying is complicated and expensive), getting rid of the builder
- - other suggestions?
I’d be happy to clarify if things are too vague.
Thanks,
H.
- --
Hendrik Maryns
http://tcl.sfs.uni-tuebingen.de/~hendrik/
==================
http://aouw.org
Ask smart questions, get good answers:
http://www.catb.org/~esr/faqs/smart-questions.html
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (GNU/Linux)
iD8DBQFF5bzCe+7xMGD3itQRAhJtAJ4nmA6TonYWfmeif6J92eIoqfAahwCdERDw
ujXE+dAnjPTjhQsKHpEJX/w=
=6kkB
-----END PGP SIGNATURE-----
Hash: SHA1
Hi folks,
I’d appreciate some input on a design problem I’m having trouble with.
I have a class CompactFunction, which is basically an implementation of
an MDD (Multi-Valued Decision Diagram), a generalisation of a BDD
(http://en.wikipedia.org/wiki/Binary_decision_diagram). This is
expanded to model non-determinism, with a whole bunch of methods that
make it suitable for modelling the transition function of a tree automaton.
The class Automaton models, guess what, an automaton. It is immutable.
(I like immutability, it helps keeping an overview.) Since it contains
a function, which can be asked for, CompactFunction should be immutable too.
OTOH, I want to be able to create this function step-by-step, adding
transitions one after the other. This is needed for some manipulations
(determinisation, minimisation), and to offer a way to create initial
functions in the first place. Until now, I had a CompactFunctionBuilder
for this. It builds a decision tree from the transitions it gets, and
reduces that tree when getFunction() is invoked.
However, my preliminary implementation of reduction has an error, which
makes a reduction of the function that has been built necessary. The
problem is the following: no function builder is used here, since
transitions are not computed one by one, but based on the graph
structure of MDD. However, reduction is implemented in the builder.
This leads me to think I should get rid of the builder class and put the
reduction logic in the function itself. But then I would have to allow
adding single transitions too, which would loose the immutability of the
CompactFunction class.
And here’s my query, for anyone so kind to read this far: what would be
the right way to go here?
- - implement the reduction in CompactFunction too (sort of duplicating
most of the work of the builder), and keeping the builder
- - make CompactFunction mutable, providing some sort of protection if one
asks for an automaton’s function (mind that an MDD is a graph, so
copying is complicated and expensive), getting rid of the builder
- - other suggestions?
I’d be happy to clarify if things are too vague.
Thanks,
H.
- --
Hendrik Maryns
http://tcl.sfs.uni-tuebingen.de/~hendrik/
==================
http://aouw.org
Ask smart questions, get good answers:
http://www.catb.org/~esr/faqs/smart-questions.html
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (GNU/Linux)
iD8DBQFF5bzCe+7xMGD3itQRAhJtAJ4nmA6TonYWfmeif6J92eIoqfAahwCdERDw
ujXE+dAnjPTjhQsKHpEJX/w=
=6kkB
-----END PGP SIGNATURE-----