- #1
- 1,207
- 464
- TL;DR Summary
- How to internally represent string of and's and or's
I have an analysis program. (It's MCNP if it makes any difference.) Part of the input is to specify the surfaces of a cell in a string of "this side of surface x" and "that side of surface y" entries. It looks a little something like this.
((a b):(c -d)):(f -g))
So the : means "or" and otherwise it's "and". So this example is
{(outside a and outside b ) or (outside c and inside d) } or (outside f and inside g)
So my question is, is there a standard way of internally representing such strings of combinations of and's and or's? I'm thinking possibly some kind of tree structure? This seems like it should be one of those "standard questions" that gets asked all the time.
((a b):(c -d)):(f -g))
So the : means "or" and otherwise it's "and". So this example is
{(outside a and outside b ) or (outside c and inside d) } or (outside f and inside g)
So my question is, is there a standard way of internally representing such strings of combinations of and's and or's? I'm thinking possibly some kind of tree structure? This seems like it should be one of those "standard questions" that gets asked all the time.
Last edited: