List of articles   Terminology   Choose language


Abbreviated syntax of permutation


In records

I propose to write permutation as

select *
  from a, x
  where @a1~@x1 and @a2~@x1 and @a3~@x1;
instead of bulky expression
select *
  from a
  where @a1<>@a2 and @a2<>@a3 and @a1<>@a3 and
    @a1 in (select @x1 from x) and
    @a2 in (select @x1 from x) and
    @a3 in (select @x1 from x);

Or for example

select @a1,@b1,@c1
  from a,b,c, x
  where @a1~@x1 and @b1~@x1 and @c1~@x1;
instead of
select @a1,@b1,@c1
  from a,b,c
  where @a1<>@b1 and @b1<>@c1 and @a1<>@c1 and
    @a1 in (select @x1 from x) and
    @b1 in (select @x1 from x) and
    @c1 in (select @x1 from x);

In rational or xml-tree

If abbreviated syntax of permutation for tree without spec-symbols

select *
  from a.b.c, x
  where a1~x1 and b1~x1 and c1~x1;
still has bulky classical analog
select *
  from a.b.c
  where a1<>b1 and b1<>c1 and a1<>c1 and
    a1 in (select x1 from x) and
    b1 in (select x1 from x) and
    c1 in (select x1 from x);
then abbreviated syntax of permutation for tree with spec-symbols (what is actual for task of travelling salesman) has no traditional analog
select *
  from a.b*.c, x
  where b1~x1;
it means something like
select *
  from a.b[@b1 as k1].b[@b1 as m1].b[@b1 as n1].b[@b1 as p1].b[@b1 as q1].b[@b1 as r1].b[@b1 as s1]. ... .c
  where k1<>m1 and m1<>n1 and k1<>n1 and
    k1 in (select x1 from x) and
    m1 in (select x1 from x) and
    n1 in (select x1 from x) and
    p1 in (select x1 from x) and
    q1 in (select x1 from x) and
    r1 in (select x1 from x) and
    s1 in (select x1 from x) and ... ;

Dmitry Turin



List of articles   Terminology   Choose language