-
Notifications
You must be signed in to change notification settings - Fork 54
feat: define the Transducer class as recognizing a function from input strings to weights
#286
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
base: main
Are you sure you want to change the base?
Conversation
…t strings to weights from a `Semigroup`
ctchou
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some general comments:
- Please run
lake exe mk_all --module, so thatimports for any files you add will also be added toCslib.lean. - I'm not sure weighted automata are a widely known subject. (I for one don't know anything about it.). So please provide some references, which you can add to the file
references.bibin the root directory and refer to them in a comment here.
|
A good reference for weighed automata is Droste et al. 2009. As in the chapter Mohri 2009, weighted automata have shortest-distance interpretations when weights are from an idempotent semiring. In this commit, just a semigroup is sufficient for stating the definition. |
ctchou
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This file looks fine by itself. So I'm approving it. But I wonder if we should wait for more material about weighted automata to be PR-ed to see how everything fits together. I leave that decision to @fmontesi .
…t-associative implementation
…nd implement a `Transducer` instance
…sducer` instance
|
Thanks for all the feedback @ctchou. Here's a second iteration that works with an implementation of typical deterministic FSTs (
|
Transducer class as recognizing a function from input strings to weights from a SemigroupTransducer class as recognizing a function from input strings to weights
…d tails Also defined a `LeftGCDMonoid` class, which relaxes the commutative `GCDMonoid` in mathlib.
ctchou
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would prefer that you do not introduce "unit" in FLTS/Basic.lean and DA/Basic.lean, for I'm not sure that's a universally recognized concept. Please define the "unit DA" at the place where it is needed (namely, in ToBimachine.lean).
| public import Mathlib.Algebra.Divisibility.Basic | ||
|
|
||
| @[expose] public section | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There should be a /-! ... -/ comment about what this file is for.
|
|
||
| @[expose] public section | ||
|
|
||
| namespace Semigroup |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the purpose of this file is to prove additional results about semigroup that are not in mathlib, this file should be named Semigroup.lean.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, I did not mean to approve. I was requesting changes in the last batch of comments.
This definition easily specializes to:
noneto the weightsnoneas the weightsThe design is similar to the related
Acceptor.lean