Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

finite_state_machine: Add an example on the Gray code into the documentation #16143

Closed
cheuberg opened this issue Apr 12, 2014 · 32 comments
Closed

Comments

@cheuberg
Copy link
Contributor

As an example on how to use cartesian products of transducers as introduced in #16061, a transducer converting standard binary expansion into Gray code is constructed by emulating the standard algorithm by xoring the the standard binary expansion with its shifted version.

The class collecting common transducers introduced in #16141 now also has a (hard-coded) version of the same transducer and it is made sure that both transducers agree.

Depends on #16132
Depends on #16141
Depends on #16142

CC: @sagetrac-skropf

Component: combinatorics

Author: Clemens Heuberger, Daniel Krenn, Sara Kropf

Branch/Commit: 301b5cb

Reviewer: Daniel Krenn, Sara Kropf

Issue created by migration from https://trac.sagemath.org/ticket/16143

@cheuberg cheuberg added this to the sage-6.2 milestone Apr 12, 2014
@dkrenn
Copy link
Contributor

dkrenn commented Apr 15, 2014

Dependencies: #16141

@dkrenn
Copy link
Contributor

dkrenn commented Apr 15, 2014

Changed dependencies from #16141 to #16141, #16142

@dkrenn
Copy link
Contributor

dkrenn commented Apr 15, 2014

Reviewer: Daniel Krenn

@dkrenn
Copy link
Contributor

dkrenn commented Apr 15, 2014

@dkrenn
Copy link
Contributor

dkrenn commented Apr 15, 2014

comment:4

During the review I realized that the Gray-code transducer (in generators) didn't have any final states. I've corrected this. I added a doctest to print the Gray code of the first 10 non-negative integers.
Please review my changes.


Last 10 new commits:

9029a07Fixed doctest for operator
6fed278Merge branch 'fsm/operator_transducers' into fsm/example_gray_code
f7b3a35Gray code example modified and prepackaged transducer
7a907acminor corrections
4a53b09Merge branch '#16132' into fsm/count_subblock_occurrences
5d65767Edit doctests due to #16132 change.
e1bd1dfMerge branch 'fsm/count_subblock_occurrences' into fsm/operator_transducers
3110f9dEdit doctests due to #16132 change.
6145b1fMerge branch 'fsm/operator_transducers' into fsm/example_gray_code
1efa597added final_states to Gray-code transducer, improved docstring

@dkrenn
Copy link
Contributor

dkrenn commented Apr 15, 2014

Changed author from Clemens Heuberger to Clemens Heuberger, Daniel Krenn

@dkrenn
Copy link
Contributor

dkrenn commented Apr 15, 2014

Changed commit from 6145b1f to 1efa597

@cheuberg
Copy link
Contributor Author

@cheuberg
Copy link
Contributor Author

Changed commit from 1efa597 to 5394265

@cheuberg
Copy link
Contributor Author

comment:6

Modified example in finite_state_machine.py to also have correct final states and compare it with the final states given by transducers.GrayCode.

Corrected link from transducers.GrayCode to this example.

@dkrenn
Copy link
Contributor

dkrenn commented Apr 16, 2014

Last 10 new commits:

4a53b09Merge branch '#16132' into fsm/count_subblock_occurrences
5d65767Edit doctests due to #16132 change.
e1bd1dfMerge branch 'fsm/count_subblock_occurrences' into fsm/operator_transducers
3110f9dEdit doctests due to #16132 change.
6145b1fMerge branch 'fsm/operator_transducers' into fsm/example_gray_code
1efa597added final_states to Gray-code transducer, improved docstring
1d3cb1echanges in Gray-code example
16c62ddConstructed Gray code now also has correct final states.
5394265Corrected link from transducers.GrayCode to example in finite_state_machine module
82ceebaMerge remote-tracking branch 'origin/u/cheuberg/fsm/example_gray_code' into u/cheuberg/fsm/example_gray_code

@dkrenn
Copy link
Contributor

dkrenn commented Apr 16, 2014

@dkrenn
Copy link
Contributor

