Opened 7 years ago
Closed 7 years ago
#19199 closed defect (fixed)
FiniteStateMachine: do not mess with color 'None'
Reported by: | cheuberg | Owned by: | |
---|---|---|---|
Priority: | major | Milestone: | sage-6.9 |
Component: | finite state machines | Keywords: | color |
Cc: | skropf, dkrenn | Merged in: | |
Authors: | Clemens Heuberger | Reviewers: | Daniel Krenn |
Report Upstream: | N/A | Work issues: | |
Branch: | bcbbf62 (Commits, GitHub, GitLab) | Commit: | bcbbf6204602729400478cf149dc8fbcbe1ec0da |
Dependencies: | #19201, #18966, #19204 | Stopgaps: |
Description
Currently, determinisation
, product_FiniteStateMachine
and related functions construct colors as frozensets or tuples of colors of its constituent states. If all colors are None, this leads to strange artifacts:
sage: A = Automaton([(0, 0, 0)], initial_states=[0], final_states=[0]) sage: [s.color for s in A.determinisation().iter_states()] [frozenset({None})] sage: [s.color for s in A.cartesian_product(A).iter_states()] [(None, None)] sage: T = Transducer([(0, 0, 0, 0)], initial_states=[0], final_states=[0]) sage: [s.color for s in T.composition(T).iter_states()] [(None, None)] sage: [s.color ....: for s in T.product_FiniteStateMachine( ....: T, lambda t1, t2: (0, 0)).iter_states()] [(None, None)]
In those case, just use the color None
if all constituent states have color None
.
Change History (4)
comment:1 Changed 7 years ago by
- Branch set to u/cheuberg/fsm/color-None
comment:2 Changed 7 years ago by
- Commit set to bcbbf6204602729400478cf149dc8fbcbe1ec0da
- Dependencies set to #19201, #18966, #19204
- Status changed from new to needs_review
comment:3 Changed 7 years ago by
- Reviewers set to Daniel Krenn
- Status changed from needs_review to positive_review
Code is fine, doc builds.
comment:4 Changed 7 years ago by
- Branch changed from u/cheuberg/fsm/color-None to bcbbf6204602729400478cf149dc8fbcbe1ec0da
- Resolution set to fixed
- Status changed from positive_review to closed
Note: See
TracTickets for help on using
tickets.
New commits:
Trac #19201: FiniteStateMachine.disjoint_union: fix doctests
Trac #18966: Merge #18964 (Kleene star), #18981 (completion), #18965 (concatenation)
Trac #18966: Implement Automaton.complement
Fix doctests
Trac #18966: Fix doctests
Trac #19204: Implement Automaton.is_equivalent
Trac #19201: Merge #19204 (Automaton.is_equivalent)
Trac #19201: Rewrite doctest using is_equivalent
Trac #19199: FiniteStateMachine: do not mess with color 'None'