From 23abf51c5fbfcf8754731fb362c0a2b741b9b7ee Mon Sep 17 00:00:00 2001 From: emile Date: Thu, 30 May 2019 20:53:08 +0200 Subject: [PATCH] xd --- program.py | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/program.py b/program.py index 44ea4e8..d118a00 100644 --- a/program.py +++ b/program.py @@ -30,22 +30,26 @@ class SimpleInterpreter(AbstractInterpreter): prev = formula.s[i-1] if i>0 else None #None, gdy jesteśmy na pierwszym znaku if (char=='(' and isVariable(prev) and prev is not None): #a(b|c) + return False if (prev is None): if not (isVariable(char) or isParentice(char) or isNegation(char)): - return False - if isSign(char): + return False + if isSign(char) and prev is not None: + if (not isNegation(char)): + if isSign(prev) and not isNegation(prev): # tylko negacje mogą się powtarzać po innym znaku return False if isNegation(prev): - + if not (isNegation(char) or isParentice(char)): - print("xd") - return False - if isVariable(prev): #a! - return False + + return False + if isNegation(char): + if isVariable(prev): #a! + return False else: #if current char is a variable if isVariable(prev) and prev is not None: #Obrona abc>d