<> <> <> DIRECTORY PBasics USING [Comparison]; ConstArith: DEFINITIONS = BEGIN Const: TYPE = RECORD [ sign: ConstSign, low: CARD, high: CARD]; ConstSign: TYPE = {negative, zero, positive}; <> Overflow: ERROR; DivByZero: ERROR; <> FromCard: PROC [card: CARD] RETURNS [Const]; FromInt: PROC [int: INT] RETURNS [Const]; ToCard: PROC [const: Const] RETURNS [CARD]; ToInt: PROC [const: Const] RETURNS [INT]; <> Add: PROC [x,y: Const] RETURNS [Const]; Sub: PROC [x,y: Const] RETURNS [Const]; Div: PROC [x,y: Const] RETURNS [Const]; Mod: PROC [x,y: Const] RETURNS [Const]; DivMod: PROC [x,y: Const] RETURNS [q, r: Const]; Mul: PROC [x,y: Const] RETURNS [Const]; Abs: PROC [c: Const] RETURNS [Const]; Neg: PROC [c: Const] RETURNS [Const]; <> Compare: PROC [c1,c2: Const] RETURNS [PBasics.Comparison]; END.