Plan 9 from Bell Labs’s /usr/web/sources/contrib/fernan/nhc98/tests/nofib/real/anna/dot_3.cor

Copyright © 2021 Plan 9 Foundation.
Distributed under the MIT License.
Download the Plan 9 distribution.



list a ::= Nil | Cons a (list a); ;;

d4 xl yl zl
  = case xl of
       Cons x xs -> case yl of 
                      Cons y ys -> case zl of
                                      Cons z zs -> x * y * z + d4 xs ys zs;
                                      Nil -> 0
                                   end;
                      Nil -> 0
                    end;
       Nil -> 0
    end;

d6 xl yl zl
  = case xl of
       Cons x xs -> case yl of 
                      Cons y ys -> case zl of
                                      Cons z zs -> d4 x y z + d6 xs ys zs;
                                      Nil -> 0
                                   end;
                      Nil -> 0
                    end;
       Nil -> 0
    end;

d8 xl yl zl
  = case xl of
       Cons x xs -> case yl of 
                      Cons y ys -> case zl of
                                      Cons z zs -> d6 x y z + d8 xs ys zs;
                                      Nil -> 0
                                   end;
                      Nil -> 0
                    end;
       Nil -> 0
    end;


d10 xl yl zl
  = case xl of
       Cons x xs -> case yl of 
                      Cons y ys -> case zl of
                                      Cons z zs -> d8 x y z + d10 xs ys zs;
                                      Nil -> 0
                                   end;
                      Nil -> 0
                    end;
       Nil -> 0
    end;


Bell Labs OSI certified Powered by Plan 9

(Return to Plan 9 Home Page)

Copyright © 2021 Plan 9 Foundation. All Rights Reserved.
Comments to [email protected].