RosettaCodeData/Task/A+B/Maude/a+b-2.maude
2016-12-05 23:44:36 +01:00

12 lines
229 B
Text

fmod ADD is
protecting INT .
op undefined : -> Int .
op _add_ : Int Int -> Int [assoc comm] .
vars A B : Int .
eq A add B = if (A < -1000 or B < -1000) or (A > 1000 or B > 1000) then undefined else A + B fi .
endfm