Conditions | 6 |
Total Lines | 15 |
Lines | 0 |
Ratio | 0 % |
1 | module PropLogic |
||
16 | |||
17 | def to_nnf |
||
18 | term = @terms[0] |
||
19 | case term |
||
20 | when NotTerm |
||
21 | term.terms[0].to_nnf |
||
22 | when Variable |
||
23 | self |
||
24 | when ThenTerm |
||
25 | (~(term.to_nnf)).to_nnf |
||
26 | when AndTerm |
||
27 | all_or(*term.terms.map{|t| (~t).to_nnf}) |
||
28 | when OrTerm |
||
29 | all_and(*term.terms.map{|t| (~t).to_nnf}) |
||
30 | end |
||
31 | end |
||
71 |