@@ -280,23 +280,22 @@ def _eliminate_conditionals(self):
280
280
281
281
282
282
def _interpret_formula_tree (tree : lark .Tree ):
283
- match tree .data :
284
- case "start" :
285
- return _interpret_formula_tree (tree .children [0 ])
286
- case "proposition" :
287
- return Proposition (str (tree .children [0 ]))
288
- case "negation" :
289
- return Not (_interpret_formula_tree (tree .children [0 ]))
290
- case "disjunction" :
291
- return Or (_interpret_formula_tree (tree .children [0 ]), _interpret_formula_tree (tree .children [1 ]))
292
- case "conjunction" :
293
- return And (_interpret_formula_tree (tree .children [0 ]), _interpret_formula_tree (tree .children [1 ]))
294
- case "implication" :
295
- return Implies (_interpret_formula_tree (tree .children [0 ]), _interpret_formula_tree (tree .children [1 ]))
296
- case "biconditional" :
297
- return BiImplies (_interpret_formula_tree (tree .children [0 ]), _interpret_formula_tree (tree .children [1 ]))
298
- case "formula" :
299
- return _interpret_formula_tree (tree .children [0 ])
283
+ if tree .data == "start" :
284
+ return _interpret_formula_tree (tree .children [0 ])
285
+ elif tree .data == "proposition" :
286
+ return Proposition (str (tree .children [0 ]))
287
+ elif tree .data == "negation" :
288
+ return Not (_interpret_formula_tree (tree .children [0 ]))
289
+ elif tree .data == "disjunction" :
290
+ return Or (_interpret_formula_tree (tree .children [0 ]), _interpret_formula_tree (tree .children [1 ]))
291
+ elif tree .data == "conjunction" :
292
+ return And (_interpret_formula_tree (tree .children [0 ]), _interpret_formula_tree (tree .children [1 ]))
293
+ elif tree .data == "implication" :
294
+ return Implies (_interpret_formula_tree (tree .children [0 ]), _interpret_formula_tree (tree .children [1 ]))
295
+ elif tree .data == "biconditional" :
296
+ return BiImplies (_interpret_formula_tree (tree .children [0 ]), _interpret_formula_tree (tree .children [1 ]))
297
+ elif tree .data == "formula" :
298
+ return _interpret_formula_tree (tree .children [0 ])
300
299
301
300
302
301
class Formula :
0 commit comments