forked from dangtv/BIRDS
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
simplification コマンドに
--prepare
オプションを追加した (#48)
* A view can be delta predicates with --prepare option. * Add a sample code. * Add some tests for simplification.
- Loading branch information
1 parent
05fa4ca
commit 3b52686
Showing
11 changed files
with
509 additions
and
15 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
source x('A':int). | ||
view v('A':int). | ||
|
||
+x(A) :- x(A), v(A), A <> 42. | ||
-x(A) :- +x(A), -v(A). |
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,5 @@ | ||
source x('A':int). | ||
view v('A':int). | ||
|
||
+x(A) :- x(A), v(A), A <> 42. | ||
-x(A) :- +x(A), +v(A). |
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,13 @@ | ||
source b('B':int, 'C':int). | ||
source a('A':int, 'B':int). | ||
view v('A':int, 'B':int, 'C':int). | ||
-a(A, B) :- a(A, B) , not __updated__v(A, B, GENV1). | ||
-b(B, C) :- b(B, C) , a(GENV2, B) , b(B, GENV3) , not -v(GENV2, B, GENV3) , not __updated__v(GENV4, B, C). | ||
-b(B, C) :- b(B, C) , +v(GENV2, B, GENV3) , not __updated__v(GENV4, B, C). | ||
+a(A, B) :- a(A, B) , b(B, GENV5) , not -v(A, B, GENV5) , not a(A, B). | ||
+a(A, B) :- +v(A, B, GENV5) , not a(A, B). | ||
+b(B, C) :- a(GENV6, B) , b(B, C) , not -v(GENV6, B, C) , not b(B, C). | ||
+b(B, C) :- +v(GENV6, B, C) , not b(B, C). | ||
__updated__v(A, B, C) :- a(A, B) , b(B, C) , not -v(A, B, C). | ||
__updated__v(A, B, C) :- +v(A, B, C). | ||
v(A, B, C) :- a(A, B) , b(B, 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
source projs('A':int, 'B':string). | ||
view projv('A':int). | ||
-projs(A, B) :- projs(A, B) , -projv(A). | ||
+projs(A, B) :- projs(A, GENV7) , not -projv(A) , not projs(A, GENV1) , not -projs(GENV2, GENV3) , B = 'a'. | ||
+projs(A, B) :- projs(A, GENV8) , not -projv(A) , not projs(A, GENV4) , projs(GENV5, B) , -projv(GENV5). | ||
+projs(A, B) :- +projv(A) , not projs(A, GENV1) , not -projs(GENV2, GENV3) , B = 'a'. | ||
+projs(A, B) :- +projv(A) , not projs(A, GENV4) , projs(GENV5, B) , -projv(GENV5). | ||
__updated__projv(A) :- projs(A, GENV6) , not -projv(A). | ||
__updated__projv(A) :- +projv(A). | ||
projv(A) :- projs(A, B). |
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,13 @@ | ||
source uniona('NAME':string). | ||
source unionb('NAME':string). | ||
source uniono('NAME':string, 'TP':string). | ||
view unionview('NAME':string, 'TP':string). | ||
-uniona(N) :- uniona(N) , -unionview(N, T) , T = 'A'. | ||
-unionb(N) :- unionb(N) , -unionview(N, T) , T = 'B'. | ||
-uniono(N, T) :- uniono(N, T) , -unionview(N, T). | ||
+uniona(N) :- +unionview(N, T) , not uniona(N) , T = 'A' , not uniono(N, T). | ||
+unionb(N) :- +unionview(N, T) , not unionb(N) , T = 'B' , not uniono(N, T). | ||
+uniono(N, T) :- +unionview(N, T) , not uniono(N, T) , not T = 'A' , not T = 'B'. | ||
unionview(N, T) :- uniona(N) , T = 'A'. | ||
unionview(N, T) :- unionb(N) , T = 'B'. | ||
unionview(N, T) :- uniono(N, T). |
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
Oops, something went wrong.