aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorN.N. <matju@users.sourceforge.net>2006-01-04 02:59:22 +0000
committerN.N. <matju@users.sourceforge.net>2006-01-04 02:59:22 +0000
commit5f6d41f608ba8c7db79d6987bf4876c7faea918e (patch)
tree82f174e3e78c8af747ccc70101cc194264d5ca4f
parent1efdb5dece2e1b9281a716e0a52578d62ab757d4 (diff)
.
svn path=/trunk/abstractions/pureunity/; revision=4361
-rw-r--r--ChangeLog17
-rw-r--r--README50
-rw-r--r--TODO8
-rw-r--r--generics/protocols-tree.pd40
-rw-r--r--main.pd72
-rw-r--r--specifics/arith-test.pd115
-rw-r--r--specifics/comparators-test.pd58
-rw-r--r--specifics/glue-test.pd15
8 files changed, 265 insertions, 110 deletions
diff --git a/ChangeLog b/ChangeLog
index ccf3d3b..9b27af3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,9 +1,16 @@
-$Id: ChangeLog,v 1.2 2005-12-31 18:44:54 matju Exp $
+$Id: ChangeLog,v 1.3 2006-01-04 02:59:22 matju Exp $
version 0.1:
* LICENSE is GPL
* README
- * [commutator], [commutative-test]
- * [associator], [associative-test]
- * [invertor], [invertible-test]
- * [distributor], [distributive-test]
+ * new object classes:
+ * [commutator], [commutative-test]
+ * [associator], [associative-test]
+ * [invertor], [invertible-test]
+ * [distributor], [distributive-test]
+ * [twice], [3times], [4times], [^]
+ * [tree], [protocol-tree]
+ * [rtimer]
+ * for $1 in f,~,#:
+ [$1.norm], [$1.taa], [$1.do], [$1.packunpack3], [$1.swap]
+ [$1.inlet], [$1.outlet]
diff --git a/README b/README
index 2235492..074c401 100644
--- a/README
+++ b/README
@@ -1,4 +1,4 @@
-$Id: README,v 1.6 2005-12-31 21:29:37 matju Exp $
+$Id: README,v 1.7 2006-01-04 02:59:22 matju Exp $
PureUnity
@@ -49,18 +49,18 @@ TEST PROTOCOL
outlet 0:
test results. a sequence of lists like:
- list $name $passed? $accuracy $elapsed
+ list $passed? $accuracy $elapsed $name1 ...
where:
- $name is a symbol
$passed? is either 0 for failure or 1 for success
$accuracy is a float proportional to relative error on math
(if not applicable, use 0)
- $elapsed is a float, the time elapsed in milliseconds
- or it is the symbol "-" if not measured.
+ $elapsed is a nonnegative float, the time elapsed in milliseconds
+ or it is any negative float meaning the time hasn't been measured.
+ $name1 and the rest are symbols and/or floats identifying the test
for example:
- list commutative1 1 0 -
+ list 1 0 -1 commutative f + *
Which means that the 1st test about commutativity passed ($2=1) because it
was perfectly accurate ($3==0) and that we didn't measure the time ($4=-).
@@ -173,9 +173,9 @@ abstraction arguments.
CURRENT:
f float
+ ~ signal
FUTURE (from PureData):
- ~ signal
s symbol
p gpointer
a anything
@@ -199,6 +199,42 @@ FUTURE (from GridFlow):
#d grid of doubles (float64)
#r grid of rubies (VALUE*)
+for a type prefix to be considered implemented, it has to
+have the following class set:
+
+ metaabstraction for floats for signals for grids
+ [$1.inlet] [inlet] [inlet~] [inlet]
+ [$1.outlet] [outlet] [outlet~] [outlet]
+ [$1.do $2 $3] [$2 $3] [$2~ $3] [# $2 $3]
+ [$1.taa] [t a a] noop [t a a]
+ [$1.swap] [swap] noop TODO
+ [$1.norm] [abs] [env~] [# sq]->[#ravel]->[#fold +]->[#export]->[sqrt]
+ [$1.packunpack3] pack,unpack noop TODO
+
+The first two cannot be implemented as abstractions and instead must be
+defined as aliases in pureunity.c.
+
++-+-+--+---+-----+--------+-------------+---------------------+
+OTHER PROTOCOLS
+
+Those four classes are operators that give verify algebraic properties
+of other operators. The more their outputs are close to zero, the more
+those other operators are faithful to an algebraic property.
+
+(here, supported $types are f and ~)
+
+[commutator $type $class] (2 inlets) ab-ba
+[associator $type $class] (2 inlets) (ab)c-a(bc)
+[distributor $type $class1 $class2] (3 inlets) a(b+c)-(ab+ac)
+[invertor $type $class1 $class2] (2 inlets) ab/b-a
+
++-+-+--+---+-----+--------+-------------+---------------------+
+TESTS AND RULES
+
+For each class, a test file's name is the class name followed by "-test.pd",
+and a rule file's name is the class name followed by "-rule.pd",
+in the same way as it is for help files.
+
+-+-+--+---+-----+--------+-------------+---------------------+
ETC
diff --git a/TODO b/TODO
index 6986cdd..f198263 100644
--- a/TODO
+++ b/TODO
@@ -1,7 +1,11 @@
-$Id: TODO,v 1.2 2005-12-31 18:44:54 matju Exp $
+$Id: TODO,v 1.3 2006-01-04 02:59:22 matju Exp $
TODO:
* benchmark
* signals
* grids
- * norms \ No newline at end of file
+
+ * transitive, antisymmetric, predicate
+ * contracts : *-rule.pd
+
+ * tests for the frameworks' own components?
diff --git a/generics/protocols-tree.pd b/generics/protocols-tree.pd
index 79b7a30..193b622 100644
--- a/generics/protocols-tree.pd
+++ b/generics/protocols-tree.pd
@@ -8,7 +8,6 @@
#X obj 19 100 pack s s;
#X obj 79 81 loadbang;
#X obj 19 62 makefilename \$0-%s;
-#X obj 86 222 print;
#X obj 423 157 tree \$0 reflexive;
#X obj 594 157 tree \$0 antireflexive;
#X obj 423 135 tree \$0 partialorder;
@@ -31,31 +30,30 @@
#X obj 423 276 tree \$0 relation;
#X msg 19 119 \; \$1 symbol \$2;
#X connect 0 0 8 0;
-#X connect 0 0 9 0;
#X connect 1 0 3 0;
#X connect 2 0 6 1;
-#X connect 6 0 30 0;
+#X connect 6 0 29 0;
#X connect 7 0 2 0;
#X connect 8 0 6 0;
-#X connect 10 0 29 0;
-#X connect 11 0 24 0;
-#X connect 11 0 29 0;
+#X connect 9 0 28 0;
+#X connect 10 0 23 0;
+#X connect 10 0 28 0;
+#X connect 11 0 9 0;
+#X connect 11 0 20 0;
+#X connect 11 0 25 0;
#X connect 12 0 10 0;
-#X connect 12 0 21 0;
-#X connect 12 0 26 0;
+#X connect 12 0 20 0;
#X connect 13 0 11 0;
-#X connect 13 0 21 0;
+#X connect 13 0 19 0;
#X connect 14 0 12 0;
-#X connect 14 0 20 0;
-#X connect 15 0 13 0;
+#X connect 14 0 19 0;
+#X connect 15 0 5 0;
+#X connect 15 0 9 0;
#X connect 15 0 20 0;
-#X connect 16 0 5 0;
-#X connect 16 0 10 0;
-#X connect 16 0 21 0;
-#X connect 21 0 29 0;
-#X connect 22 0 17 0;
-#X connect 23 0 19 0;
-#X connect 23 0 22 0;
-#X connect 25 0 18 0;
-#X connect 25 0 23 0;
-#X connect 28 0 25 0;
+#X connect 20 0 28 0;
+#X connect 21 0 16 0;
+#X connect 22 0 18 0;
+#X connect 22 0 21 0;
+#X connect 24 0 17 0;
+#X connect 24 0 22 0;
+#X connect 27 0 24 0;
diff --git a/main.pd b/main.pd
index 6c10bf6..c4bf047 100644
--- a/main.pd
+++ b/main.pd
@@ -1,9 +1,9 @@
-#N canvas 385 232 448 442 10;
-#X obj 41 85 arith-test f;
-#X obj 19 20 loadbang;
-#X obj 28 42 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1
+#N canvas 841 0 408 486 10;
+#X obj 63 169 arith-test f;
+#X obj 19 65 loadbang;
+#X obj 28 87 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1
-1;
-#X obj 41 180 print;
+#X obj 41 373 print;
#N canvas 509 382 450 300 other 0;
#X obj 20 38 twice symbol foo bar;
#X obj 20 21 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1
@@ -23,30 +23,46 @@
#X connect 5 0 4 0;
#X connect 6 0 8 0;
#X connect 8 0 7 0;
-#X restore 218 29 pd other;
-#X obj 19 66 t b b b;
-#X obj 71 161 +;
-#X msg 121 161 0;
-#X msg 71 123 float \$1;
-#X obj 41 104 t a a;
-#X obj 96 161 t f;
-#X obj 19 153 f;
-#X obj 71 142 == 0;
-#X obj 19 199 print total_failures;
-#X obj 30 219 sel 0;
-#X obj 38 280 bng 100 250 50 0 empty empty empty 0 -6 0 8 -24198 -1
--262144;
-#X msg 38 261 color \$1 \, bang;
-#X msg 30 238 16;
-#X msg 60 238 13;
-#X text 24 392 This does not count errors not reported by the tests
+#X restore 323 80 pd other;
+#X obj 19 111 t b b b;
+#X obj 71 354 +;
+#X msg 121 354 0;
+#X msg 71 316 float \$1;
+#X obj 41 297 t a a;
+#X obj 96 354 t f;
+#X obj 19 346 f;
+#X obj 71 335 == 0;
+#X obj 19 392 print total_failures;
+#X obj 226 251 sel 0;
+#X obj 234 312 bng 100 250 50 0 empty empty empty 0 -6 0 8 -258699
+-1 -262144;
+#X msg 234 293 color \$1 \, bang;
+#X msg 226 270 16;
+#X msg 256 270 13;
+#X text 24 437 This does not count errors not reported by the tests
;
-#X text 25 406 Consult the console for more information;
+#X text 25 464 Consult the console for more information;
+#X obj 41 188 comparators-test f;
+#X obj 4 6 cnv 15 400 40 empty empty PureUnity 8 20 1 18 -34345 -68160
+0;
+#X text 130 7 TM;
+#X obj 15 35 cnv 1 380 1 empty empty Copyright_2006_by_Mathieu_Bouchard
+150 -4 1 9 -258699 -262144 0;
+#X text 25 450 Such as Syntax Error \, Class Not Found \, etc.;
+#X text 297 253 Green: PASS;
+#X text 311 265 Red: FAIL;
+#X obj 85 150 glue-test;
+#X obj 41 131 t b b b;
+#X text 6 48 from the bit rot prevention department;
+#X obj 284 149 protocols-tree;
+#X obj 284 168 print;
+#X symbolatom 284 133 10 0 0 0 - - -;
+#X msg 284 114 symbol field;
#X connect 0 0 9 0;
#X connect 1 0 5 0;
#X connect 2 0 5 0;
#X connect 5 0 11 0;
-#X connect 5 1 0 0;
+#X connect 5 1 29 0;
#X connect 5 2 7 0;
#X connect 6 0 10 0;
#X connect 6 0 11 1;
@@ -63,3 +79,11 @@
#X connect 16 0 15 0;
#X connect 17 0 16 0;
#X connect 18 0 16 0;
+#X connect 21 0 9 0;
+#X connect 28 0 9 0;
+#X connect 29 0 21 0;
+#X connect 29 1 0 0;
+#X connect 29 2 28 0;
+#X connect 31 0 32 0;
+#X connect 33 0 31 0;
+#X connect 34 0 33 0;
diff --git a/specifics/arith-test.pd b/specifics/arith-test.pd
index 3136228..e9b7375 100644
--- a/specifics/arith-test.pd
+++ b/specifics/arith-test.pd
@@ -1,63 +1,76 @@
-#N canvas 365 120 687 494 10;
-#X text 18 12 This is the testclass for + \, - \, * \, / \, % \, mod
-\, ^ \, & \, |;
+#N canvas 69 22 726 501 10;
#X text 78 136 Abelian Groups:;
#X text 80 229 Abelian Monoids:;
-#X text 79 299 Rings (incl Fields):;
+#X text 79 349 Rings (incl Fields):;
#X obj 134 87 r \$0-b;
-#X obj 299 87 r \$0-b;
-#X obj 450 87 r \$0-b;
-#X obj 16 59 s \$0-b;
-#X obj 16 40 inlet bang;
-#X obj 14 414 r \$0-r;
-#X obj 14 433 outlet reports;
-#X obj 134 406 s \$0-r;
-#X obj 299 406 s \$0-r;
-#X obj 450 406 s \$0-r;
+#X obj 309 87 r \$0-b;
+#X obj 460 87 r \$0-b;
+#X obj 26 69 s \$0-b;
+#X obj 26 50 inlet bang;
+#X obj 14 464 r \$0-r;
+#X obj 14 483 outlet reports;
+#X obj 134 456 s \$0-r;
+#X obj 309 456 s \$0-r;
+#X obj 460 456 s \$0-r;
#X obj 134 157 commutative-test \$1 +;
+#X obj 134 367 distributive-test \$1 + *;
+#X obj 309 177 associative-test \$1 *;
+#X obj 460 177 invertible-test \$1 * /;
#X obj 134 177 commutative-test \$1 *;
#X obj 134 197 commutative-test \$1 ^;
#X obj 134 247 commutative-test \$1 &;
#X obj 134 267 commutative-test \$1 |;
-#X obj 134 317 distributive-test \$1 + *;
-#X obj 134 337 distributive-test \$1 ^ &;
-#X obj 299 247 associative-test \$1 &;
-#X obj 299 267 associative-test \$1 |;
-#X obj 299 157 associative-test \$1 +;
-#X obj 299 177 associative-test \$1 *;
-#X obj 299 197 associative-test \$1 ^;
-#X obj 450 197 invertible-test \$1 ^ ^;
-#X obj 450 177 invertible-test \$1 * /;
-#X obj 450 157 invertible-test \$1 + -;
-#X connect 4 0 14 0;
+#X obj 309 247 associative-test \$1 &;
+#X obj 309 267 associative-test \$1 |;
+#X obj 309 157 associative-test \$1 +;
+#X obj 309 197 associative-test \$1 ^;
+#X obj 460 197 invertible-test \$1 ^ ^;
+#X obj 460 157 invertible-test \$1 + -;
+#X obj 134 387 distributive-test \$1 ^ &;
+#X text 17 11 This is the testclass for + \, - \, * \, / \, div \,
+pow \, % \, mod;
+#X obj 134 296 commutative-test \$1 min;
+#X obj 134 317 commutative-test \$1 max;
+#X obj 309 296 associative-test \$1 min;
+#X obj 309 316 associative-test \$1 max;
+#X text 18 25 And also for & \, | \, ^ \, min \, max;
+#X connect 3 0 13 0;
+#X connect 3 0 14 0;
+#X connect 3 0 17 0;
+#X connect 3 0 18 0;
+#X connect 3 0 19 0;
+#X connect 3 0 20 0;
+#X connect 3 0 27 0;
+#X connect 3 0 29 0;
+#X connect 3 0 30 0;
#X connect 4 0 15 0;
-#X connect 4 0 16 0;
-#X connect 4 0 17 0;
-#X connect 4 0 18 0;
-#X connect 4 0 19 0;
-#X connect 4 0 20 0;
-#X connect 5 0 21 0;
-#X connect 5 0 22 0;
-#X connect 5 0 23 0;
-#X connect 5 0 24 0;
+#X connect 4 0 21 0;
+#X connect 4 0 22 0;
+#X connect 4 0 23 0;
+#X connect 4 0 24 0;
+#X connect 4 0 31 0;
+#X connect 4 0 32 0;
+#X connect 5 0 16 0;
#X connect 5 0 25 0;
-#X connect 6 0 26 0;
-#X connect 6 0 27 0;
-#X connect 6 0 28 0;
-#X connect 8 0 7 0;
-#X connect 9 0 10 0;
-#X connect 14 0 11 0;
+#X connect 5 0 26 0;
+#X connect 7 0 6 0;
+#X connect 8 0 9 0;
+#X connect 13 0 10 0;
+#X connect 14 0 10 0;
#X connect 15 0 11 0;
-#X connect 16 0 11 0;
-#X connect 17 0 11 0;
-#X connect 18 0 11 0;
-#X connect 19 0 11 0;
-#X connect 20 0 11 0;
-#X connect 21 0 12 0;
-#X connect 22 0 12 0;
-#X connect 23 0 12 0;
-#X connect 24 0 12 0;
+#X connect 16 0 12 0;
+#X connect 17 0 10 0;
+#X connect 18 0 10 0;
+#X connect 19 0 10 0;
+#X connect 20 0 10 0;
+#X connect 21 0 11 0;
+#X connect 22 0 11 0;
+#X connect 23 0 11 0;
+#X connect 24 0 11 0;
#X connect 25 0 12 0;
-#X connect 26 0 13 0;
-#X connect 27 0 13 0;
-#X connect 28 0 13 0;
+#X connect 26 0 12 0;
+#X connect 27 0 10 0;
+#X connect 29 0 10 0;
+#X connect 30 0 10 0;
+#X connect 31 0 11 0;
+#X connect 32 0 11 0;
diff --git a/specifics/comparators-test.pd b/specifics/comparators-test.pd
new file mode 100644
index 0000000..0bb640b
--- /dev/null
+++ b/specifics/comparators-test.pd
@@ -0,0 +1,58 @@
+#N canvas 365 120 687 494 10;
+#X obj 134 87 r \$0-b;
+#X obj 329 87 r \$0-b;
+#X obj 26 69 s \$0-b;
+#X obj 26 50 inlet bang;
+#X obj 14 414 r \$0-r;
+#X obj 14 433 outlet reports;
+#X obj 134 406 s \$0-r;
+#X obj 329 406 s \$0-r;
+#X text 17 11 This is the testclass for == \, != \, < \, > \, <= \,
+>= \, && \, ||;
+#X obj 329 157 equivalence-test \$1 ==;
+#X obj 329 257 totalordereq-test \$1 == >=;
+#X obj 329 237 totalordereq-test \$1 == <=;
+#X obj 329 217 totalorder-test \$1 == >;
+#X obj 329 197 totalorder-test \$1 == <;
+#X obj 329 297 associative-test \$1 &&;
+#X obj 329 317 associative-test \$1 ||;
+#X obj 134 157 commutative-test \$1 ==;
+#X obj 134 177 commutative-test \$1 !=;
+#X obj 134 297 commutative-test \$1 &&;
+#X obj 134 317 commutative-test \$1 ||;
+#X obj 134 197 antisymmetric-test \$1 <;
+#X obj 134 217 antisymmetric-test \$1 >;
+#X obj 134 237 antisymmetric-test \$1 <=;
+#X obj 134 257 antisymmetric-test \$1 >=;
+#X connect 0 0 16 0;
+#X connect 0 0 17 0;
+#X connect 0 0 18 0;
+#X connect 0 0 19 0;
+#X connect 0 0 20 0;
+#X connect 0 0 21 0;
+#X connect 0 0 22 0;
+#X connect 0 0 23 0;
+#X connect 1 0 9 0;
+#X connect 1 0 10 0;
+#X connect 1 0 11 0;
+#X connect 1 0 12 0;
+#X connect 1 0 13 0;
+#X connect 1 0 14 0;
+#X connect 1 0 15 0;
+#X connect 3 0 2 0;
+#X connect 4 0 5 0;
+#X connect 9 0 7 0;
+#X connect 10 0 7 0;
+#X connect 11 0 7 0;
+#X connect 12 0 7 0;
+#X connect 13 0 7 0;
+#X connect 14 0 7 0;
+#X connect 15 0 7 0;
+#X connect 16 0 6 0;
+#X connect 17 0 6 0;
+#X connect 18 0 6 0;
+#X connect 19 0 6 0;
+#X connect 20 0 6 0;
+#X connect 21 0 6 0;
+#X connect 22 0 6 0;
+#X connect 23 0 6 0;
diff --git a/specifics/glue-test.pd b/specifics/glue-test.pd
new file mode 100644
index 0000000..7d3fa2a
--- /dev/null
+++ b/specifics/glue-test.pd
@@ -0,0 +1,15 @@
+#N canvas 185 138 665 479 10;
+#X obj 26 69 s \$0-b;
+#X obj 26 50 inlet bang;
+#X obj 14 414 r \$0-r;
+#X obj 14 433 outlet reports;
+#X obj 176 111 func2-test float;
+#X obj 176 131 func2-test symbol;
+#X obj 176 151 func2-test int;
+#X obj 176 91 func1-test bang;
+#X text 346 19 todo: send \, receive \, select \, route;
+#X text 346 32 todo: pack \, unpack \, trigger \, spigot;
+#X text 346 45 todo: moses \, until \, print \, makefilename;
+#X text 346 58 todo: change \, swap \, value;
+#X connect 1 0 0 0;
+#X connect 2 0 3 0;