Formula-like form of an operator
NEWTYPE math
LITERALS none;
OPERATORS
fact : integer->integer;
AXIOMS
For ALL x IN integer
( fact(x)==
IF xɘ then ERROR!
ELSE IF x = 0 THEN 1
ELSE x*fact(x-1)
FI;
FI;
);
ENDNEWTYPE;
n2 := fact (n1)
Previous slide
Next slide
Back to first slide
View graphic version