dkrenn commented Apr 16, 2014

Changed commit from 5394265 to 82ceeba

@dkrenn
Copy link
Contributor

dkrenn commented Apr 16, 2014

comment:8

Now bases on beta8 + #16142.


Last 10 new commits:

6fed278Merge branch 'fsm/operator_transducers' into fsm/example_gray_code
f7b3a35Gray code example modified and prepackaged transducer
6145b1fMerge branch 'fsm/operator_transducers' into fsm/example_gray_code
1efa597added final_states to Gray-code transducer, improved docstring
1d3cb1echanges in Gray-code example
16c62ddConstructed Gray code now also has correct final states.
5394265Corrected link from transducers.GrayCode to example in finite_state_machine module
82ceebaMerge remote-tracking branch 'origin/u/cheuberg/fsm/example_gray_code' into u/cheuberg/fsm/example_gray_code
826b764Merge remote-tracking branch 'origin/u/dkrenn/fsm/example_gray_code' into fsm/operator_transducers-on-beta8
2a6bafecorrected one doctest and added another (left-shift transducer)

@dkrenn
Copy link
Contributor

dkrenn commented Apr 16, 2014

Changed commit from 82ceeba to 2a6bafe

@dkrenn
Copy link
Contributor

dkrenn commented Apr 16, 2014

@cheuberg
Copy link
Contributor Author

comment:9

Cross-reviewed all changes by dkrenn, they are fine for me.

Corrected left-shift transducer (it is a right-shift transducer, as highlighted by the above doctest) and explained this.

@cheuberg
Copy link
Contributor Author

@cheuberg
Copy link
Contributor Author

Changed commit from 2a6bafe to 8c1cbb6

@cheuberg
Copy link
Contributor Author

Changed dependencies from #16141, #16142 to #16132, #16141, #16142

@dkrenn
Copy link
Contributor

dkrenn commented Apr 18, 2014

@dkrenn
Copy link
Contributor

dkrenn commented Apr 18, 2014

comment:12

Reviewed your changes...ok.

Rewrote/Extended the documentation of the 'shift'-part of the example. Please review.


New commits:

24b6d69explained the shifting in the Gray code-construction differently

@dkrenn
Copy link
Contributor

dkrenn commented Apr 18, 2014

Changed commit from 8c1cbb6 to 24b6d69

@cheuberg
Copy link
Contributor Author

comment:13

Replying to @dkrenn:

Rewrote/Extended the documentation of the 'shift'-part of the example. Please review.

fine for me.

@sagetrac-skropf
Copy link
Mannequin

sagetrac-skropf mannequin commented Apr 24, 2014

comment:14

I rewrote the documentation to clarify the position of the least significant digit and the direction of the shift. Please review.

Everthing else is fine for me.

@sagetrac-skropf
Copy link
Mannequin

sagetrac-skropf mannequin commented Apr 24, 2014

Changed branch from u/dkrenn/fsm/example_gray_code to u/skropf/fsm/example_gray_code

@sagetrac-skropf
Copy link
Mannequin

sagetrac-skropf mannequin commented Apr 24, 2014

Changed commit from 24b6d69 to 301b5cb

@cheuberg
Copy link
Contributor Author

comment:15

fine for me.

@sagetrac-skropf
Copy link
Mannequin

sagetrac-skropf mannequin commented Apr 24, 2014

Changed author from Clemens Heuberger, Daniel Krenn to Clemens Heuberger, Daniel Krenn, Sara Kropf

@sagetrac-skropf
Copy link
Mannequin

sagetrac-skropf mannequin commented Apr 24, 2014

Changed reviewer from Daniel Krenn to Daniel Krenn, Sara Kropf

@dkrenn
Copy link
Contributor

dkrenn commented Apr 24, 2014

comment:17

Fome also for me. Since all participants in this ticket agree, I give it a positive review.

@vbraun
Copy link
Member

vbraun commented May 7, 2014

Changed branch from u/skropf/fsm/example_gray_code to 301b5cb

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants