Advertisement
Guest User

LO

a guest
Nov 15th, 2019
125
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.10 KB | None | 0 0
  1. from string import ascii_uppercase as alphabet
  2.  
  3. consts = ['a', 'b', 'c', 'd', 'e']
  4.  
  5. variables = list(alphabet)
  6.  
  7. functions = ['f', 'g', 'h', 'i', 'j',
  8.              'k', 'l', 'm', 'n'
  9.              ]
  10.  
  11. predicts = ['p', 'q', 'r', 's',
  12.             't', 'u', 'v', 'w',
  13.             'x', 'y', 'z'
  14.             ]
  15.  
  16. operators = ['NOT', '~', '¬',
  17.              'AND', '&', '∧',
  18.              'OR,' '|', '∨',
  19.              'IMPLIES', '→',
  20.              'IFF', '↔',
  21.              'XOR', '⊕'
  22.              ]
  23.  
  24. quantifiers = ['FORALL', '∀',
  25.                'EXISTS', '∃',
  26.                ]
  27.  
  28. symbolics = []
  29. # symbolics.extend(consts)
  30. # symbolics.extend(variables)
  31. symbolics.extend(functions)
  32. symbolics.extend(predicts)
  33. symbolics.extend(operators)
  34. symbolics.extend(quantifiers)
  35.  
  36. def handleFunctions(function):
  37.     pass
  38.  
  39. def eval(expression):
  40.     tokens = expression.replace('/', ' ').split()
  41.     print(tokens)
  42.  
  43.     stack = []
  44.  
  45.     for token in tokens:
  46.         pass
  47.  
  48.  
  49.  
  50.  
  51.  
  52. # print(consts)
  53. # print(variables)
  54. # print(predicts)
  55. # print(operators)
  56. print(symbolics)
  57.  
  58. eval('Z Z p/1 EXISTS')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement