next up previous contents
Next: Copyright Permission Up: SML Implementation of Previous: Code Listing

Testing

The new system is in directory:

      /u0/grad/pat/thesis/reade/newcosy

so, we need to change directory to 

maccs[101]cd /u0/grad/pat/thesis/reade/newcosy
maccs[102] cosy

- System.system "cat MPrLL.test"; (* Example from {JL92]p.207 *)

program
  array deposit remove(n) endarray
  #i:1,n,1[path deposit(i);remove(i) end]
  path #i:1,n,1[deposit(i);@] end
  path #i:1,n,1[remove(i);@] end
  path readline;#i:1,n,1[deposit(i);@] end
  path #i:1,n,1[remove(i);@];printline end
  #i:1,n,1[path deposit(i),(getmessage;stopsystem;startsystem) end
           path remove(i),(getmessage;stopsystem;startsystem) end]
  path readline,(getmessage;stopsystem;startsystem) end
  path printline,(getmessage;stopsystem;startsystem) end
endprogram

- parser_csr_expand(file "buffer.test1");

Please input the INTEGER value of n: 5

No errrs !!! 
{
deposit (1) (2) (3) (4) (5)
remove (1) (2) (3) (4) (5)
}
val it =
  "program path deposit(1);remove(1) end path deposit(2);
                remove(2) end pa#"
  : string

- display it;

program
  path deposit(1);remove(1) end
  path deposit(2);remove(2) end
  path deposit(3);remove(3) end
  path deposit(4);remove(4) end
  path deposit(5);remove(5) end
  path deposit(1);deposit(2);deposit(3);deposit(4);deposit(5) end
  path remove(1);remove(2);remove(3);remove(4);remove(5) end
  path readline;deposit(1);deposit(2);deposit(3);deposit(4);
       deposit(5) end
  path remove(1);remove(2);remove(3);remove(4);remove(5);printline end
  path deposit(1),(getmessage;stopsystem;startsystem) end
  path remove(1),(getmessage;stopsystem;startsystem) end
  path deposit(2),(getmessage;stopsystem;startsystem) end
  path remove(2),(getmessage;stopsystem;startsystem) end
  path deposit(3),(getmessage;stopsystem;startsystem) end
  path remove(3),(getmessage;stopsystem;startsystem) end
  path deposit(4),(getmessage;stopsystem;startsystem) end
  path remove(4),(getmessage;stopsystem;startsystem) end
  path deposit(5),(getmessage;stopsystem;startsystem) end
  path remove(5),(getmessage;stopsystem;startsystem) end
  path readline,(getmessage;stopsystem;startsystem) end
  path printline,(getmessage;stopsystem;startsystem) end
endprogram

- System.system "cat MPrLLdist.test"; (* Example from [JL92]p.209 *)

program
  array deposit remove(n) endarray
  #i:1,n,1[path deposit(i);remove(i) end]
  path ;[deposit] end
  path ;[remove] end
  path readline;,[deposit] end
  path ,[remove];printline end
  #i:1,n,1[path deposit(i),(getmessage;stopsystem;startsystem) end
           path remove(i),(getmessage;stopsystem;startsystem) end]
  path readline,(getmessage;stopsystem;startsystem) end
  path printline,(getmessage;stopsystem;startsystem) end
endprogram

- parser_csr_expand(file "buffer.test2");

Please input the INTEGER value of n: 5




No errrs !!! 
{
deposit (1) (2) (3) (4) (5)
remove (1) (2) (3) (4) (5)
}
val it =
  "program path deposit(1);remove(1) end path deposit(2);
                remove(2) end pa#"
  : string

- display it;

program
  path deposit(1);remove(1) end
  path deposit(2);remove(2) end
  path deposit(3);remove(3) end
  path deposit(4);remove(4) end
  path deposit(5);remove(5) end
  path deposit(1);deposit(2);deposit(3);deposit(4);deposit(5) end
  path remove(1);remove(2);remove(3);remove(4);remove(5) end
  path readline;deposit(1),deposit(2),deposit(3),deposit(4),
       deposit(5) end
  path remove(1),remove(2),remove(3),remove(4),remove(5);printline end
  path deposit(1),(getmessage;stopsystem;startsystem) end
  path remove(1),(getmessage;stopsystem;startsystem) end
  path deposit(2),(getmessage;stopsystem;startsystem) end
  path remove(2),(getmessage;stopsystem;startsystem) end
  path deposit(3),(getmessage;stopsystem;startsystem) end
  path remove(3),(getmessage;stopsystem;startsystem) end
  path deposit(4),(getmessage;stopsystem;startsystem) end
  path remove(4),(getmessage;stopsystem;startsystem) end
  path deposit(5),(getmessage;stopsystem;startsystem) end
  path remove(5),(getmessage;stopsystem;startsystem) end
  path readline,(getmessage;stopsystem;startsystem) end
  path printline,(getmessage;stopsystem;startsystem) end
