-
Notifications
You must be signed in to change notification settings - Fork 17
Fix CI and allow record field access #158
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,2 +1,2 @@ | ||
| pyvcg==1.0.8 | ||
| cvc5>=1.2.0 | ||
| pyvcg==1.0.9 | ||
| cvc5>=1.3.1 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| goal, "potato" | ||
| ^^^^ field-access-1/test_1.rsl:11: issue: expression could be null [vcg-evaluation-of-null] | ||
| | example record_type triggering error: | ||
| | T bad_potato { | ||
| | value = 0 | ||
| | /* ref is null */ | ||
| | /* goal is null */ | ||
| | } | ||
| goal, "potato" | ||
| ^^^^ field-access-1/test_2.rsl:13: issue: expression could be null [vcg-evaluation-of-null] | ||
| | example record_type triggering error: | ||
| | T bad_potato { | ||
| | value = 0 | ||
| | /* ref_a is null */ | ||
| | ref_b = T_instance_0 | ||
| | /* goal is null */ | ||
| | } | ||
| 10 / len(ref.arr) > 0, "potato" | ||
| ^ field-access-1/test_3.rsl:9: issue: divisor could be 0 [vcg-div-by-zero] | ||
| | example record_type triggering error: | ||
| | T bad_potato { | ||
| | arr = [-1, -1] | ||
| | ref = T_instance_0 | ||
| | } | ||
| (forall e in arr => e.value < value), fatal "potato" | ||
| ^^^^^ field-access-1/test_4.rsl:9: warning: functional evaluation of field access not yet supported in VCG | ||
| first.value < second.value, fatal "potato" | ||
| ^^^^^ field-access-1/test_5.rsl:13: warning: functional evaluation of field access not yet supported in VCG | ||
| Q test_5_1 { | ||
| ^^^^^^^^ field-access-1/test_5.trlc:11: error: check goal (test_5.rsl:23) evaluates to null | ||
| pair = (two, one) | ||
| ^ field-access-1/test_5.trlc:16: check error: potato | ||
| Processed 5 models and 1 requirement file and found 5 warnings and 2 errors |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| field-access-1/test_5.trlc:11:3: trlc error: check goal (test_5.rsl:23) evaluates to null | ||
| field-access-1/test_5.trlc:16:10: trlc check error: potato | ||
| Processed 5 models and 1 requirement file and found 2 errors |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| Q test_5_1 { | ||
| ^^^^^^^^ field-access-1/test_5.trlc:11: error: check goal (test_5.rsl:23) evaluates to null | ||
| pair = (two, one) | ||
| ^ field-access-1/test_5.trlc:16: check error: potato | ||
| Processed 5 models and 1 requirement file and found 2 errors |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| goal, "potato" | ||
| ^^^^ field-access-1/test_1.rsl:11: issue: expression could be null [vcg-evaluation-of-null] | ||
| | example record_type triggering error: | ||
| | T bad_potato { | ||
| | value = 0 | ||
| | /* ref is null */ | ||
| | /* goal is null */ | ||
| | } | ||
| goal, "potato" | ||
| ^^^^ field-access-1/test_2.rsl:13: issue: expression could be null [vcg-evaluation-of-null] | ||
| | example record_type triggering error: | ||
| | T bad_potato { | ||
| | value = 0 | ||
| | /* ref_a is null */ | ||
| | ref_b = T_instance_0 | ||
| | /* goal is null */ | ||
| | } | ||
| 10 / len(ref.arr) > 0, "potato" | ||
| ^ field-access-1/test_3.rsl:9: issue: divisor could be 0 [vcg-div-by-zero] | ||
| | example record_type triggering error: | ||
| | T bad_potato { | ||
| | arr = [-1, -1] | ||
| | ref = T_instance_0 | ||
| | } | ||
| (forall e in arr => e.value < value), fatal "potato" | ||
| ^^^^^ field-access-1/test_4.rsl:9: warning: functional evaluation of field access not yet supported in VCG | ||
| first.value < second.value, fatal "potato" | ||
| ^^^^^ field-access-1/test_5.rsl:13: warning: functional evaluation of field access not yet supported in VCG | ||
| Q test_5_1 { | ||
| ^^^^^^^^ field-access-1/test_5.trlc:11: error: check goal (test_5.rsl:23) evaluates to null | ||
| pair = (two, one) | ||
| ^ field-access-1/test_5.trlc:16: check error: potato | ||
| Processed 5 models and 1 requirement file and found 5 warnings and 2 errors |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| package Test_1 | ||
|
|
||
| type T { | ||
| value Integer | ||
| ref optional T | ||
| goal optional Boolean | ||
| } | ||
|
|
||
| checks T { | ||
| ref != null implies ref.value < value, fatal "potato" | ||
| goal, "potato" | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| package Test_2 | ||
|
|
||
| type T { | ||
| value Integer | ||
| ref_a optional T | ||
| ref_b optional T | ||
|
|
||
| goal optional Boolean | ||
| } | ||
|
|
||
| checks T { | ||
| ref_a != ref_b, fatal "potato" | ||
| goal, "potato" | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| package Test_3 | ||
|
|
||
| type T { | ||
| arr Integer [2 .. *] | ||
| ref T | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should a recursive type not be optional?
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It is just a test case.
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. So its possible but unlikely for such a type to exist. I made it non-optional in the test to avoid having to write the null guard :) A future lint check would probably be a good idea, to spot any self or mutual recursion with all links being non-optional.
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Created #159 to do just that. |
||
| } | ||
|
|
||
| checks T { | ||
| 10 / len(ref.arr) > 0, "potato" | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| package Test_4 | ||
|
|
||
| type T { | ||
| value Integer | ||
| arr T [0 .. *] | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. same here |
||
| } | ||
|
|
||
| checks T { | ||
| (forall e in arr => e.value < value), fatal "potato" | ||
| 0 / (len(arr) - 5) == 0, "potato" | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| package Test_5 | ||
|
|
||
| type R { | ||
| value Integer | ||
| } | ||
|
|
||
| tuple T { | ||
| first R | ||
| second R | ||
| } | ||
|
|
||
| checks T { | ||
| first.value < second.value, fatal "potato" | ||
| } | ||
|
|
||
| type Q { | ||
| pair T | ||
| goal optional Boolean | ||
| } | ||
|
|
||
| checks Q { | ||
| pair.first.value >= 0, fatal "kitten" | ||
| goal, "goal" | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| package Test_5 | ||
|
|
||
| R one { | ||
| value = 1 | ||
| } | ||
|
|
||
| R two { | ||
| value = 2 | ||
| } | ||
|
|
||
| Q test_5_1 { | ||
| pair = (one, two) | ||
| } | ||
|
|
||
| Q test_5_2 { | ||
| pair = (two, one) | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| LRM.File_Parsing_References | ||
| LRM.Order_Of_Evaluation_Unordered | ||
| LRM.Dereference |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -5,7 +5,7 @@ c, "potato" | |
| | x = 1 | ||
| | y = 2 | ||
| | p = -1 | ||
| | q = -3 | ||
| | q = -2 | ||
| | /* c is null */ | ||
| | } | ||
| then x.version > 5 | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should have a positive testcase for this. I only see negative testcases
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's not a test, that is an example fragment of the LRM.
Or do you mean having a test that shows such a construct passing?