Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
concept
package metaobjectTest
import generic
@doc{*
Annotation 'concept' should be attached to a prototype. It tests
whether one or more prototypes obey some restrictions. That
includes parameters to the generic prototype.
*}
object Concept
func run {
var GroupWork<IntGroupPlus> gwi = GroupWork<IntGroupPlus> new;
var a = IntGroupPlus(1);
var b = IntGroupPlus(5);
var c = IntGroupPlus(11);
var zero = IntGroupPlus(0);
assert a inverse inverse == a;
assert a unit == zero;
assert a * a inverse == zero;
assert a * a unit == a;
assert (b inverse * a inverse) * a * b == a unit;
assert (c inverse * b inverse * a inverse) * a * b * c == zero;
assert b * b * a == c && c * b inverse * a inverse == b;
GroupWork<IntGroupPlus> work: a, b, c;
GroupWork<IntGroupPlus> workout: a, b, c;
}
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.