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

Well-Behaved (Co)algebraic Semantics of Regular Expressions in Dafny #23

Merged
merged 64 commits into from
Jan 12, 2024
Merged
Changes from 1 commit
Commits
Show all changes
64 commits
Select commit Hold shift + click to select a range
e101b1a
draft
stefan-aws Dec 14, 2023
12eaa17
source code
stefan-aws Dec 14, 2023
8bbaf7c
w.r.t.
stefan-aws Dec 14, 2023
a47b2ed
space
stefan-aws Dec 14, 2023
8ad14e3
fixes
stefan-aws Dec 14, 2023
be9faf2
format, naming
stefan-aws Dec 14, 2023
76204c5
name, silva, i/we, [s]
stefan-aws Dec 15, 2023
0af556d
an algebra
stefan-aws Dec 15, 2023
de3b1ba
Update _posts/2024-01-10-semantics-of-regular-expressions.markdown
stefan-aws Jan 2, 2024
b8a54ef
Update _posts/2024-01-10-semantics-of-regular-expressions.markdown
stefan-aws Jan 2, 2024
0e22795
Update _posts/2024-01-10-semantics-of-regular-expressions.markdown
stefan-aws Jan 2, 2024
7ec296a
at -> as
stefan-aws Jan 2, 2024
05bfc5a
Zero -> Zero()
stefan-aws Jan 2, 2024
213cde0
authors
stefan-aws Jan 2, 2024
3a46cc7
expression def avoid scrollbar
stefan-aws Jan 2, 2024
4f12b60
space constraints
stefan-aws Jan 2, 2024
377db84
Alexandra comments
stefan-aws Jan 2, 2024
db2ab13
explain ghost and abstemious
stefan-aws Jan 2, 2024
29bf113
Alexandra comment 2
stefan-aws Jan 2, 2024
f493f9f
Update assets/src/semantics-of-regular-expressions/Semantics.dfy
stefan-aws Jan 3, 2024
5c05c66
Update assets/src/semantics-of-regular-expressions/Semantics.dfy
stefan-aws Jan 3, 2024
a9b8965
Update assets/src/semantics-of-regular-expressions/Semantics.dfy
stefan-aws Jan 3, 2024
6548587
Update assets/src/semantics-of-regular-expressions/Semantics.dfy
stefan-aws Jan 3, 2024
e9ba7ed
Update assets/src/semantics-of-regular-expressions/Semantics.dfy
stefan-aws Jan 3, 2024
0c0789e
Update _posts/2024-01-10-semantics-of-regular-expressions.markdown
stefan-aws Jan 3, 2024
a3b1d08
Update assets/src/semantics-of-regular-expressions/Semantics.dfy
stefan-aws Jan 3, 2024
927cbbb
Update _posts/2024-01-10-semantics-of-regular-expressions.markdown
stefan-aws Jan 3, 2024
62227be
Update assets/src/semantics-of-regular-expressions/Languages.dfy
stefan-aws Jan 3, 2024
edd1018
Update assets/src/semantics-of-regular-expressions/Languages.dfy
stefan-aws Jan 3, 2024
f9c6640
Update assets/src/semantics-of-regular-expressions/Languages.dfy
stefan-aws Jan 3, 2024
2533290
Update assets/src/semantics-of-regular-expressions/Languages.dfy
stefan-aws Jan 3, 2024
91bf68e
Update assets/src/semantics-of-regular-expressions/Languages.dfy
stefan-aws Jan 3, 2024
754b3b2
Update _posts/2024-01-10-semantics-of-regular-expressions.markdown
stefan-aws Jan 3, 2024
8ef3ff8
Update assets/src/semantics-of-regular-expressions/Languages.dfy
stefan-aws Jan 3, 2024
5865269
Update _posts/2024-01-10-semantics-of-regular-expressions.markdown
stefan-aws Jan 3, 2024
22849e9
Update _posts/2024-01-10-semantics-of-regular-expressions.markdown
stefan-aws Jan 3, 2024
0c57aa7
Update _posts/2024-01-10-semantics-of-regular-expressions.markdown
stefan-aws Jan 3, 2024
6473079
Update _posts/2024-01-10-semantics-of-regular-expressions.markdown
stefan-aws Jan 3, 2024
22a0813
Update _posts/2024-01-10-semantics-of-regular-expressions.markdown
stefan-aws Jan 3, 2024
69bc3da
Update _posts/2024-01-10-semantics-of-regular-expressions.markdown
stefan-aws Jan 3, 2024
4b9b944
Update _posts/2024-01-10-semantics-of-regular-expressions.markdown
stefan-aws Jan 3, 2024
5e6c967
Update _posts/2024-01-10-semantics-of-regular-expressions.markdown
stefan-aws Jan 3, 2024
6e66760
view above
stefan-aws Jan 3, 2024
06294c1
bug
stefan-aws Jan 3, 2024
a31fbfc
singleton equality
stefan-aws Jan 3, 2024
6549ca2
type-parameter mode
stefan-aws Jan 3, 2024
55c36f4
typo
stefan-aws Jan 3, 2024
4c63cb6
type parameter completion
stefan-aws Jan 3, 2024
4979fd2
abstemious
stefan-aws Jan 3, 2024
8fb23ef
formal language
stefan-aws Jan 3, 2024
f8f2cbb
consistency with source code
stefan-aws Jan 3, 2024
3cc70c4
remove variable
stefan-aws Jan 3, 2024
d1b7e64
forall ensures
stefan-aws Jan 3, 2024
395cef9
forall
stefan-aws Jan 3, 2024
7c4339e
spacing
stefan-aws Jan 3, 2024
62f320d
verificaiton
stefan-aws Jan 3, 2024
5e1bea3
Merge branch 'main' into semantics-of-reg-exp
stefan-aws Jan 3, 2024
ab0e65f
Merge branch 'main' into semantics-of-reg-exp
stefan-aws Jan 3, 2024
460ba93
Update _posts/2024-01-10-semantics-of-regular-expressions.markdown
stefan-aws Jan 4, 2024
fd0dbc2
indent
stefan-aws Jan 4, 2024
fe3b31a
madoko
stefan-aws Jan 10, 2024
abd80af
new line
stefan-aws Jan 10, 2024
f6b6b90
change date
stefan-aws Jan 11, 2024
616dd0f
change date
stefan-aws Jan 12, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update _posts/2024-01-10-semantics-of-regular-expressions.markdown
Co-authored-by: Aaron Tomb <[email protected]>
  • Loading branch information