endprogram

- System.system "cat repl.tst1"; (* test replicators *)

program
  array a(2) b(6) endarray
  array c(4) d(5) endarray
  array #i:1,5,2[#j:1,7,3[f(i,j) g(i,j)]] endarray
  #i:1,2,1[path a(i) end]
  #i:1,2,1[path a(i);b(i+2) end]
  #i:2,4,1[path c(i),d(i) end]
  path #i:1,2,1[a(i);@] end
  #i:1,5,2[#j:1,7,3[path f(i,j);g(i,j) end]]
endprogram

- parser_csr_expand(file "repl.tst1");

No errrs !!! 
{
a (1) (2)
b (1) (2) (3) (4) (5) (6)
c (1) (2) (3) (4)
d (1) (2) (3) (4) (5)
f (1,1) (3,1) (5,1) (1,4) (3,4) (5,4) (1,7) (3,7) (5,7)
g (1,1) (3,1) (5,1) (1,4) (3,4) (5,4) (1,7) (3,7) (5,7)
}



val it =
  "program path a(1) end path a(2) end path a(1);b(3) end #"
  : string

- display it;

program
  path a(1) end
  path a(2) end
  path a(1);b(3) end
  path a(2);b(4) end
  path c(2),d(2) end
  path c(3),d(3) end
  path c(4),d(4) end
  path a(1);a(2) end
  path f(1,1);g(1,1) end
  path f(1,4);g(1,4) end
  path f(1,7);g(1,7) end
  path f(3,1);g(3,1) end
  path f(3,4);g(3,4) end
  path f(3,7);g(3,7) end
  path f(5,1);g(5,1) end
  path f(5,4);g(5,4) end
  path f(5,7);g(5,7) end
endprogram

- System.system "cat repl.tst2"; (* test replicators *)

program
  array a b(5) c(2,3) endarray
  array p r q(7) endarray
  array up(3) down(3) endarray
  #i:1,5,1[path a(i);b(i),#j:1,2,1[#k:1,3,2[c(j,k);@],@] end]
  path #i:1,3,1[p(i);@,@;q(i)] end
  path #i:1,3,1[p(i);@,t0,@;q(i)] end
  path #i:1,3,1[(up(i);@;full*;@;down(i))*] end
  path #i:1,3,1[(r(i);s(i))*,p(i);@,t0,@;q(i),(r(i);s(i))*] end
  path #i:3,1,-1[(@ @;q(i),s(i))] end
  path #i:3,1,-1[(q(i),s(i);@ @)] end
  path #i:1,3,1[(@ fill* @)] end
  path #i:1,3,1[(r(i);s(i);@,t0,@;q(i))] end
  
endprogram

- parser_csr_expand(file "repl.tst2");

No errrs !!! 
{
a (1) (2) (3) (4) (5)
b (1) (2) (3) (4) (5)
c (1,1) (2,1) (1,2) (2,2) (1,3) (2,3)
p (1) (2) (3) (4) (5) (6) (7)
r (1) (2) (3) (4) (5) (6) (7)
q (1) (2) (3) (4) (5) (6) (7)
up (1) (2) (3)
down (1) (2) (3)
}
val it =
  "program path a(1);b(1),c(1,1);c(1,3),c(2,1);c(2,3) end 
           path a(2);b(2),#"
  : string



- parser_csr_expand(it);

No errrs !!! 
val it =
  "program path a(1);b(1),c(1,1);c(1,3),c(2,1);c(2,3) end 
           path a(2);b(2),#"
  : string

- display it;

program
  path a(1);b(1),c(1,1);c(1,3),c(2,1);c(2,3) end
  path a(2);b(2),c(1,1);c(1,3),c(2,1);c(2,3) end
  path a(3);b(3),c(1,1);c(1,3),c(2,1);c(2,3) end
  path a(4);b(4),c(1,1);c(1,3),c(2,1);c(2,3) end
  path a(5);b(5),c(1,1);c(1,3),c(2,1);c(2,3) end
  path p(1);p(2);p(3),q(3);q(2);q(1) end
  path p(1);p(2);p(3),t0,q(3);q(2);q(1) end
  path (up(1);(up(2);(up(3);full*;down(3))*;down(2))*;down(1))* end
  path
      (r(1)
     ;s(1))*
         ,p(1)
     ;(r(2)
     ;s(2))*
         ,p(2)
     ;(r(3)
     ;s(3))*
         ,p(3)
         ,t0
         ,q(3)
         ,(r(3)
     ;s(3))*
     ;q(2)
         ,(r(2)
     ;s(2))*
     ;q(1)
         ,(r(1)
     ;s(1))*
  end
  path (((q(1),s(1));q(2),s(2));q(3),s(3)) end
  path (q(3),s(3);(q(2),s(2);(q(1),s(1)))) end
  path (((fill*))) end
  path (r(1);s(1);(r(2);s(2);(r(3);s(3),t0,q(3));q(2));q(1)) end
endprogram

- System.system "cat repl.tst.err"; (* test replicators *)

program
  array p q(7) s(5) t(-4:2) endarray
  path #i:1,-1,1[p(i);@,@;q(i)] end
  path #i:1,8,1[s(i);@] end
  #i:1,3,1[path t(i) end]

endprogram

- parser_csr_expand(file "repl.tst.err");

P1: (fi - in) div inc + 1 <= 0 and FSTRIP(LSTRIP(t)) = null
P2: Range is out of boundary
P3: Range is out of boundary
3 error(s) found !!! 


- System.system "cat dist.tst1"; (* test distributors *)

