Is it possible for a computer to “learn” a regular expression by user-provided examples?

Is it possible for a computer to “learn” a regular expression by user-provided examples? To clarify: I do not want to learn regular expressions. I want to create a program which “learns” a regular expression from examples which are interactively provided by a user, perhaps by selecting parts from a text or selecting begin or … Read more

Regular vs Context Free Grammars

I’m studying for my computing languages test, and there’s one idea I’m having problems wrapping my head around. I understood that regular grammars are simpler and cannot contain ambiguity, but can’t do a lot of tasks that are required for programming languages. I also understood that context-free grammars allow ambiguity, but allow for some things … Read more

is it possible to know if a language is regular if its equivalence classes are finite?

i have a theoretical questions, and was wondering if you could help me with it so i could understand the material better. 1)suppose we have some language L over Σ, can we know if L is regular if all of it equivalence classes of relation RL is finite? 2)and what about L*? is it finite? … Read more

NPDA transitions to different states by taking same input and popping same top element of a stack

Suppose i have some NPDA and there is some transition functions defined as: $\delta(q_{1},a,A) = (q_{2}, A)$ $\delta(q_{1},a,A) = (q_{3}, Z)$ Is it allowed? I understand, that since the NPDA is nondetermenistic, it’s possible to have transitions to different states with the same input character, but what about same element at the top of stack? … Read more

Determining whether Turing machine halts on input: primitive recursive?

In Elements of the Theory of Computation by Lewis and Papadimitriou, the authors use a specific function for proving that application of unbounded minimization on a primitive recursive function need not be regular. They choose a peculiar function to prove so, defined as follows. Let M={K,Σ,Δ,s} be a Turing machine. Define G(n,m)=0 if n does … Read more

Computational power of quantum finite automata

I am preparing some lecture notes on the computational power of quantum finite automata (QFA). I am a bit confused about which models of QFA are stronger and which models are weaker than standard finite automata (FA). There is one-way QFA (1QFA) and two-way QFA (2QFA). For each model, we can either have “measure-once” (MO) … Read more

What is the word “madness” doing in the first chapter’s title of Automata Theory, Languages and Computation by Hopcroft, Motwani, Ullman?

The chapter’s title is “Automata: The Methods and the Madness“. This title came along in the second edition and remains in the third edition. In the first edition, the the second chapter’s title is “Finite Automata and Regular Expressions”. The word “madness” doesn’t show up anywhere else in the third edition. Why is the chapter … Read more