// Shows the derivation of the generalized matrix inner product in
// terms of the outer product of enclosed arrays
proc main()
{
var a = [[1,2],[5,4],[3,0]];
var b = [[6,2,3,4],[7,0,1,8]];
var aa, bb, c, d;
aa = a.enclose(-1);
bb = b.enclose(0);
c = aa.outer(`*,bb);
"", c, '\n';
d = foreach (c#[i]) {c#[i].disclose().reduce(`+)};
"", d, " ", a.inner(`+,`*,b),'\n';
}