Opened 7 years ago
Closed 7 years ago
#16758 closed defect (fixed)
FiniteStateMachine.composition: check types
Reported by: | cheuberg | Owned by: | |
---|---|---|---|
Priority: | major | Milestone: | sage-6.3 |
Component: | finite state machines | Keywords: | composition |
Cc: | skropf, dkrenn | Merged in: | |
Authors: | Clemens Heuberger | Reviewers: | Daniel Krenn |
Report Upstream: | N/A | Work issues: | |
Branch: | 61f6acf (Commits, GitHub, GitLab) | Commit: | 61f6acf619b2c13010ea4c420743fc05fededc8b |
Dependencies: | Stopgaps: |
Description (last modified by )
The output of an automaton should not be feedable into a transducer (because there is none); when composing an automaton with a transducer, the result should be an automaton.
The aim would be:
sage: from sage.combinat.finite_state_machine import ( ....: is_Automaton, is_Transducer) sage: T = Transducer([(0, 0, 0, 0)], initial_states=[0]) sage: A = Automaton([(0, 0, 0)], initial_states=[0]) sage: T.composition(A, algorithm='direct') Traceback (most recent call last): ... TypeError: Composition with automaton is not possible. sage: T.composition(A, algorithm='explorative') Traceback (most recent call last): ... TypeError: Composition with automaton is not possible. sage: A.composition(A, algorithm='direct') Traceback (most recent call last): ... TypeError: Composition with automaton is not possible. sage: A.composition(A, algorithm='explorative') Traceback (most recent call last): ... TypeError: Composition with automaton is not possible. sage: is_Automaton(A.composition(T, algorithm='direct')) True sage: is_Automaton(A.composition(T, algorithm='explorative')) True
This is now achieved by this patch.
Change History (4)
comment:1 Changed 7 years ago by
- Branch set to u/cheuberg/fsm/composition-types
- Commit set to 61f6acf619b2c13010ea4c420743fc05fededc8b
- Description modified (diff)
- Status changed from new to needs_review
comment:2 Changed 7 years ago by
- Reviewers set to Daniel Krenn
comment:4 Changed 7 years ago by
- Branch changed from u/cheuberg/fsm/composition-types to 61f6acf619b2c13010ea4c420743fc05fededc8b
- Resolution set to fixed
- Status changed from positive_review to closed
Note: See
TracTickets for help on using
tickets.
New commits:
trac #16758: Add failing doctests
trac #16758: Disallow composition with automaton
trac #16758: Use class of outer machine in composition