Skip to content
Snippets Groups Projects
Commit f10f8003 authored by pm3g19's avatar pm3g19
Browse files

added missing files

parent 0dc083bd
No related branches found
No related tags found
No related merge requests found
build:
alex Lexer.x
happy Parser.y
ghc -dynamic Main.hs
mv Main csvql
.in
A:2, # declare input files and their numbers of cols in .in section
B:2
.out # statements for the query are in .out section
A x B; # returns the cartesian product of the two sets (conjunction)
\ No newline at end of file
.in
B:1
.out
B;
\ No newline at end of file
.in
A:3
.out
filter( \(r) -> r[1] == r[2]);
map (\(r) -> r[3,1]);
\ No newline at end of file
.in
P: 4,
Q: 4
.out
P x Q;
filter(\(r) -> r[1] == r[5]);
let f = \(a,y) -> if (isEmpty(a)) then y else a;
map (\(r) -> [r[1], f(r[2], r[6]), f(r[3], r[7]), f(r[4], r[8])]);
\ No newline at end of file
.in
A:2
.out
filter (\(r) -> not(isEmpty(r[2]) ) );
#filter (\(r) -> notEmpty(r[2]) );
\ No newline at end of file
.in
A:1
.out
map{A}(\(r) -> [r[1],"0",r[1]] );
\ No newline at end of file
.in
P:3,
Q:3,
R:1,
S:1,
T:4
.out
P x Q x R x S x T;
\ No newline at end of file
test.sh 0 → 100755
#!/bin/sh
PROBLEM=$1
INPUT=$2
TESTCASES=~/dev/plc/testCases
EXEC_DIR=~/dev/plc
cd $TESTCASES/pr$PROBLEM/inputs/input$INPUT
echo "Expected:"
EXP=$(cat $TESTCASES/pr$PROBLEM/expected/exp$INPUT.txt)
cat $TESTCASES/pr$PROBLEM/expected/exp$INPUT.txt
echo "Got:"
GOT=$($EXEC_DIR/csvql $EXEC_DIR/pr$PROBLEM.cql)
$EXEC_DIR/csvql $EXEC_DIR/pr$PROBLEM.cql
if [ "$EXP" = "$GOT" ];
then
echo "Test passed"
else
echo "Test failed"
fi
\ No newline at end of file
File added
lemon,lime,mandarin,pomelo
lemon,lime,orange,grapefruit
ugli,,mandarin,pomelo
ugli,,orange,grapefruit
lemon,lime,,pomelo
lemon,lime,orange,grapefruit
ugli,tangerine,,pomelo
ugli,tangerine,orange,grapefruit
lemon,lime,mandarin,
lemon,lime,orange,grapefruit
ugli,tangerine,mandarin,
ugli,tangerine,orange,grapefruit
lemon,lime,mandarin,pomelo
lemon,lime,orange,grapefruit
ugli,tangerine,mandarin,pomelo
ugli,tangerine,orange,grapefruit
lemon,lime,mandarin,pomelo
lemon,lime,orange,pink grapefruit
ugli,tangerine,mandarin,pomelo
ugli,tangerine,orange,pink grapefruit
1,2,a,b
1,2,c,d
1,2,e,f
1,2,g,h
1,2,i,j
1,2,k,l
1,2,m,n
1,2,o,p
1,2,q,r
1,2,s,t
1,2,u,v
1,2,w,x
1,2,y,z
11,12,a,b
11,12,c,d
11,12,e,f
11,12,g,h
11,12,i,j
11,12,k,l
11,12,m,n
11,12,o,p
11,12,q,r
11,12,s,t
11,12,u,v
11,12,w,x
11,12,y,z
13,14,a,b
13,14,c,d
13,14,e,f
13,14,g,h
13,14,i,j
13,14,k,l
13,14,m,n
13,14,o,p
13,14,q,r
13,14,s,t
13,14,u,v
13,14,w,x
13,14,y,z
15,16,a,b
15,16,c,d
15,16,e,f
15,16,g,h
15,16,i,j
15,16,k,l
15,16,m,n
15,16,o,p
15,16,q,r
15,16,s,t
15,16,u,v
15,16,w,x
15,16,y,z
17,18,a,b
17,18,c,d
17,18,e,f
17,18,g,h
17,18,i,j
17,18,k,l
17,18,m,n
17,18,o,p
17,18,q,r
17,18,s,t
17,18,u,v
17,18,w,x
17,18,y,z
19,20,a,b
19,20,c,d
19,20,e,f
19,20,g,h
19,20,i,j
19,20,k,l
19,20,m,n
19,20,o,p
19,20,q,r
19,20,s,t
19,20,u,v
19,20,w,x
19,20,y,z
3,4,a,b
3,4,c,d
3,4,e,f
3,4,g,h
3,4,i,j
3,4,k,l
3,4,m,n
3,4,o,p
3,4,q,r
3,4,s,t
3,4,u,v
3,4,w,x
3,4,y,z
5,6,a,b
5,6,c,d
5,6,e,f
5,6,g,h
5,6,i,j
5,6,k,l
5,6,m,n
5,6,o,p
5,6,q,r
5,6,s,t
5,6,u,v
5,6,w,x
5,6,y,z
7,8,a,b
7,8,c,d
7,8,e,f
7,8,g,h
7,8,i,j
7,8,k,l
7,8,m,n
7,8,o,p
7,8,q,r
7,8,s,t
7,8,u,v
7,8,w,x
7,8,y,z
9,10,a,b
9,10,c,d
9,10,e,f
9,10,g,h
9,10,i,j
9,10,k,l
9,10,m,n
9,10,o,p
9,10,q,r
9,10,s,t
9,10,u,v
9,10,w,x
9,10,y,z
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment