This is certainly an interesting question. Your data structure is similar to a finite automata, basically a "state" (or node) is a key in the graph; the nesting represents the edge, and the values of the keys represents the label of the edge (transition predicate). A DFA is just a graph, although many applications represent them as adjacency matrices.

But if you admit some constraints to what it means to "minimize" or "reduce" your data structure, you may rightly be able to apply some technique of DFA minimization; and in fact leverage all of the other neat concepts attached to FA (again they are just graphs with labeled edges and some notion of a start state and 0 or more end states).

(update) and yes, this is a "compression" type algorthm for using the structure as a truth table. But, an interesting and maybe counter intuitive effect of this compress or minimization, is that the more "dense" a DFA is, the more unweildy the results of reducing it to an equivalent "regular expression" becomes (not the same as the Perl kind, but language description nonetheless). There are algorithms to do this, but they'e far above my paygrade :-)

In reply to Re: Augmenting and reducing data structures by perlfan
in thread Augmenting and reducing data structures by sciurius

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.