Template:Studies of Euler diagrams/transformations/dagoro darimi/dh
Appearance
This code uses the Python library discrete helpers. Darimi is spread to arity 5, and thus not among the 4-ary functions in from discretehelpers.a import logic_str_vector
from discretehelpers.sig_perm import SigPerm
from discretehelpers.boolf.examples import dagoro, darimi
dagoro_clan_triples = dagoro.ec_clan(5)
triples = dagoro_clan_triples.get_block_from_label(darimi) # [(1, 5, 4)]
m, n, c = triples[0]
sigperm = SigPerm(pair=(m, n)) # <SigPerm (2, 1, ~0)>
atomvals = dagoro_clan_triples.glove_compartment[c] # (1, 2, 3, 4)
sigvar = sigperm.apply_on_vector(atomvals) # signed variation
assert sigvar == [-4, 2, 1, 4]
assert logic_str_vector(sigvar) == '[~3, 2, 1, 4]'
assert dagoro.apply(*sigvar) == darimi
###########################################################################################
dagoro_clan_pairs = dagoro.ec_clan(5, suppress_abbreviation=True)
dagoro_clan_pairs.get_block_from_label(darimi) == [(8, 101), (9, 101)]
a = SigPerm(pair=(8, 101))
b = SigPerm(pair=(9, 101))
assert a.sequence_string() == '(~3, 2, 1, 4, 0)'
assert b.sequence_string() == '(~3, 2, 1, 4, ~0)'
assert dagoro.apply_sigperm(a) == dagoro.apply_sigperm(b) == darimi
|