automaton.is_partial_identity¶

Whether the automaton is a partial identity, i.e. each (accepted) input is transduced to itself.

Precondition:

• The automaton is transducer.
• The two tapes have the same labelset.

Examples¶

In [1]:
import vcsn

In [2]:
%%automaton --strip a
context = "lat<law_char(abc),law_char(abc)>, b"
$-> 0 0 -> 1 a|aa 1 -> 1 a|a 1 -> 2 aa|a 2 ->$


This transducer is a partial identity.

In [3]:
a.is_partial_identity()

Out[3]:
True

However, the following transducer is not a partial identity, as it maps aaa to aaaa.

In [4]:
%%automaton --strip a
context = "lat<law_char(a),law_char(a)>, b"
$-> 0 0 -> 1 a|aa 0 -> 2 aa|a 1 -> 3 aa|aa 2 -> 3 aa|aa 3 ->$

In [5]:
a.is_partial_identity()

Out[5]:
False