-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #63 from kris7t/base-preds
Base predicates
- Loading branch information
Showing
52 changed files
with
1,193 additions
and
354 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
85 changes: 85 additions & 0 deletions
85
...nerator/src/test/resources/tools/refinery/generator/crossreference/typeConstraint.problem
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
% Copyright (c) 2024 The Refinery Authors <https://refinery.tools/> | ||
% | ||
% SPDX-License-Identifier: EPL-2.0 | ||
|
||
% TEST WITH ERRORS: directed cross reference type constraint | ||
|
||
class A { | ||
B[] foo | ||
} | ||
|
||
class B. | ||
|
||
foo(a1, b1). | ||
!foo(a2, b2). | ||
?foo(a3, b3). | ||
foo(a4, b4): error. | ||
|
||
% EXPECT EXACTLY: | ||
foo(a1, b1). | ||
!foo(a2, b2). | ||
?foo(a3, b3). | ||
foo(a4, b4): error. | ||
A(a1). | ||
B(b1). | ||
?A(a2). | ||
?B(b2). | ||
?A(a3). | ||
?B(b3). | ||
A(a4). | ||
B(b4). | ||
|
||
% TEST: directed cross reference with predicate type | ||
|
||
class A { | ||
bar[] foo | ||
} | ||
|
||
pred bar(A a) <-> !foo(a, _). | ||
|
||
foo(a1, b1). | ||
|
||
% EXPECT: | ||
A(a1). | ||
bar(b1). | ||
|
||
% TEST WITH ERRORS: directed cross reference with predicate type and assertion | ||
|
||
class A { | ||
bar[] foo | ||
} | ||
|
||
pred bar(A a) <-> !foo(a, _). | ||
|
||
!bar(b1). | ||
foo(a1, b1). | ||
|
||
% EXPECT EXACTLY: | ||
foo(a1, b1): error. | ||
A(a1). | ||
bar(b1): error. | ||
|
||
% TEST WITH ERRORS: undirected cross reference type constraint | ||
|
||
class A { | ||
A[] bar opposite bar | ||
} | ||
|
||
bar(a1, b1). | ||
!bar(a2, b2). | ||
?bar(a3, b3). | ||
bar(a4, b4): error. | ||
|
||
% EXPECT EXACTLY: | ||
bar(a1, b1). | ||
!bar(a2, b2). | ||
?bar(a3, b3). | ||
bar(a4, b4): error. | ||
A(a1). | ||
A(b1). | ||
?A(a2). | ||
?A(b2). | ||
?A(a3). | ||
?A(b3). | ||
A(a4). | ||
A(b4). |
57 changes: 57 additions & 0 deletions
57
...src/test/resources/tools/refinery/generator/crossreference/undirectedMultiplicity.problem
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
% Copyright (c) 2024 The Refinery Authors <https://refinery.tools/> | ||
% | ||
% SPDX-License-Identifier: EPL-2.0 | ||
|
||
% TEST: upper bound propagation | ||
|
||
class Person { | ||
Person[0..2] friend opposite friend | ||
} | ||
|
||
friend(a, b). | ||
friend(a, c). | ||
friend(b, c). | ||
!exists(Person::new). | ||
|
||
% EXPECT: | ||
friend(b, a). | ||
friend(c, a). | ||
friend(c, b). | ||
!friend(a, a). | ||
!friend(b, b). | ||
!friend(c, c). | ||
|
||
% TEST: lower bound propagation | ||
|
||
class Person { | ||
Person[2..*] friend opposite friend | ||
} | ||
|
||
Person(a). | ||
!friend(a, a). | ||
!friend(b, b). | ||
!friend(c, c). | ||
!exists(Person::new). | ||
|
||
% EXPECT: | ||
friend(a, b). | ||
friend(a, c). | ||
friend(b, c). | ||
|
||
% TEST: upper and lower bound propagation | ||
|
||
class Person { | ||
Person[2] friend opposite friend | ||
} | ||
|
||
friend(a, b). | ||
friend(a, c). | ||
!friend(b, b). | ||
!friend(c, c). | ||
!exists(Person::new). | ||
|
||
% EXPECT: | ||
friend(b, c). | ||
!friend(a, a). | ||
!friend(b, b). | ||
!friend(c, c). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.