71 points dmit 2 days ago 8 comments
mjfisher 2 hours ago | parent
Until this point, a derivative for me has been a derivative of an continuous function.
Is this arbitrarily defining the derivative of a particular set? (e.g. "The derivative of a set of strings S with respect to a symbol a is the set of strings gener- ated by stripping the leading a from the strings in S that start with a")
Is that analogous to regular differential calculus, or a completely different species of derivatives and it just shares the same name?
convolvatron 2 hours ago | parent
yorwba 2 hours ago | parent
dapperdrake 1 hour ago | parent
abe27342 1 hour ago | parent
The Brzozowski derivative is not strictly one of these, due to its odd product rule expression for concatenation. https://math.stackexchange.com/questions/5024248/are-brzozow... has some good explanations if you have any algebra background.
edit: The comments on the math stack exchange link seem to point out that while the Brzozowski derivative is not a derivation over some algebra, it is over a certain (f,g)-bimodule, so works in some even more general sense. Interesting!
dapperdrake 1 hour ago | parent
ufo 41 minutes ago | parent
ky3 40 minutes ago | parent
The gist of the adjunction < R, aS > = < a\R, S >, where R is a regex and S is a string, is that: R matches aS (that is, the string S but prepended with 'a') iff the left inverse of R wrt 'a', matches S.
The left inverse here is the unconcatenation of R on the left with 'a'.
(Recall that the algebra of regexes builds them up from unions, concatenations, and kleene stars on the constants of the empty set, the null string, and the alphabets of your language. The novelty is that you can invert concatenation—on both ends!)