program
  array a(2,3) b(4,3,2) c(3) d(2)  endarray
  path ;[,[;[b(,,)]]] end
  path ;[,[;[b]]] end
  path ;[,[;[b()]]] end
  path ;[,[a(,)]] end
  path ;[,[a()]] end
  path ;[,[a]] end
  path ;[,#1,3,1[b(,,1)],c] end
  path ;1[d,;[a]] end
  path ;[b(,2,1)] end
endprogram

- parser_csr_expand(file "dist.tst1");

No errrs !!! 
{
a (1,1) (2,1) (1,2) (2,2) (1,3) (2,3)
b (1,1,1) (2,1,1) (3,1,1) (4,1,1) (1,2,1) (2,2,1) (3,2,1)
  (4,2,1) (1,3,1) (2,3,1) (3,3,1) (4,3,1) (1,1,2) (2,1,2)
  (3,1,2) (4,1,2) (1,2,2) (2,2,2) (3,2,2) (4,2,2) (1,3,2)
  (2,3,2) (3,3,2) (4,3,2)
c (1) (2) (3)
d (1) (2)
}
val it =
  "program path b(1,1,1);b(2,1,1);b(3,1,1);b(4,1,1),b(1,2,1);
                b(2,2,1);b(3#"
  : string

- parser_csr_expand(it);

No errrs !!! 
val it =
  "program path b(1,1,1);b(2,1,1);b(3,1,1);b(4,1,1),b(1,2,1);
                b(2,2,1);b(3#"
  : string

- display it;

program
  path
      b(1,1,1)
     ;b(2,1,1)
     ;b(3,1,1)
     ;b(4,1,1)
         ,b(1,2,1)
     ;b(2,2,1)
     ;b(3,2,1)
     ;b(4,2,1)
         ,b(1,3,1)
     ;b(2,3,1)
     ;b(3,3,1)
     ;b(4,3,1)
     ;b(1,1,2)
     ;b(2,1,2)
     ;b(3,1,2)
     ;b(4,1,2)
         ,b(1,2,2)
     ;b(2,2,2)
     ;b(3,2,2)
     ;b(4,2,2)
         ,b(1,3,2)
     ;b(2,3,2)
     ;b(3,3,2)
     ;b(4,3,2)
  end
  path
      b(1,1,1)
     ;b(2,1,1)
     ;b(3,1,1)
     ;b(4,1,1)
         ,b(1,2,1)
     ;b(2,2,1)
     ;b(3,2,1)
     ;b(4,2,1)
         ,b(1,3,1)
     ;b(2,3,1)
     ;b(3,3,1)
     ;b(4,3,1)
     ;b(1,1,2)
     ;b(2,1,2)
     ;b(3,1,2)
     ;b(4,1,2)
         ,b(1,2,2)
     ;b(2,2,2)
     ;b(3,2,2)
     ;b(4,2,2)
         ,b(1,3,2)
     ;b(2,3,2)
     ;b(3,3,2)
     ;b(4,3,2)
  end

  path
      b(1,1,1)
     ;b(2,1,1)
     ;b(3,1,1)
     ;b(4,1,1)
         ,b(1,2,1)
     ;b(2,2,1)
     ;b(3,2,1)
     ;b(4,2,1)
         ,b(1,3,1)
     ;b(2,3,1)
     ;b(3,3,1)
     ;b(4,3,1)
     ;b(1,1,2)
     ;b(2,1,2)
     ;b(3,1,2)
     ;b(4,1,2)
         ,b(1,2,2)
     ;b(2,2,2)
     ;b(3,2,2)
     ;b(4,2,2)
         ,b(1,3,2)
     ;b(2,3,2)
     ;b(3,3,2)
     ;b(4,3,2)
  end
  path a(1,1),a(2,1);a(1,2),a(2,2);a(1,3),a(2,3) end
  path a(1,1),a(2,1);a(1,2),a(2,2);a(1,3),a(2,3) end
  path a(1,1),a(2,1);a(1,2),a(2,2);a(1,3),a(2,3) end
  path
      b(1,1,1)
         ,b(2,1,1)
         ,b(3,1,1)
         ,c(1)
     ;b(1,2,1)
         ,b(2,2,1)
         ,b(3,2,1)
         ,c(2)
     ;b(1,3,1)
         ,b(2,3,1)
         ,b(3,3,1)
         ,c(3)
  end
  path d(1),a(1,1);a(1,2);a(1,3);d(2),a(2,1);a(2,2);a(2,3) end
  path b(1,2,1);b(2,2,1);b(3,2,1);b(4,2,1) end
endprogram

- System.system "cat dist.tst2"; (* test distributors *)

program
  array c(2,3) b(2,3,4)  endarray
  array a(4) d(2,4) endarray
  array a1(4,2) b1(4,4,2) endarray
  array a2(2) b2(3:4) #i:3,5,2[c2(i)] endarray
  array c3(0:3,2) endarray
  path ;[,[b(,1,)]] end
  path ;[,[b(1,,)]] end
  path ;[,[b(,,1)]] end
  path ;[b(2,,1)] end
  path ;[b(2,1,)] end
  path ;[b(,2,1)] end
  path ;[a,d(1,)] end
  path ;[,[a1,b1(,1,)]] end
  path ;[a2,b2,c2] end
  path ;1[,[c]] end
  path ;1#1,3,1[,[c3]] end
  path ;[a(),notarray] end

endprogram

- parser_csr_expand(file "dist.tst2");

No errrs !!! 
{
c (1,1) (2,1) (1,2) (2,2) (1,3) (2,3)
b (1,1,1) (2,1,1) (1,2,1) (2,2,1) (1,3,1) (2,3,1) (1,1,2)
  (2,1,2) (1,2,2) (2,2,2) (1,3,2) (2,3,2) (1,1,3) (2,1,3)
  (1,2,3) (2,2,3) (1,3,3) (2,3,3) (1,1,4) (2,1,4) (1,2,4)
  (2,2,4) (1,3,4) (2,3,4)
a (1) (2) (3) (4)
d (1,1) (2,1) (1,2) (2,2) (1,3) (2,3) (1,4) (2,4)
a1 (1,1) (2,1) (3,1) (4,1) (1,2) (2,2) (3,2) (4,2)
b1 (1,1,1) (2,1,1) (3,1,1) (4,1,1) (1,2,1) (2,2,1) (3,2,1)
   (4,2,1) (1,3,1) (2,3,1) (3,3,1) (4,3,1) (1,4,1) (2,4,1)
   (3,4,1) (4,4,1) (1,1,2) (2,1,2) (3,1,2) (4,1,2) (1,2,2) 
   (2,2,2) (3,2,2) (4,2,2) (1,3,2) (2,3,2) (3,3,2) (4,3,2)
   (1,4,2) (2,4,2) (3,4,2) (4,4,2)
a2 (1) (2)
b2 (3) (4)
c2 (3) (5)
c3 (0,1) (1,1) (2,1) (3,1) (0,2) (1,2) (2,2) (3,2)
}
val it =
  "program path b(1,1,1),b(2,1,1);b(1,1,2),b(2,1,2);b(1,1,3),#"
  : string

- display it;

program
  path
      b(1,1,1)
         ,b(2,1,1)
     ;b(1,1,2)
         ,b(2,1,2)
     ;b(1,1,3)
         ,b(2,1,3)
     ;b(1,1,4)
         ,b(2,1,4)
  end
  path
      b(1,1,1)
         ,b(1,2,1)
         ,b(1,3,1)
     ;b(1,1,2)
         ,b(1,2,2)
         ,b(1,3,2)
     ;b(1,1,3)
         ,b(1,2,3)
         ,b(1,3,3)
     ;b(1,1,4)
         ,b(1,2,4)
         ,b(1,3,4)
  end
  path b(1,1,1),b(2,1,1);b(1,2,1),b(2,2,1);b(1,3,1),b(2,3,1) end
  path b(2,1,1);b(2,2,1);b(2,3,1) end
  path b(2,1,1);b(2,1,2);b(2,1,3);b(2,1,4) end
  path b(1,2,1);b(2,2,1) end
  path a(1),d(1,1);a(2),d(1,2);a(3),d(1,3);a(4),d(1,4) end
  path
      a1(1,1)
         ,b1(1,1,1)
         ,a1(2,1)
         ,b1(2,1,1)
         ,a1(3,1)
         ,b1(3,1,1)
         ,a1(4,1)
         ,b1(4,1,1)
     ;a1(1,2)
         ,b1(1,1,2)
         ,a1(2,2)
         ,b1(2,1,2)
         ,a1(3,2)
         ,b1(3,1,2)
         ,a1(4,2)
         ,b1(4,1,2)
  end
  path a2(1),b2(3),c2(3);a2(2),b2(4),c2(5) end
  path c(1,1),c(1,2),c(1,3);c(2,1),c(2,2),c(2,3) end
  path c3(0,1),c3(0,2);c3(1,1),c3(1,2);c3(2,1),c3(2,2) end
  path a(1),notarray;a(2),notarray;a(3),notarray;a(4),notarray end
endprogram

- System.system "cat dist.tst.err"; (* test distributors *)

program
  array a(2) b(3) c(2,3) d(3,2)  endarray
  path ;[a,b] end
  path ;[c(,)] end
  path ;[,[a]] end
  path ;[,[c,d]] end
  path ;[c(1,),d(2,)] end
  path ;1[a,;1[c]] end
endprogram

- parser_csr_expand(file "dist.tst.err");

P1: Do not have the same number of sections
P2: Wrong number of empty index-fields
P3: Wrong number of empty index-fields
P4: Do not have the same number of sections
P5: Do not have the same number of sections
P6: Use same distributable dimension.
P2: More then 1 distributable dimensions
P3: No 2 distributable dimensions
8 error(s) found !!! 

- System.system "cat dist.tst.err1"; (* test distributors *)

program
  array a(3) c(2,3) endarray
  path ;[b] end
  path ;[a,b()] end
  path ;1[a,;[c]] end
  path #i:1,2,0[a(i),@] end
  path #i:1,2,-1[a(i),@] end
endprogram
 
- parser_csr_expand(file "dist.tst.err1");

P4: 'inc' is equal to zero !!!
P5: (fi-ini) div inc+1 <= 0
P1: No slice event exist in distributor
P2: 'b' is not an array
P3: Do not have the same number of sections generated by '1' dimension
5 error(s) found !!! 

- System.system "cat coll.tst"; (* test collectivisors *)

program
  array a(n+2) b(n**2) c(n*2) endarray
  array d(3) #i:1,5,2[e(i)] endarray
  path ;[d,e] end
  #i:1,3,1[path b(i+3) end]
endprogram

- parser_csr_expand(file "coll.tst");

Please input the INTEGER value of n: 3
No errrs !!! 
{
a (1) (2) (3) (4) (5)
b (1) (2) (3) (4) (5) (6) (7) (8) (9)
c (1) (2) (3) (4) (5) (6)
d (1) (2) (3)
e (1) (3) (5)
}
val it =
  "program path d(1),e(1);d(2),e(3);d(3),e(5) end path b(4) end 
           path b(5)#"
  : string




- display it;

program
  path d(1),e(1);d(2),e(3);d(3),e(5) end
  path b(4) end
  path b(5) end
  path b(6) end
endprogram

- System.system "cat coll.tst.err"; (* test collectivisors *)

program
  array a(4) b b(0:1,2) a(0:2,4:5,-1:1) c(3:1) endarray
  array #i:1,5,-1[d(i)] endarray
  path #i:1,3,1[a(i),@] end
endprogram

- parser_csr_expand(file "coll.tst.err");

Array 'c': upperbound is smaller then lowerbound.
The identifier 'b' is duplicate
The identifier 'a' is duplicate
The range is empty
4 error(s) found !!!



Peter Lauer
Mon Jul 22 17:29:46 EDT 1996