# Generated from UVL.g4 by ANTLR 4.9
# encoding: utf-8
from antlr4 import *
from io import StringIO
import sys
if sys.version_info[1] > 5:
	from typing import TextIO
else:
	from typing.io import TextIO


def serializedATN():
    with StringIO() as buf:
        buf.write("\3\u608b\ua72a\u8133\ub9ed\u417c\u3be7\u7786\u5964\3\32")
        buf.write("\u00b1\4\2\t\2\4\3\t\3\4\4\t\4\4\5\t\5\4\6\t\6\4\7\t\7")
        buf.write("\4\b\t\b\4\t\t\t\4\n\t\n\4\13\t\13\4\f\t\f\4\r\t\r\4\16")
        buf.write("\t\16\4\17\t\17\4\20\t\20\4\21\t\21\4\22\t\22\4\23\t\23")
        buf.write("\4\24\t\24\4\25\t\25\3\2\5\2,\n\2\3\2\3\2\5\2\60\n\2\3")
        buf.write("\3\3\3\3\3\3\3\3\3\3\4\3\4\3\4\7\4:\n\4\f\4\16\4=\13\4")
        buf.write("\3\4\5\4@\n\4\3\5\3\5\3\5\7\5E\n\5\f\5\16\5H\13\5\3\5")
        buf.write("\5\5K\n\5\3\6\3\6\5\6O\n\6\3\6\5\6R\n\6\3\7\3\7\7\7V\n")
        buf.write("\7\f\7\16\7Y\13\7\3\7\3\7\3\b\3\b\3\b\3\b\3\b\7\bb\n\b")
        buf.write("\f\b\16\be\13\b\3\b\3\b\5\bi\n\b\3\t\3\t\3\t\3\t\3\t\5")
        buf.write("\tp\n\t\3\n\3\n\3\13\3\13\3\f\3\f\3\r\3\r\3\r\3\r\5\r")
        buf.write("|\n\r\7\r~\n\r\f\r\16\r\u0081\13\r\3\r\3\r\3\16\3\16\3")
        buf.write("\16\3\16\3\16\5\16\u008a\n\16\3\17\3\17\3\17\3\20\3\20")
        buf.write("\3\20\3\20\3\21\3\21\3\21\3\21\3\22\3\22\3\22\3\22\3\23")
        buf.write("\3\23\3\23\3\23\3\24\3\24\3\24\7\24\u00a2\n\24\f\24\16")
        buf.write("\24\u00a5\13\24\3\24\3\24\3\25\3\25\3\25\5\25\u00ac\n")
        buf.write("\25\3\25\5\25\u00af\n\25\3\25\2\2\26\2\4\6\b\n\f\16\20")
        buf.write("\22\24\26\30\32\34\36 \"$&(\2\4\3\3\32\32\3\2\23\26\2")
        buf.write("\u00b1\2+\3\2\2\2\4\61\3\2\2\2\6\66\3\2\2\2\bA\3\2\2\2")
        buf.write("\nL\3\2\2\2\fW\3\2\2\2\16h\3\2\2\2\20j\3\2\2\2\22q\3\2")
        buf.write("\2\2\24s\3\2\2\2\26u\3\2\2\2\30w\3\2\2\2\32\u0089\3\2")
        buf.write("\2\2\34\u008b\3\2\2\2\36\u008e\3\2\2\2 \u0092\3\2\2\2")
        buf.write("\"\u0096\3\2\2\2$\u009a\3\2\2\2&\u009e\3\2\2\2(\u00a8")
        buf.write("\3\2\2\2*,\5&\24\2+*\3\2\2\2+,\3\2\2\2,-\3\2\2\2-/\5\4")
        buf.write("\3\2.\60\5\30\r\2/.\3\2\2\2/\60\3\2\2\2\60\3\3\2\2\2\61")
        buf.write("\62\7\3\2\2\62\63\7\31\2\2\63\64\5\6\4\2\64\65\7\32\2")
        buf.write("\2\65\5\3\2\2\2\66?\5\n\6\2\67;\7\31\2\28:\5\b\5\298\3")
        buf.write("\2\2\2:=\3\2\2\2;9\3\2\2\2;<\3\2\2\2<>\3\2\2\2=;\3\2\2")
        buf.write("\2>@\t\2\2\2?\67\3\2\2\2?@\3\2\2\2@\7\3\2\2\2AJ\5\26\f")
        buf.write("\2BF\7\31\2\2CE\5\6\4\2DC\3\2\2\2EH\3\2\2\2FD\3\2\2\2")
        buf.write("FG\3\2\2\2GI\3\2\2\2HF\3\2\2\2IK\t\2\2\2JB\3\2\2\2JK\3")
        buf.write("\2\2\2K\t\3\2\2\2LN\5\f\7\2MO\5\16\b\2NM\3\2\2\2NO\3\2")
        buf.write("\2\2OQ\3\2\2\2PR\7\27\2\2QP\3\2\2\2QR\3\2\2\2R\13\3\2")
        buf.write("\2\2ST\7\23\2\2TV\7\4\2\2US\3\2\2\2VY\3\2\2\2WU\3\2\2")
        buf.write("\2WX\3\2\2\2XZ\3\2\2\2YW\3\2\2\2Z[\7\23\2\2[\r\3\2\2\2")
        buf.write("\\i\7\5\2\2]^\7\6\2\2^c\5\20\t\2_`\7\7\2\2`b\5\20\t\2")
        buf.write("a_\3\2\2\2be\3\2\2\2ca\3\2\2\2cd\3\2\2\2df\3\2\2\2ec\3")
        buf.write("\2\2\2fg\7\b\2\2gi\3\2\2\2h\\\3\2\2\2h]\3\2\2\2i\17\3")
        buf.write("\2\2\2jo\5\22\n\2kl\7\t\2\2lm\5\24\13\2mn\7\t\2\2np\3")
        buf.write("\2\2\2ok\3\2\2\2op\3\2\2\2p\21\3\2\2\2qr\7\23\2\2r\23")
        buf.write("\3\2\2\2st\t\3\2\2t\25\3\2\2\2uv\7\22\2\2v\27\3\2\2\2")
        buf.write("wx\7\n\2\2x\177\7\31\2\2y{\5\32\16\2z|\7\27\2\2{z\3\2")
        buf.write("\2\2{|\3\2\2\2|~\3\2\2\2}y\3\2\2\2~\u0081\3\2\2\2\177")
        buf.write("}\3\2\2\2\177\u0080\3\2\2\2\u0080\u0082\3\2\2\2\u0081")
        buf.write("\177\3\2\2\2\u0082\u0083\t\2\2\2\u0083\31\3\2\2\2\u0084")
        buf.write("\u008a\5\34\17\2\u0085\u008a\5\36\20\2\u0086\u008a\5 ")
        buf.write("\21\2\u0087\u008a\5\"\22\2\u0088\u008a\5$\23\2\u0089\u0084")
        buf.write("\3\2\2\2\u0089\u0085\3\2\2\2\u0089\u0086\3\2\2\2\u0089")
        buf.write("\u0087\3\2\2\2\u0089\u0088\3\2\2\2\u008a\33\3\2\2\2\u008b")
        buf.write("\u008c\7\13\2\2\u008c\u008d\7\23\2\2\u008d\35\3\2\2\2")
        buf.write("\u008e\u008f\7\23\2\2\u008f\u0090\7\f\2\2\u0090\u0091")
        buf.write("\7\23\2\2\u0091\37\3\2\2\2\u0092\u0093\7\23\2\2\u0093")
        buf.write("\u0094\7\r\2\2\u0094\u0095\7\23\2\2\u0095!\3\2\2\2\u0096")
        buf.write("\u0097\7\23\2\2\u0097\u0098\7\16\2\2\u0098\u0099\7\23")
        buf.write("\2\2\u0099#\3\2\2\2\u009a\u009b\7\23\2\2\u009b\u009c\7")
        buf.write("\17\2\2\u009c\u009d\7\23\2\2\u009d%\3\2\2\2\u009e\u009f")
        buf.write("\7\20\2\2\u009f\u00a3\7\31\2\2\u00a0\u00a2\5(\25\2\u00a1")
        buf.write("\u00a0\3\2\2\2\u00a2\u00a5\3\2\2\2\u00a3\u00a1\3\2\2\2")
        buf.write("\u00a3\u00a4\3\2\2\2\u00a4\u00a6\3\2\2\2\u00a5\u00a3\3")
        buf.write("\2\2\2\u00a6\u00a7\7\32\2\2\u00a7\'\3\2\2\2\u00a8\u00ab")
        buf.write("\7\23\2\2\u00a9\u00aa\7\21\2\2\u00aa\u00ac\7\23\2\2\u00ab")
        buf.write("\u00a9\3\2\2\2\u00ab\u00ac\3\2\2\2\u00ac\u00ae\3\2\2\2")
        buf.write("\u00ad\u00af\7\27\2\2\u00ae\u00ad\3\2\2\2\u00ae\u00af")
        buf.write("\3\2\2\2\u00af)\3\2\2\2\24+/;?FJNQWcho{\177\u0089\u00a3")
        buf.write("\u00ab\u00ae")
        return buf.getvalue()


