Question: write in python CS2ME3/SE2AA4 CS2ME3/SE2AA4 Set of Integers Abstract Data Type Template Module SetOfInt Access Routine Semantics new SetOfInt(a): transition: 8:=U(x:ZZ EX, : {w}) output:

write in python
CS2ME3/SE2AA4 CS2ME3/SE2AA4 Set of Integers Abstract Data Type Template Module SetOfInt Access Routine Semantics new SetOfInt(a): transition: 8:=U(x:ZZ EX, : {w}) output: out := self Uses None exception: none is member(30): Syntax Exported Types SetOfInt = ? Exported Constants None output: IES exception: none to seqo: output: out := set to seq(s) exception: none union(t): output: SetOfInt(set to seq(8)||t.to seq0) # in case it is clearer, an alternate version of output is: SetOfInt(set to seq(s U {1: ZI E t.to seq0:2})) Exceptions seq of Z Exported Access Programs Routine name In Out new SetOfInt SetOfInt is member B to seg union Set Oflnt SetOfInt diff SetOfInt SetOfInt size N empty B equals Set OfInt B seq of z exception: none diff(t): output: SetOfInt(set to seq(sn complement(t.to seq0))) Semantics exception: none size(): State Variables output: 18 $: set of z State Invariant None exception: none empty Assumptions The Set OfInt constructor is called for each object instance before any other access routine is called for that object. The constructor can only be called once. All access programs will have inputs provided that match the types given in the specification. output: 8 = exception: none equals(t): output: (x: ZEZ: t.to seq Ares) # this means: t.to seg() = s exception: none Page 6 of 15 Page 7 of 15
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
