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.
- Loading branch information
1 parent
ec0e384
commit 57ce5e1
Showing
11 changed files
with
601 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
open Birds | ||
|
||
let _ = | ||
let filename = Sys.argv.(1) in | ||
let chan = open_in filename in | ||
let lexbuf = Lexing.from_channel chan in | ||
let ast = Parser.main Lexer.token lexbuf in | ||
Verify.verify true 600 ast |
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,9 @@ | ||
source tracks2('TRACK':string,'RATING':int,'ALBUM':string,'QUANTITY':int). | ||
view tracks3('TRACK':string,'RATING':int,'ALBUM':string,'QUANTITY':int). | ||
% view definition: | ||
tracks3(T,R,A,Q) :- tracks2(T,R,A,Q),Q > 2. | ||
% putdelta | ||
+tracks2(T,R,A,Q) :- tracks3(T,R,A,Q), not tracks2(T,R,A,Q). | ||
-tracks2(T,R,A,Q) :- tracks2(T,R,A,Q), not tracks3(T,R,A,Q). | ||
% constraints | ||
_|_ :- tracks3(T,R,A,Q), Q <= 2. |
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 a('A':int, 'B':int). | ||
source b('B':int, 'C':int). | ||
view s('A':int, 'B':int, 'C':int). | ||
% view definition | ||
s(A,B,C) :- a(A,B), b(B,C). | ||
% putdelta | ||
-a(A,B) :- a(A,B), not s(A,B,_). | ||
+a(A,B) :- s(A,B,_), not a(A,B). | ||
-b(B,C) :- b(B,C), s(_,B,_), not s(_,B,C). | ||
+b(B,C) :- s(_,B,C), not b(B,C). | ||
% constraints | ||
%_|_ :- a(_,B), not b(B,_). | ||
_|_ :- s(_,B,C1), s(_,B,C2), C1<>C2. |
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,9 @@ | ||
source tracks2('TRACK':string,'RATING':int,'ALBUM':string,'QUANTITY':int). | ||
view tracks3('TRACK':string,'RATING':int,'ALBUM':string,'QUANTITY':int). | ||
% view definition: | ||
tracks3(T,R,A,Q) :- tracks2(T,R,A,Q),Q > 2. | ||
% putdelta | ||
+tracks2(T,R,A,Q) :- tracks3(T,R,A,Q), not tracks2(T,R,A,Q). | ||
-tracks2(T,R,A,Q) :- tracks2(T,R,A,Q), not tracks3(T,R,A,Q). | ||
% constraints | ||
%_|_ :- tracks3(T,R,A,Q), Q <= 2. |
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 a('A':int, 'B':int). | ||
source b('B':int, 'C':int). | ||
view s('A':int, 'B':int, 'C':int). | ||
% view definition | ||
s(A,B,C) :- a(A,B), b(B,C). | ||
% putdelta | ||
%-a(A,B) :- a(A,B), not s(A,B,_). | ||
+a(A,B) :- s(A,B,_), not a(A,B). | ||
-b(B,C) :- b(B,C), s(_,B,_), not s(_,B,C). | ||
+b(B,C) :- s(_,B,C), not b(B,C). | ||
% constraints | ||
_|_ :- a(_,B), not b(B,_). | ||
_|_ :- s(_,B,C1), s(_,B,C2), C1<>C2. |
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,9 @@ | ||
source tracks2('TRACK':string,'RATING':int,'ALBUM':string,'QUANTITY':int). | ||
view tracks3('TRACK':string,'RATING':int,'ALBUM':string,'QUANTITY':int). | ||
% view definition: | ||
tracks3(T,R,A,Q) :- tracks2(T,R,A,Q),Q > 2. | ||
% putdelta | ||
+tracks2(T,R,A,Q) :- tracks3(T,R,A,Q), not tracks2(T,R,A,Q). | ||
-tracks2(T,R,A,Q) :- tracks2(T,R,A,Q), not tracks3(T,R,A,Q), Q > 2. | ||
% constraints | ||
_|_ :- tracks3(T,R,A,Q), Q <= 2. |
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 a('A':int, 'B':int). | ||
source b('B':int, 'C':int). | ||
view s('A':int, 'B':int, 'C':int). | ||
% view definition | ||
s(A,B,C) :- a(A,B), b(B,C). | ||
% putdelta | ||
-a(A,B) :- a(A,B), not s(A,B,_). | ||
+a(A,B) :- s(A,B,_), not a(A,B). | ||
-b(B,C) :- b(B,C), s(_,B,_), not s(_,B,C). | ||
+b(B,C) :- s(_,B,C), not b(B,C). | ||
% constraints | ||
_|_ :- a(_,B), not b(B,_). | ||
_|_ :- s(_,B,C1), s(_,B,C2), C1<>C2. |
Oops, something went wrong.