$\begingroup$
$\endgroup$
In Sedgewick and et al.'s Algorithms 4th ed., I found the following definition for a regular express:
A regular expression (RE) is either
- Empty
- A single character
- A regular expression enclosed in parentheses
- Two or more concatenated regular expressions
- Two or more regular expressions separated by the or operator (|)
- A regular expression followed by the closure operator (*)
However, item number 3 references back to the term (regular expression) that it's defining. Is it valid for a formal definition because it brings up a case for circular definition?
1 Answer 1
$\begingroup$
$\endgroup$
2
It's a recursive definition.
Exercise: Show that any formal language defined without recursion must be finite.
answered Sep 17 at 3:16
-
1$\begingroup$ Counterexercise: show that any formal language defined with recursion can be defined without it. $\endgroup$Emil Jeřábek– Emil Jeřábek2025年09月17日 05:52:55 +00:00Commented Sep 17 at 5:52
-
1$\begingroup$ Something something Van Wijngaarden. $\endgroup$2025年09月17日 06:22:53 +00:00Commented Sep 17 at 6:22