SetsTest.cm
Last tweaked by Mike Spreitzer on December 14, 1987 4:50:14 pm PST
Install SetsPackage
← &r1 ← BiRels.CreateHashReln[[NIL, NIL], ALL[TRUE], ALL[TRUE]]
← &r1.class.AddPair[&r1, [[a[$foo]], [a[$bar]]], ALL[ALL[TRUE]]]
← &s1 ← AbSets.Set[AbSets.GetSingletonClass[SetBasics.basic], [a[$foo]]]
← &i1 ← &r1.class.Image[&r1, &s1, leftToRight]
← &r1.class.AddPair[&r1, [[a[$bar]], [a[$gronk]]], ALL[ALL[TRUE]]]
← &r1.class.AddPair[&r1, [[a[$gronk]], [a[$foo]]], ALL[ALL[TRUE]]]
← &r1
← &c1 ← BiRels.Compose[&r1, &r1, ALL[FALSE]]
← &r2 ← BiRels.CreateList[NIL, [TRUE, FALSE], ALL[SetBasics.basic], variable, [ALL[fwd]], FALSE]
← &r2.class.AddPair[&r2, [[a[$foo]], [i[1]]], ALL[ALL[TRUE]]]
← &r2.class.AddPair[&r2, [[a[$bar]], [i[7]]], ALL[ALL[TRUE]]]
← &r2.class.AddPair[&r2, [[i[3]], [a[$baz]]], ALL[ALL[TRUE]]]
← &r2.class.AddPair[&r2, [[i[1]], [a[$oof]]], ALL[ALL[TRUE]]]
← &r2
← &r2.class.AddPair[&r2, [[a[$bar]], [i[3]]], ALL[ALL[TRUE]]]
← &r2
← &l1 ← AbSets.CreateList[LIST[[i[10]], [i[30]], [i[20]]], SetBasics.basic, variable, fwd]
← &l1.class.AddSet[&l1, [AbSets.GetSingletonClass[SetBasics.basic], [i[15]]]]
← &l1
← &l1.class.AddSet[&l1, [AbSets.GetSingletonClass[SetBasics.basic], [i[20]]]]
← &l1
← &v1 ← BiRels.CreateSimple[bounds: [0, 9], val: [a[$foo]], rightSpace: SetBasics.basic]
← &v1.class.AddPair[&v1, [[i[3]], [a[$bar]]], ALL[ALL[TRUE]]]
← &v1.class.AddPair[&v1, [[i[13]], [a[$bar]]], ALL[ALL[TRUE]]]
← &v1.class.RemSet[&v1, [BiRels.GetSingletonClass[[SetBasics.ints, SetBasics.basic]], NEW [BiRels.Pair ← [ [i[5]], [a[$foo]] ]] ]]
← &v1.class.RemSet[&v1, [BiRels.GetSingletonClass[[SetBasics.ints, SetBasics.basic]], NEW [BiRels.Pair ← [ [i[4]], [a[$zork]] ]] ]]
← &v1.class.RemSet[&v1, [BiRels.GetSingletonClass[[SetBasics.ints, SetBasics.basic]], NEW [BiRels.Pair ← [ [i[40]], [a[$zork]] ]] ]]
← &v1
← &v1.class.Image[&v1, AbSets.IIAsSet[[0, 20]], leftToRight]
← &l2 ← AbSets.CreateList[LIST[[a["y"]], [a["x"]], [a["z"]]], SetBasics.ropes[TRUE], variable, no]
← BiRels.EnumSeqOfSet[&l2, fwd]
← BiRels.EnumSeqOfSet[&l2, bwd]
← &s2 ← BiRels.EnumSeqOfSet[&l2, no]
← &s2.class.GetBounds[&s2, ALL[TRUE], [ALL[fwd]]]!!!
← &l2.class.AddSet[&l2, [AbSets.GetSingletonClass[SetBasics.ropes[TRUE]], [a["xyz"]]]]
← &l2
← &s2
← &p1 ← BiRels.GradeUp[&s2, [SetBasics.ropes[TRUE].Compare, SetBasics.ropes[TRUE].data]]
← &s3 ← BiRels.CreateSimple[rightSpace: SetBasics.ropes[TRUE]]
← BiRels.TransPermute[&s2, &s3, &p1]
← &s3
← &s2b ← BiRels.CreateSimpleCopy[of: &s2, rightSpace: SetBasics.ropes[TRUE]]
← BiRels.PermuteInPlace[&s2b, &p1]
← &s2b