Skip to content

Commit

Permalink
rebase main and review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
christophkloeffel authored and phiwuu committed Sep 2, 2024
1 parent 7880938 commit 643d023
Show file tree
Hide file tree
Showing 31 changed files with 67 additions and 41 deletions.
2 changes: 1 addition & 1 deletion language-reference-manual/lrm.trlc
Original file line number Diff line number Diff line change
Expand Up @@ -1520,7 +1520,7 @@ section "Quantification" {
bnf = '''
quantified_expression ::=
'(' quantifier IDENTIFIER_name 'in' IDENTIFIER_component_name '=>'
expression_PREDICATE ')'ma
expression_PREDICATE ')'

quantifier ::= 'forall' | 'exists'
'''
Expand Down
4 changes: 1 addition & 3 deletions tests-system/rbt-existential-quantification-semantics/output
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
(exists item in a => item == 7), warning "there is no 7 in a"
^^^^^^ rbt-existential-quantification-semantics/foo.rsl:8: issue: expression is always true [vcg-always-true]
T Kitten {
^^^^^^ rbt-existential-quantification-semantics/foo.trlc:7: check warning: there is no 7 in a
Processed 1 model, 0 checks and 1 requirement file and found 2 warnings
Processed 1 model and 1 requirement file and found 1 warning
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ T Kitten {
"a": []
}
}
Processed 1 model, 0 checks and 1 requirement file and found 1 warning
Processed 1 model and 1 requirement file and found 1 warning
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
(exists item in a => item == 7), warning "there is no 7 in a"
^^^^^^ rbt-existential-quantification-semantics/foo.rsl:8: issue: expression is always true [vcg-always-true]
T Kitten {
^^^^^^ rbt-existential-quantification-semantics/foo.trlc:7: check warning: there is no 7 in a
Processed 1 model, 0 checks and 1 requirement file and found 2 warnings
Processed 1 model and 1 requirement file and found 1 warning
2 changes: 1 addition & 1 deletion tests-system/rbt-quantification-naming-scope/output
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
(forall a in a => a != 7), warning "No sevens allowed"
^ rbt-quantification-naming-scope/foo.rsl:10: error: shadows Composite_Component a from foo.rsl:4
Processed 1 model, 0 checks and 0 requirement files and found 1 error
Processed 1 model and 0 requirement files and found 1 error
2 changes: 1 addition & 1 deletion tests-system/rbt-quantification-naming-scope/output.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
(forall a in a => a != 7), warning "No sevens allowed"
^ rbt-quantification-naming-scope/foo.rsl:10: error: shadows Composite_Component a from foo.rsl:4
Processed 1 model, 0 checks and 0 requirement files and found 1 error
Processed 1 model and 0 requirement files and found 1 error
2 changes: 1 addition & 1 deletion tests-system/rbt-quantification-naming-scope/output.smtlib
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
(forall a in a => a != 7), warning "No sevens allowed"
^ rbt-quantification-naming-scope/foo.rsl:10: error: shadows Composite_Component a from foo.rsl:4
Processed 1 model, 0 checks and 0 requirement files and found 1 error
Processed 1 model and 0 requirement files and found 1 error
3 changes: 3 additions & 0 deletions tests-system/rbt-quantification-object-1/output
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
(forall char in a => char != "a"), warning "a should not contain the letter a"
^ rbt-quantification-object-1/foo.rsl:8: error: you can only quantify over arrays
Processed 1 model and 0 requirement files and found 1 error
1 change: 1 addition & 0 deletions tests-system/rbt-quantification-object-1/output.brief
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
rbt-quantification-object-1/foo.rsl:8:21: trlc error: you can only quantify over arrays
3 changes: 3 additions & 0 deletions tests-system/rbt-quantification-object-1/output.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
(forall char in a => char != "a"), warning "a should not contain the letter a"
^ rbt-quantification-object-1/foo.rsl:8: error: you can only quantify over arrays
Processed 1 model and 0 requirement files and found 1 error
3 changes: 3 additions & 0 deletions tests-system/rbt-quantification-object-1/output.smtlib
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
(forall char in a => char != "a"), warning "a should not contain the letter a"
^ rbt-quantification-object-1/foo.rsl:8: error: you can only quantify over arrays
Processed 1 model and 0 requirement files and found 1 error
9 changes: 9 additions & 0 deletions tests-system/rbt-quantification-object-2/foo.rsl
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package Foo

type Potato {
a String
}

checks Potato {
(forall char in b => char != "a"), warning "b should not contain the letter a"
}
3 changes: 3 additions & 0 deletions tests-system/rbt-quantification-object-2/output
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
(forall char in b => char != "a"), warning "b should not contain the letter a"
^ rbt-quantification-object-2/foo.rsl:8: error: unknown symbol b
Processed 1 model and 0 requirement files and found 1 error
1 change: 1 addition & 0 deletions tests-system/rbt-quantification-object-2/output.brief
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
rbt-quantification-object-2/foo.rsl:8:21: trlc error: unknown symbol b
3 changes: 3 additions & 0 deletions tests-system/rbt-quantification-object-2/output.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
(forall char in b => char != "a"), warning "b should not contain the letter a"
^ rbt-quantification-object-2/foo.rsl:8: error: unknown symbol b
Processed 1 model and 0 requirement files and found 1 error
3 changes: 3 additions & 0 deletions tests-system/rbt-quantification-object-2/output.smtlib
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
(forall char in b => char != "a"), warning "b should not contain the letter a"
^ rbt-quantification-object-2/foo.rsl:8: error: unknown symbol b
Processed 1 model and 0 requirement files and found 1 error
3 changes: 0 additions & 3 deletions tests-system/rbt-quantification-object/output

This file was deleted.

1 change: 0 additions & 1 deletion tests-system/rbt-quantification-object/output.brief

This file was deleted.

3 changes: 0 additions & 3 deletions tests-system/rbt-quantification-object/output.json

This file was deleted.

3 changes: 0 additions & 3 deletions tests-system/rbt-quantification-object/output.smtlib

This file was deleted.

1 change: 1 addition & 0 deletions tests-system/rbt-quantified-expression/foo.rsl
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@ type T {
checks T {
(forall item in a => item > 0), warning "All items must be positive", a
(exists item in a => item == 7), warning "7 is a lucky number", a
(forall item in a => 42), warning "All items must be positive", a
}
6 changes: 3 additions & 3 deletions tests-system/rbt-quantified-expression/output
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
(exists item in a => item == 7), warning "7 is a lucky number", a
^^^^^^ rbt-quantified-expression/foo.rsl:9: issue: expression is always true [vcg-always-true]
Processed 1 model, 0 checks and 1 requirement file and found 1 warning
(forall item in a => 42), warning "All items must be positive", a
^^ rbt-quantified-expression/foo.rsl:10: error: expected expression of type Builtin_Boolean, got Builtin_Integer instead
Processed 1 model and 1 requirement file and found 1 error
1 change: 1 addition & 0 deletions tests-system/rbt-quantified-expression/output.brief
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
rbt-quantified-expression/foo.rsl:10:26: trlc error: expected expression of type Builtin_Boolean, got Builtin_Integer instead
14 changes: 3 additions & 11 deletions tests-system/rbt-quantified-expression/output.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,3 @@
{
"Bar": {
"a": [
1,
2,
3,
7
]
}
}
Processed 1 model, 0 checks and 1 requirement file and found no issues
(forall item in a => 42), warning "All items must be positive", a
^^ rbt-quantified-expression/foo.rsl:10: error: expected expression of type Builtin_Boolean, got Builtin_Integer instead
Processed 1 model and 1 requirement file and found 1 error
6 changes: 3 additions & 3 deletions tests-system/rbt-quantified-expression/output.smtlib
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
(exists item in a => item == 7), warning "7 is a lucky number", a
^^^^^^ rbt-quantified-expression/foo.rsl:9: issue: expression is always true [vcg-always-true]
Processed 1 model, 0 checks and 1 requirement file and found 1 warning
(forall item in a => 42), warning "All items must be positive", a
^^ rbt-quantified-expression/foo.rsl:10: error: expected expression of type Builtin_Boolean, got Builtin_Integer instead
Processed 1 model and 1 requirement file and found 1 error
4 changes: 4 additions & 0 deletions tests-system/rbt-universal-quantification-semantics/foo.trlc
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,7 @@ T Bar {
T Kitten {
a = []
}

T Potato {
a = [-1, 1]
}
4 changes: 3 additions & 1 deletion tests-system/rbt-universal-quantification-semantics/output
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
T Bar {
^^^ rbt-universal-quantification-semantics/foo.trlc:3: check warning: All items must be positive
Processed 1 model, 0 checks and 1 requirement file and found 1 warning
T Potato {
^^^^^^ rbt-universal-quantification-semantics/foo.trlc:11: check warning: All items must be positive
Processed 1 model and 1 requirement file and found 2 warnings
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
rbt-universal-quantification-semantics/foo.trlc:3:3: trlc check warning: All items must be positive
rbt-universal-quantification-semantics/foo.trlc:11:3: trlc check warning: All items must be positive
10 changes: 9 additions & 1 deletion tests-system/rbt-universal-quantification-semantics/output.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
T Bar {
^^^ rbt-universal-quantification-semantics/foo.trlc:3: check warning: All items must be positive
T Potato {
^^^^^^ rbt-universal-quantification-semantics/foo.trlc:11: check warning: All items must be positive
{
"Bar": {
"a": [
Expand All @@ -8,6 +10,12 @@ T Bar {
},
"Kitten": {
"a": []
},
"Potato": {
"a": [
-1,
1
]
}
}
Processed 1 model, 0 checks and 1 requirement file and found 1 warning
Processed 1 model and 1 requirement file and found 2 warnings
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
T Bar {
^^^ rbt-universal-quantification-semantics/foo.trlc:3: check warning: All items must be positive
Processed 1 model, 0 checks and 1 requirement file and found 1 warning
T Potato {
^^^^^^ rbt-universal-quantification-semantics/foo.trlc:11: check warning: All items must be positive
Processed 1 model and 1 requirement file and found 2 warnings

0 comments on commit 643d023

Please sign in to comment.