diff options
author | Camil Staps | 2016-02-02 19:24:50 +0100 |
---|---|---|
committer | Camil Staps | 2016-02-02 19:24:50 +0100 |
commit | a7d7542dc646a5fd124ef71e71ce260889f1701b (patch) | |
tree | 04ed89503bbb3cc9933273a1326a53ca724c3492 /files/practicum/TupleOverloadingTest.icl | |
parent | week6 camil: working positioning of lines by putting empties at left and righ... (diff) |
Diffstat (limited to 'files/practicum/TupleOverloadingTest.icl')
-rw-r--r-- | files/practicum/TupleOverloadingTest.icl | 64 |
1 files changed, 0 insertions, 64 deletions
diff --git a/files/practicum/TupleOverloadingTest.icl b/files/practicum/TupleOverloadingTest.icl deleted file mode 100644 index 91417f7..0000000 --- a/files/practicum/TupleOverloadingTest.icl +++ /dev/null @@ -1,64 +0,0 @@ -module TupleOverloadingTest - -/* Test module VectorOverloading - Voor werken met Gast: - (*) gebruik Environment 'Gast' - (*) zet Project Options op 'Basic Values Only' -*/ - -import TupleOverloading -import StdEnv -import gast - -Start - = testn 1000 - (\v -> - zero_is_neutral_for_addition v /\ - zero_is_neutral_for_subtraction v /\ - one_is_neutral_for_multiplication v /\ - one_is_neutral_for_division v /\ - negation_is_idempotent v /\ - add_then_subtract_yields_identity v /\ - subtract_then_add_yields_identity v /\ - True - ) - -:: Vector2 a :== (a,a) -:: BaseType - :== Int -// :== Real - -zero_is_neutral_for_addition :: (Vector2 BaseType) -> Property -zero_is_neutral_for_addition a = name "zero_is_neutral_for_addition" - (zero + a == a && a == a + zero) - -zero_is_neutral_for_subtraction :: (Vector2 BaseType) -> Property -zero_is_neutral_for_subtraction a = name "zero_is_neutral_for_subtraction" - (a - zero == a && a == ~ (zero - a)) - -one_is_neutral_for_multiplication :: (Vector2 BaseType) -> Property -one_is_neutral_for_multiplication a = name "one_is_neutral_for_multiplication" - (one * a == a && a == a * one) - -zero_is_zero_for_multiplication :: (Vector2 BaseType) -> Property -zero_is_zero_for_multiplication a = name "zero_is_zero_for_multiplication" - (zero * a == zero && zero == a * zero) - -one_is_neutral_for_division :: (Vector2 BaseType) -> Property -one_is_neutral_for_division a = name "one_is_neutral_for_division" - (a / one == a) - -negation_is_idempotent :: (Vector2 BaseType) -> Property -negation_is_idempotent a = name "negation_is_idempotent" - (~ (~ a) == a) - - -add_then_subtract_yields_identity :: (Vector2 BaseType) -> Property -add_then_subtract_yields_identity a = name "add then subtract" ((a + a) - a == a) - -subtract_then_add_yields_identity :: (Vector2 BaseType) -> Property -subtract_then_add_yields_identity a = name "subtract then add" ((zero - a - a) + a + a == zero) - -//derive genShow (,) -//derive ggen (,) -derive bimap [] |