with ada.text_io; use ada.text_io; with ada.integer_text_io; use ada.integer_text_io; procedure statpred is subtype grade is character range 'A' .. 'F' with static_predicate => grade /= 'E'; subtype tennis_score is Natural range 0 .. 40 with static_predicate => tennis_score in 0 | 15 | 30 | 40; type score is range 0 .. 40; package score_io is new ada.text_io.integer_io(score); use score_io; g : grade; t: tennis_score; s: score; begin for i in grade loop put(i); -- Output: ABCDF end loop; new_line; for i in tennis_score loop put(i); -- 0, 15, 30, 40 end loop; new_line; return; -- Let's skip the examples below showing more I/O of these types pragma warnings(off,"unreachable code"); -- Turn off compiler warning that code below is unreachable get(s); put(s); loop get(t); put(t); end loop; loop get(g); put(g); end loop; pragma warnings(off,"unreachable code"); -- No real need for this, except showing turning warnings back on end statpred; -- OUTPUT: -- ABCDF -- 0 15 30 40