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

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



{==================================================================}
{=== Two and three point function domains                       ===}
{==================================================================}

d3 a ::= D3 a;

;;

if c t f = case c of True -> t; False -> f end;


{=========================================}
{=== 2 -> 2 functions                  ===}
{=========================================}


{=================================}
f00 x = f00 x;

{=================================}
f01 x = x;

{=================================}
f11 x = 42;


{=========================================}
{=== 3 -> 3 functions                  ===}
{=========================================}


f000 x = case x of
            D3 n -> f000 (D3 n)
         end;

f222 x = D3 (f11 (case x of D3 n -> n end));

f012 x = case x of
         D3 n -> D3 n
      end;

f011 x = case x of
         D3 n -> D3 (f00 n)
      end;

f022 x = case x of
         D3 n -> D3 (f11 n)
      end;

f111 x = D3 (f00 (case x of D3 n -> n end));

f112 x = D3 (f01 (case x of D3 n -> n end));

f122 x = D3 (f01 (case (f022 x) of D3 n -> n end));

f002 x = let
            aux = \y -> if y (D3 1) (D3 1)
         in
         case x of D3 n -> aux n end;

f001 x = let
            aux = \y -> if y (D3 (f00 y)) (D3 (f00 y))
         in
         case x of D3 n -> aux n end;

{==================================================================}
{=== 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 webmaster@9p.io.