class UVLParser ( Parser ):

    grammarFileName = "UVL.g4"

    atn = ATNDeserializer().deserialize(serializedATN())

    decisionsToDFA = [ DFA(ds, i) for i, ds in enumerate(atn.decisionToState) ]

    sharedContextCache = PredictionContextCache()

    literalNames = [ "<INVALID>", "'features'", "'.'", "'{}'", "'{'", "','", 
                     "'}'", "'\"'", "'constraints'", "'!'", "'&'", "'|'", 
                     "'=>'", "'<=>'", "'imports'", "'as'" ]

    symbolicNames = [ "<INVALID>", "<INVALID>", "<INVALID>", "<INVALID>", 
                      "<INVALID>", "<INVALID>", "<INVALID>", "<INVALID>", 
                      "<INVALID>", "<INVALID>", "<INVALID>", "<INVALID>", 
                      "<INVALID>", "<INVALID>", "<INVALID>", "<INVALID>", 
                      "RELATION_WORD", "WORD", "BOOLEAN", "NUMBER", "VECTOR", 
                      "NL", "WS", "INDENT", "DEDENT" ]

    RULE_feature_model = 0
    RULE_features = 1
    RULE_child = 2
    RULE_relation = 3
    RULE_feature_spec = 4
    RULE_ref = 5
    RULE_attributes = 6
    RULE_attribute = 7
    RULE_key = 8
    RULE_value = 9
    RULE_relation_spec = 10
    RULE_constraints = 11
    RULE_constraint = 12
    RULE_negation = 13
    RULE_conjunction = 14
    RULE_disjuction = 15
    RULE_implication = 16
    RULE_equivalence = 17
    RULE_imports = 18
    RULE_imp = 19

    ruleNames =  [ "feature_model", "features", "child", "relation", "feature_spec", 
                   "ref", "attributes", "attribute", "key", "value", "relation_spec", 
                   "constraints", "constraint", "negation", "conjunction", 
                   "disjuction", "implication", "equivalence", "imports", 
                   "imp" ]

    EOF = Token.EOF
    T__0=1
    T__1=2
    T__2=3
    T__3=4
    T__4=5
    T__5=6
    T__6=7
    T__7=8
    T__8=9
    T__9=10
    T__10=11
    T__11=12
    T__12=13
    T__13=14
    T__14=15
    RELATION_WORD=16
    WORD=17
    BOOLEAN=18
    NUMBER=19
    VECTOR=20
    NL=21
    WS=22
    INDENT=23
    DEDENT=24

    def __init__(self, input:TokenStream, output:TextIO = sys.stdout):
        super().__init__(input, output)
        self.checkVersion("4.9")
        self._interp = ParserATNSimulator(self, self.atn, self.decisionsToDFA, self.sharedContextCache)
        self._predicates = None




    class Feature_modelContext(ParserRuleContext):

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def features(self):
            return self.getTypedRuleContext(UVLParser.FeaturesContext,0)


        def imports(self):
            return self.getTypedRuleContext(UVLParser.ImportsContext,0)


        def constraints(self):
            return self.getTypedRuleContext(UVLParser.ConstraintsContext,0)


        def getRuleIndex(self):
            return UVLParser.RULE_feature_model




    def feature_model(self):

        localctx = UVLParser.Feature_modelContext(self, self._ctx, self.state)
        self.enterRule(localctx, 0, self.RULE_feature_model)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 41
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==UVLParser.T__13:
                self.state = 40
                self.imports()


            self.state = 43
            self.features()
            self.state = 45
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==UVLParser.T__7:
                self.state = 44
                self.constraints()


        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class FeaturesContext(ParserRuleContext):

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def INDENT(self):
            return self.getToken(UVLParser.INDENT, 0)

        def child(self):
            return self.getTypedRuleContext(UVLParser.ChildContext,0)


        def DEDENT(self):
            return self.getToken(UVLParser.DEDENT, 0)

        def getRuleIndex(self):
            return UVLParser.RULE_features




    def features(self):

        localctx = UVLParser.FeaturesContext(self, self._ctx, self.state)
        self.enterRule(localctx, 2, self.RULE_features)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 47
            self.match(UVLParser.T__0)
            self.state = 48
            self.match(UVLParser.INDENT)
            self.state = 49
            self.child()
            self.state = 50
            self.match(UVLParser.DEDENT)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class ChildContext(ParserRuleContext):

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def feature_spec(self):
            return self.getTypedRuleContext(UVLParser.Feature_specContext,0)


        def INDENT(self):
            return self.getToken(UVLParser.INDENT, 0)

        def DEDENT(self):
            return self.getToken(UVLParser.DEDENT, 0)

        def EOF(self):
            return self.getToken(UVLParser.EOF, 0)

        def relation(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(UVLParser.RelationContext)
            else:
                return self.getTypedRuleContext(UVLParser.RelationContext,i)


        def getRuleIndex(self):
            return UVLParser.RULE_child




    def child(self):

        localctx = UVLParser.ChildContext(self, self._ctx, self.state)
        self.enterRule(localctx, 4, self.RULE_child)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 52
            self.feature_spec()
            self.state = 61
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==UVLParser.INDENT:
                self.state = 53
                self.match(UVLParser.INDENT)
                self.state = 57
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                while _la==UVLParser.RELATION_WORD:
                    self.state = 54
                    self.relation()
                    self.state = 59
                    self._errHandler.sync(self)
                    _la = self._input.LA(1)

                self.state = 60
                _la = self._input.LA(1)
                if not(_la==UVLParser.EOF or _la==UVLParser.DEDENT):
                    self._errHandler.recoverInline(self)
                else:
                    self._errHandler.reportMatch(self)
                    self.consume()


        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class RelationContext(ParserRuleContext):

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def relation_spec(self):
            return self.getTypedRuleContext(UVLParser.Relation_specContext,0)


        def INDENT(self):
            return self.getToken(UVLParser.INDENT, 0)

        def DEDENT(self):
            return self.getToken(UVLParser.DEDENT, 0)

        def EOF(self):
            return self.getToken(UVLParser.EOF, 0)

        def child(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(UVLParser.ChildContext)
            else:
                return self.getTypedRuleContext(UVLParser.ChildContext,i)


        def getRuleIndex(self):
            return UVLParser.RULE_relation




    def relation(self):

        localctx = UVLParser.RelationContext(self, self._ctx, self.state)
        self.enterRule(localctx, 6, self.RULE_relation)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 63
            self.relation_spec()
            self.state = 72
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==UVLParser.INDENT:
                self.state = 64
                self.match(UVLParser.INDENT)
                self.state = 68
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                while _la==UVLParser.WORD:
                    self.state = 65
                    self.child()
                    self.state = 70
                    self._errHandler.sync(self)
                    _la = self._input.LA(1)

                self.state = 71
                _la = self._input.LA(1)
                if not(_la==UVLParser.EOF or _la==UVLParser.DEDENT):
                    self._errHandler.recoverInline(self)
                else:
                    self._errHandler.reportMatch(self)
                    self.consume()


        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Feature_specContext(ParserRuleContext):

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def ref(self):
            return self.getTypedRuleContext(UVLParser.RefContext,0)


        def attributes(self):
            return self.getTypedRuleContext(UVLParser.AttributesContext,0)


        def NL(self):
            return self.getToken(UVLParser.NL, 0)

        def getRuleIndex(self):
            return UVLParser.RULE_feature_spec




    def feature_spec(self):

        localctx = UVLParser.Feature_specContext(self, self._ctx, self.state)
        self.enterRule(localctx, 8, self.RULE_feature_spec)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 74
            self.ref()
            self.state = 76
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==UVLParser.T__2 or _la==UVLParser.T__3:
                self.state = 75
                self.attributes()


            self.state = 79
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==UVLParser.NL:
                self.state = 78
                self.match(UVLParser.NL)


        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class RefContext(ParserRuleContext):

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def WORD(self, i:int=None):
            if i is None:
                return self.getTokens(UVLParser.WORD)
            else:
                return self.getToken(UVLParser.WORD, i)

        def getRuleIndex(self):
            return UVLParser.RULE_ref




    def ref(self):

        localctx = UVLParser.RefContext(self, self._ctx, self.state)
        self.enterRule(localctx, 10, self.RULE_ref)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 85
            self._errHandler.sync(self)
            _alt = self._interp.adaptivePredict(self._input,8,self._ctx)
            while _alt!=2 and _alt!=ATN.INVALID_ALT_NUMBER:
                if _alt==1:
                    self.state = 81
                    self.match(UVLParser.WORD)
                    self.state = 82
                    self.match(UVLParser.T__1) 
                self.state = 87
                self._errHandler.sync(self)
                _alt = self._interp.adaptivePredict(self._input,8,self._ctx)

            self.state = 88
            self.match(UVLParser.WORD)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class AttributesContext(ParserRuleContext):

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def attribute(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(UVLParser.AttributeContext)
            else:
                return self.getTypedRuleContext(UVLParser.AttributeContext,i)


        def getRuleIndex(self):
            return UVLParser.RULE_attributes




    def attributes(self):

        localctx = UVLParser.AttributesContext(self, self._ctx, self.state)
        self.enterRule(localctx, 12, self.RULE_attributes)
        self._la = 0 # Token type
        try:
            self.state = 102
            self._errHandler.sync(self)
            token = self._input.LA(1)
            if token in [UVLParser.T__2]:
                self.enterOuterAlt(localctx, 1)
                self.state = 90
                self.match(UVLParser.T__2)
                pass
            elif token in [UVLParser.T__3]:
                self.enterOuterAlt(localctx, 2)
                self.state = 91
                self.match(UVLParser.T__3)
                self.state = 92
                self.attribute()
                self.state = 97
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                while _la==UVLParser.T__4:
                    self.state = 93
                    self.match(UVLParser.T__4)
                    self.state = 94
                    self.attribute()
                    self.state = 99
                    self._errHandler.sync(self)
                    _la = self._input.LA(1)

                self.state = 100
                self.match(UVLParser.T__5)
                pass
            else:
                raise NoViableAltException(self)

        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class AttributeContext(ParserRuleContext):

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def key(self):
            return self.getTypedRuleContext(UVLParser.KeyContext,0)


        def value(self):
            return self.getTypedRuleContext(UVLParser.ValueContext,0)


        def getRuleIndex(self):
            return UVLParser.RULE_attribute




    def attribute(self):

        localctx = UVLParser.AttributeContext(self, self._ctx, self.state)
        self.enterRule(localctx, 14, self.RULE_attribute)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 104
            self.key()
            self.state = 109
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==UVLParser.T__6:
                self.state = 105
                self.match(UVLParser.T__6)
                self.state = 106
                self.value()
                self.state = 107
                self.match(UVLParser.T__6)


        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class KeyContext(ParserRuleContext):

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def WORD(self):
            return self.getToken(UVLParser.WORD, 0)

        def getRuleIndex(self):
            return UVLParser.RULE_key




    def key(self):

        localctx = UVLParser.KeyContext(self, self._ctx, self.state)
        self.enterRule(localctx, 16, self.RULE_key)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 111
            self.match(UVLParser.WORD)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class ValueContext(ParserRuleContext):

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def BOOLEAN(self):
            return self.getToken(UVLParser.BOOLEAN, 0)

        def NUMBER(self):
            return self.getToken(UVLParser.NUMBER, 0)

        def WORD(self):
            return self.getToken(UVLParser.WORD, 0)

        def VECTOR(self):
            return self.getToken(UVLParser.VECTOR, 0)

        def getRuleIndex(self):
            return UVLParser.RULE_value




    def value(self):

        localctx = UVLParser.ValueContext(self, self._ctx, self.state)
        self.enterRule(localctx, 18, self.RULE_value)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 113
            _la = self._input.LA(1)
            if not((((_la) & ~0x3f) == 0 and ((1 << _la) & ((1 << UVLParser.WORD) | (1 << UVLParser.BOOLEAN) | (1 << UVLParser.NUMBER) | (1 << UVLParser.VECTOR))) != 0)):
                self._errHandler.recoverInline(self)
            else:
                self._errHandler.reportMatch(self)
                self.consume()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class Relation_specContext(ParserRuleContext):

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def RELATION_WORD(self):
            return self.getToken(UVLParser.RELATION_WORD, 0)

        def getRuleIndex(self):
            return UVLParser.RULE_relation_spec




    def relation_spec(self):

        localctx = UVLParser.Relation_specContext(self, self._ctx, self.state)
        self.enterRule(localctx, 20, self.RULE_relation_spec)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 115
            self.match(UVLParser.RELATION_WORD)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class ConstraintsContext(ParserRuleContext):

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def INDENT(self):
            return self.getToken(UVLParser.INDENT, 0)

        def DEDENT(self):
            return self.getToken(UVLParser.DEDENT, 0)

        def EOF(self):
            return self.getToken(UVLParser.EOF, 0)

        def constraint(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(UVLParser.ConstraintContext)
            else:
                return self.getTypedRuleContext(UVLParser.ConstraintContext,i)


        def NL(self, i:int=None):
            if i is None:
                return self.getTokens(UVLParser.NL)
            else:
                return self.getToken(UVLParser.NL, i)

        def getRuleIndex(self):
            return UVLParser.RULE_constraints




    def constraints(self):

        localctx = UVLParser.ConstraintsContext(self, self._ctx, self.state)
        self.enterRule(localctx, 22, self.RULE_constraints)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 117
            self.match(UVLParser.T__7)
            self.state = 118
            self.match(UVLParser.INDENT)
            self.state = 125
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while _la==UVLParser.T__8 or _la==UVLParser.WORD:
                self.state = 119
                self.constraint()
                self.state = 121
                self._errHandler.sync(self)
                _la = self._input.LA(1)
                if _la==UVLParser.NL:
                    self.state = 120
                    self.match(UVLParser.NL)


                self.state = 127
                self._errHandler.sync(self)
                _la = self._input.LA(1)

            self.state = 128
            _la = self._input.LA(1)
            if not(_la==UVLParser.EOF or _la==UVLParser.DEDENT):
                self._errHandler.recoverInline(self)
            else:
                self._errHandler.reportMatch(self)
                self.consume()
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class ConstraintContext(ParserRuleContext):

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def negation(self):
            return self.getTypedRuleContext(UVLParser.NegationContext,0)


        def conjunction(self):
            return self.getTypedRuleContext(UVLParser.ConjunctionContext,0)


        def disjuction(self):
            return self.getTypedRuleContext(UVLParser.DisjuctionContext,0)


        def implication(self):
            return self.getTypedRuleContext(UVLParser.ImplicationContext,0)


        def equivalence(self):
            return self.getTypedRuleContext(UVLParser.EquivalenceContext,0)


        def getRuleIndex(self):
            return UVLParser.RULE_constraint




    def constraint(self):

        localctx = UVLParser.ConstraintContext(self, self._ctx, self.state)
        self.enterRule(localctx, 24, self.RULE_constraint)
        try:
            self.state = 135
            self._errHandler.sync(self)
            la_ = self._interp.adaptivePredict(self._input,14,self._ctx)
            if la_ == 1:
                self.enterOuterAlt(localctx, 1)
                self.state = 130
                self.negation()
                pass

            elif la_ == 2:
                self.enterOuterAlt(localctx, 2)
                self.state = 131
                self.conjunction()
                pass

            elif la_ == 3:
                self.enterOuterAlt(localctx, 3)
                self.state = 132
                self.disjuction()
                pass

            elif la_ == 4:
                self.enterOuterAlt(localctx, 4)
                self.state = 133
                self.implication()
                pass

            elif la_ == 5:
                self.enterOuterAlt(localctx, 5)
                self.state = 134
                self.equivalence()
                pass


        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class NegationContext(ParserRuleContext):

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def WORD(self):
            return self.getToken(UVLParser.WORD, 0)

        def getRuleIndex(self):
            return UVLParser.RULE_negation




    def negation(self):

        localctx = UVLParser.NegationContext(self, self._ctx, self.state)
        self.enterRule(localctx, 26, self.RULE_negation)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 137
            self.match(UVLParser.T__8)
            self.state = 138
            self.match(UVLParser.WORD)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class ConjunctionContext(ParserRuleContext):

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def WORD(self, i:int=None):
            if i is None:
                return self.getTokens(UVLParser.WORD)
            else:
                return self.getToken(UVLParser.WORD, i)

        def getRuleIndex(self):
            return UVLParser.RULE_conjunction




    def conjunction(self):

        localctx = UVLParser.ConjunctionContext(self, self._ctx, self.state)
        self.enterRule(localctx, 28, self.RULE_conjunction)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 140
            self.match(UVLParser.WORD)
            self.state = 141
            self.match(UVLParser.T__9)
            self.state = 142
            self.match(UVLParser.WORD)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class DisjuctionContext(ParserRuleContext):

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def WORD(self, i:int=None):
            if i is None:
                return self.getTokens(UVLParser.WORD)
            else:
                return self.getToken(UVLParser.WORD, i)

        def getRuleIndex(self):
            return UVLParser.RULE_disjuction




    def disjuction(self):

        localctx = UVLParser.DisjuctionContext(self, self._ctx, self.state)
        self.enterRule(localctx, 30, self.RULE_disjuction)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 144
            self.match(UVLParser.WORD)
            self.state = 145
            self.match(UVLParser.T__10)
            self.state = 146
            self.match(UVLParser.WORD)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class ImplicationContext(ParserRuleContext):

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def WORD(self, i:int=None):
            if i is None:
                return self.getTokens(UVLParser.WORD)
            else:
                return self.getToken(UVLParser.WORD, i)

        def getRuleIndex(self):
            return UVLParser.RULE_implication




    def implication(self):

        localctx = UVLParser.ImplicationContext(self, self._ctx, self.state)
        self.enterRule(localctx, 32, self.RULE_implication)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 148
            self.match(UVLParser.WORD)
            self.state = 149
            self.match(UVLParser.T__11)
            self.state = 150
            self.match(UVLParser.WORD)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class EquivalenceContext(ParserRuleContext):

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def WORD(self, i:int=None):
            if i is None:
                return self.getTokens(UVLParser.WORD)
            else:
                return self.getToken(UVLParser.WORD, i)

        def getRuleIndex(self):
            return UVLParser.RULE_equivalence




    def equivalence(self):

        localctx = UVLParser.EquivalenceContext(self, self._ctx, self.state)
        self.enterRule(localctx, 34, self.RULE_equivalence)
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 152
            self.match(UVLParser.WORD)
            self.state = 153
            self.match(UVLParser.T__12)
            self.state = 154
            self.match(UVLParser.WORD)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class ImportsContext(ParserRuleContext):

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def INDENT(self):
            return self.getToken(UVLParser.INDENT, 0)

        def DEDENT(self):
            return self.getToken(UVLParser.DEDENT, 0)

        def imp(self, i:int=None):
            if i is None:
                return self.getTypedRuleContexts(UVLParser.ImpContext)
            else:
                return self.getTypedRuleContext(UVLParser.ImpContext,i)


        def getRuleIndex(self):
            return UVLParser.RULE_imports




    def imports(self):

        localctx = UVLParser.ImportsContext(self, self._ctx, self.state)
        self.enterRule(localctx, 36, self.RULE_imports)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 156
            self.match(UVLParser.T__13)
            self.state = 157
            self.match(UVLParser.INDENT)
            self.state = 161
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            while _la==UVLParser.WORD:
                self.state = 158
                self.imp()
                self.state = 163
                self._errHandler.sync(self)
                _la = self._input.LA(1)

            self.state = 164
            self.match(UVLParser.DEDENT)
        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx


    class ImpContext(ParserRuleContext):

        def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
            super().__init__(parent, invokingState)
            self.parser = parser

        def WORD(self, i:int=None):
            if i is None:
                return self.getTokens(UVLParser.WORD)
            else:
                return self.getToken(UVLParser.WORD, i)

        def NL(self):
            return self.getToken(UVLParser.NL, 0)

        def getRuleIndex(self):
            return UVLParser.RULE_imp




    def imp(self):

        localctx = UVLParser.ImpContext(self, self._ctx, self.state)
        self.enterRule(localctx, 38, self.RULE_imp)
        self._la = 0 # Token type
        try:
            self.enterOuterAlt(localctx, 1)
            self.state = 166
            self.match(UVLParser.WORD)
            self.state = 169
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==UVLParser.T__14:
                self.state = 167
                self.match(UVLParser.T__14)
                self.state = 168
                self.match(UVLParser.WORD)


            self.state = 172
            self._errHandler.sync(self)
            _la = self._input.LA(1)
            if _la==UVLParser.NL:
                self.state = 171
                self.match(UVLParser.NL)


        except RecognitionException as re:
            localctx.exception = re
            self._errHandler.reportError(self, re)
            self._errHandler.recover(self, re)
        finally:
            self.exitRule()
        return localctx





