RosettaCodeData/Task/A+B/Maude/a+b-2.maude
2023-07-01 13:44:08 -04: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