Studies of Euler diagrams/find segments

The function  is an attempt to automate most of the thinking that goes into the drawing of an Euler diagram. It lists all found segments by dimension:
 * 0-dimensional: cells
 * 1-dimensional: borders between cells
 * n-dimensional: crossings of n borders surrounded by 2n cells

Multicrossings are crossings of n borders surrounded by less than 2n cells. Finding them as well is a problem to be solved.

This does not help to find gapspots. E.g. for functions like only the cells are found.



{'+−−−': [1], '−−+−': [4], '+−+−': [5], '−++−': [6], '+++−': [7], '−−−+': [8], '+−−+': [9], '−+−+': [10], '++−+': [11], '−−++': [12]} A   {'0−+−': [4, 5], '0++−': [6, 7], '0−−+': [8, 9], '0+−+': [10, 11]} B   {'−0+−': [4, 6], '+0+−': [5, 7], '−0−+': [8, 10], '+0−+': [9, 11]} C   {'+−0−': [1, 5], '−−0+': [8, 12]} D   {'+−−0': [1, 9], '−−+0': [4, 12]} A,B   {'00+−': [4, 5, 6, 7], '00−+': [8, 9, 10, 11]}
 * 1) 0
 * 1) 1
 * 1) 2



{'+−−−': [1], '++−−': [3], '−−+−': [4], '+−+−': [5], '−+−+': [10], '++−+': [11], '−−++': [12], '−+++': [14]} A   {'0−+−': [4, 5], '0+−+': [10, 11]} B   {'+0−−': [1, 3], '−0++': [12, 14]} C   {'+−0−': [1, 5], '−+0+': [10, 14]} D   {'++−0': [3, 11], '−−+0': [4, 12]}
 * 1) 0
 * 1) 1



{'−−−−': [0], '+−−−': [1], '−+−−': [2], '++−−': [3], '−−+−': [4], '+−+−': [5], '−++−': [6], '+++−': [7], '−−−+': [8], '+−−+': [9], '−+−+': [10], '−−++': [12], '−+++': [14]} A   {'0−−−': [0, 1], '0+−−': [2, 3], '0−+−': [4, 5], '0++−': [6, 7], '0−−+': [8, 9]} B   {'−0−−': [0, 2], '+0−−': [1, 3], '−0+−': [4, 6], '+0+−': [5, 7], '−0−+': [8, 10], '−0++': [12, 14]} C   {'−−0−': [0, 4], '+−0−': [1, 5], '−+0−': [2, 6], '++0−': [3, 7], '−−0+': [8, 12], '−+0+': [10, 14]} D   {'−−−0': [0, 8], '+−−0': [1, 9], '−+−0': [2, 10], '−−+0': [4, 12], '−++0': [6, 14]} A,B   {'00−−': [0, 1, 2, 3], '00+−': [4, 5, 6, 7]} A,C   {'0−0−': [0, 1, 4, 5], '0+0−': [2, 3, 6, 7]} B,C   {'−00−': [0, 2, 4, 6], '+00−': [1, 3, 5, 7], '−00+': [8, 10, 12, 14]} A,D   {'0−−0': [0, 1, 8, 9]} B,D   {'−0−0': [0, 2, 8, 10], '−0+0': [4, 6, 12, 14]} C,D   {'−−00': [0, 4, 8, 12], '−+00': [2, 6, 10, 14]} A,B,C   {'000−': [0, 1, 2, 3, 4, 5, 6, 7]} B,C,D   {'−000': [0, 2, 4, 6, 8, 10, 12, 14]}
 * 1) 0
 * 1) 1
 * 1) 2
 * 1) 3



{'+−−−': [1], '−+−−': [2], '−++−': [6], '+++−': [7], '−−−+': [8], '+−−+': [9]} A   {'0++−': [6, 7], '0−−+': [8, 9]} C   {'−+0−': [2, 6]} D   {'+−−0': [1, 9]}
 * 1) 0
 * 1) 1