RosettaCodeData/Task/Twelve-statements/Ada/twelve-statements-2.ada
Ingy döt Net 68f8f3e56b all tasks
2013-04-11 01:07:29 -07:00

16 lines
476 B
Ada

generic
Number_Of_Statements: Positive;
package Logic is
--types
subtype Indices is Natural range 1 .. Number_Of_Statements;
type Table is array(Indices range <>) of Boolean;
type Predicate is access function(T: Table) return Boolean;
type Statements is array(Indices) of Predicate;
type Even_Odd is (Even, Odd);
-- convenience functions
function Sum(T: Table) return Natural;
function Half(T: Table; Which: Even_Odd) return Table;
end Logic;