Projekt_Logika_1/logic_formula_checker/types.py
2018-06-07 10:44:41 +02:00

28 lines
758 B
Python
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import string
class SentenceVariable(object):
symbols = string.ascii_lowercase
class SupportSign(object):
symbols_open = ['[', '{', '(']
symbols_close = [']', '}', ')']
symbols = symbols_open + symbols_close
@classmethod
def get_closed_symbol(cls, open_symbol):
return cls.symbols_close[cls.symbols_open.index(open_symbol)]
class SentenceConjunction(object):
symbols_conjunction = ['.', '*', '&', '', 'AND']
symbols_alternative = ['+', '', 'A', 'OR']
symbols_implication = ['', '', '']
symbols_equivalence = ['', '', '']
symbols = symbols_conjunction + symbols_alternative + symbols_implication + symbols_implication
class Negation(object):
symbols = ['!', '¬', '˜']