stefan-aws and atomb committed Jan 2, 2024
commit b8a54ef0a831cba024b30bcc88af1f82719f1b37
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ We define the set of formal languages parametric in an alphabet `A` as an coindu
codatatype Lang<!A> = Alpha(eps: bool, delta: A -> Lang<A>)
stefan-aws marked this conversation as resolved.
Show resolved Hide resolved
```

To some, this choice might seem odd at first sight. If you are familiar with the topic, you likely have expected the set of formal languages to be defined more concretely as the set of all sets of finite sequences (sometimes called *words*), `iset<seq<A>>`. Rest assured, we agree — up to an appropriate notion of equality! Where as you characterise languages intrinsically, we treat them extrinsically, in terms of their universal property: [it is well known](https://ir.cwi.nl/pub/28550/rutten.pdf) that `iset<seq<A>>` forms the *greatest* [coalgebraic](https://en.wikipedia.org/wiki/F-coalgebra) structure (think of a deterministic automaton without initial state) `S` that is equipped with functions `eps: S -> bool` and `delta: S → (A → S)`. Indeed, for any set `U` of finite sequences, we can verify whether `U` contains the empty sequence, `U.eps == ([] in U)`, and for any `a: A`, we can transition to the set `U.delta(a) == (iset s | [a] + s in U)`. Here, we choose the more abstract perspective on formal languages at it hides irrelevant specifics and thus allows us to write more elegant proofs.
To some, this choice might seem odd at first sight. If you are familiar with the topic, you likely have expected the set of formal languages to be defined more concretely as the set of all sets of finite sequences (sometimes called *words*), `iset<seq<A>>`. Rest assured, we agree — up to an appropriate notion of equality! Whereas you characterise languages intrinsically, we treat them extrinsically, in terms of their universal property: [it is well known](https://ir.cwi.nl/pub/28550/rutten.pdf) that `iset<seq<A>>` forms the *greatest* [coalgebraic](https://en.wikipedia.org/wiki/F-coalgebra) structure (think of a deterministic automaton without initial state) `S` that is equipped with functions `eps: S -> bool` and `delta: S → (A → S)`. Indeed, for any set `U` of finite sequences, we can verify whether `U` contains the empty sequence, `U.eps == ([] in U)`, and for any `a: A`, we can transition to the set `U.delta(a) == (iset s | [a] + s in U)`. Here, we choose the more abstract perspective on formal languages at it hides irrelevant specifics and thus allows us to write more elegant proofs.

### An Algebra of Formal Languages

Expand Down