Skip to content

Commit

Permalink
feat: add quantifier entity
Browse files Browse the repository at this point in the history
  • Loading branch information
luisfbl committed Nov 13, 2023
1 parent 2598064 commit dc0c16d
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions src/entity/quantifiers.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
from src.entity.base import Base
from src.entity.operators import *

class Quantifier(Base):
symbol = ''

def __init__(self, expr):
self.expr = expr

self._expr = f'({self.expr})' if isinstance(self.expr, Operator) else str(self.expr)

def __str__(self):
return f'{self.symbol}{self._expr}'

class Universal(Quantifier):
symbol = '∀x'

class Existential(Quantifier):
symbol = '∃x'

quantifiers = {
"Ax": Universal,
"Ex": Existential
}

0 comments on commit dc0c16d

Please sign in to comment.