Hello,<br><br>I am trying to define a logical calculus using one data
type for the rules. There are three types of rules and each has 0,1 or
2 assumptions (rule, rule1 and rule2 below). I have defined all the
rules as different constructors so the difference between the types
according to 0,1 or 2 assumptions is very weak. I would still like to
be able to group the rules in types according to the number of
assumptions in order to use pattern matching. Is there a simple way to
do that or another way I should implement the data type such that I can
refer to the rules both according to their number of assumptions and
according to their type?<br>
<br>&nbsp; 27 data Rule = Axiom {lowseq :: Sequent}<br>&nbsp; 28&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; | WeakeningL {rule :: Rule, lowseq :: Sequent, foccur :: FormulaOccur}<br>&nbsp; 29&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; | WeakeningR {rule :: Rule, lowseq :: Sequent, foccur :: FormulaOccur}<br>


&nbsp; 30&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; | ContractionL {rule :: Rule, lowseq :: Sequent, foccur :: FormulaOccur}<br>&nbsp; 31&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; | ContractionR {rule :: Rule, lowseq :: Sequent, foccur :: FormulaOccur}<br>&nbsp; 32&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; | PermutationL {rule :: Rule, lowseq :: Sequent}<br>


&nbsp; 33&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; | PermutationR {rule :: Rule, lowseq :: Sequent}<br>&nbsp; 34&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; | Mix {rule1 :: Rule, rule2 :: Rule, lowseq :: Sequent, foccur :: FormulaOccur}<br>&nbsp; 35&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; | NotL {rule :: Rule, lowseq :: Sequent, foccur :: FormulaOccur}<br>


&nbsp; 36&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; | NotR {rule :: Rule, lowseq :: Sequent, foccur :: FormulaOccur}<br>&nbsp; 37&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; | AndL {rule1 :: Rule, rule2 :: Rule, lowseq :: Sequent, foccur :: FormulaOccur}<br>&nbsp; 38&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; | AndR {rule1 :: Rule, rule2 :: Rule, lowseq :: Sequent, foccur :: FormulaOccur}<br>


&nbsp; 39&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; deriving (Eq, Show) <br><br>Thanks,<br><font color="#888888"><font color="#888888">Tomer</font>
</font>