aboutsummaryrefslogtreecommitdiffstats
path: root/Application/org.eclipse.viatra.solver.language/src
diff options
context:
space:
mode:
authorLibravatar Oszkar Semerath <semerath@mit.bme.hu>2020-05-06 00:27:55 +0200
committerLibravatar Oszkar Semerath <semerath@mit.bme.hu>2020-05-06 00:27:55 +0200
commit820151b6d27643ba0927ca84d1bccadbd695a55d (patch)
tree9d3a5786b7f90723a6af967875f861a89e5b897e /Application/org.eclipse.viatra.solver.language/src
parentcolor update (diff)
downloadVIATRA-Generator-820151b6d27643ba0927ca84d1bccadbd695a55d.tar.gz
VIATRA-Generator-820151b6d27643ba0927ca84d1bccadbd695a55d.tar.zst
VIATRA-Generator-820151b6d27643ba0927ca84d1bccadbd695a55d.zip
PS language update
Diffstat (limited to 'Application/org.eclipse.viatra.solver.language/src')
-rw-r--r--Application/org.eclipse.viatra.solver.language/src/org/eclipse/viatra/solver/language/SolverLanguage.xtext26
1 files changed, 12 insertions, 14 deletions
diff --git a/Application/org.eclipse.viatra.solver.language/src/org/eclipse/viatra/solver/language/SolverLanguage.xtext b/Application/org.eclipse.viatra.solver.language/src/org/eclipse/viatra/solver/language/SolverLanguage.xtext
index 17a329ad..8a510a19 100644
--- a/Application/org.eclipse.viatra.solver.language/src/org/eclipse/viatra/solver/language/SolverLanguage.xtext
+++ b/Application/org.eclipse.viatra.solver.language/src/org/eclipse/viatra/solver/language/SolverLanguage.xtext
@@ -18,7 +18,7 @@ TruthValue: {True} 'true' | {False} 'false' | {Unknown} 'unknown' | {Error} '
18/////////////////// 18///////////////////
19Interpretation: BasicInterpretation | DefaultInterpretation | CDInterpretation; 19Interpretation: BasicInterpretation | DefaultInterpretation | CDInterpretation;
20 20
21BasicInterpretation: symbol=Symbol '(' objects+=ComplexObject* ')' ':' value = TruthValue; 21BasicInterpretation: symbol=Symbol ('(' (objects+=ComplexObject (',' objects+=ComplexObject)*)? ')')? ':' value = TruthValue;
22 22
23Symbol: ModelSymbol | PartialitySymbol | DataSymbol; 23Symbol: ModelSymbol | PartialitySymbol | DataSymbol;
24 24
@@ -48,22 +48,20 @@ StringObject: value = STRING;
48/////////////////// 48///////////////////
49// Predicte grammar 49// Predicte grammar
50/////////////////// 50///////////////////
51Predicate: PredicateSymbol | ErrorPredicate; 51
52PredicateSymbol: 52Predicate:
53 'predicate' symbol = ModelSymbol '(' parameters += Parameter* ')' ':' ('false' | (bodies += PatternBody ('|' bodies += PatternBody)*)) '.' 53 (isError?='error')? symbol = ModelSymbol ('(' (parameters += Parameter (',' parameters += Parameter)*)? ')')? ':-' ('false' | (bodies += PatternBody ('|' bodies += PatternBody)*)) '.'
54;
55ErrorPredicate:
56 {ErrorPredicate} 'error' (name = ID)? ('(' parameters += Parameter* ')') ':' ('false' | (bodies += PatternBody ('|' bodies += PatternBody)*)) '.'
57; 54;
58 55
59Parameter: variable = Variable (':' type = Symbol)?; 56Parameter: variable = Variable (':' type = Symbol)?;
60PatternBody: {PatternBody} ('true' | constraints += Constraint*) ; 57PatternBody: {PatternBody} ('true' | constraints += Constraint*) ;
61Polarity: {Positive} '+' | {Negative} '-'; 58Polarity: {Positive} '+' | {Negative} '-';
62Constraint: (polarity = Polarity)? symbol = ModelSymbol ( 59Constraint: (polarity = Polarity)? symbol = ModelSymbol
63 ( '(' params += Literal* ')') | (closureType = ClosureType '(' params += Literal params += Literal ')')); 60 (('(' params += Literal? (',' params += Literal)* ')')?)
64 61 |
62 (closureType=ClosureType '(' params += Literal? (',' params += Literal)* ')');
65ClosureType: {ReflexiveClosure} '*' | {IrreflexiveClosure} '+'; 63ClosureType: {ReflexiveClosure} '*' | {IrreflexiveClosure} '+';
66Literal: Variable | DataObject; 64Literal: Variable | DataObject | NamedObject;
67Variable: name = ID; 65Variable: name = ID;
68 66
69/////////////////// 67///////////////////
@@ -83,13 +81,13 @@ DefaultInterpretation: 'default' interpretation = BasicInterpretation;
83/////////////////// 81///////////////////
84CDInterpretation: ClassInterpretation | EnumInterpretation| GlobalRelationInterpretation; 82CDInterpretation: ClassInterpretation | EnumInterpretation| GlobalRelationInterpretation;
85ClassInterpretation: 83ClassInterpretation:
86 abstract?='abstract' 'class' symbol = ModelSymbol ('extends' supertypes += ModelSymbol+)?'{' 84 (abstract?='abstract')? 'class' symbol = ModelSymbol ('extends' supertypes += ModelSymbol+)?'{'
87 fielt += FieldRelationInterpretation* 85 fielt += FieldRelationInterpretation*
88 '}' 86 '}'
89; 87;
90EnumInterpretation: 'enum' Symbol = ModelSymbol '{' objects+=NamedObject+ '}'; 88EnumInterpretation: 'enum' Symbol = ModelSymbol '{' objects+=NamedObject+ '}';
91FieldRelationInterpretation: containment ?= 'containment' symbol = ModelSymbol ':' multiplicity = MultiplicityDefinition? target = Symbol; 89FieldRelationInterpretation: (containment ?= 'containment')? symbol = ModelSymbol ':' multiplicity = MultiplicityDefinition? target = Symbol;
92GlobalRelationInterpretation: containment ?= 'containment' 'relation' symbol = ModelSymbol ':' sourceMultiplicity = MultiplicityDefinition? source = Symbol targetMultiplicity = MultiplicityDefinition? target = Symbol; 90GlobalRelationInterpretation: (containment ?= 'containment')? 'relation' symbol = ModelSymbol ':' sourceMultiplicity = MultiplicityDefinition? source = Symbol targetMultiplicity = MultiplicityDefinition? target = Symbol;
93MultiplicityDefinition: lower = INT '..' (upper = INT | unlimitedUpper?='*'); 91MultiplicityDefinition: lower = INT '..' (upper = INT | unlimitedUpper?='*');
94 92
95////SymbolIntroduction : Type | GlobalRelation | Predicate; 93////SymbolIntroduction : Type | GlobalRelation | Predicate;