4

I've recently finished a course on languages in computer science, so we covered characteristics of regular, context-free, decidable and semi-decidable languages. While that is all well and good, we never went into any detail on what applications of this knowledge are (other than compilers being context-free language recognizers). I've tried googling for answers but wasn't able to find anything relevant. I'm wondering if someone can just explain what current applications for each 'type' of language are and perhaps link further material for reading.

Thank you.

David Richerby
  • 81,689
  • 26
  • 141
  • 235
qriouscat
  • 41
  • 3

2 Answers2

1

First, let's be clear, there are two separate types of languages, Turing Decidable (also called recursive), and Turing Recognizable (also called semi-decidable or recursively-enumerable).

The "application" of decidable languages is all of computer science. It's a huge class that includes exactly the problems that can be solved by algorithms. So you're not going to find specific applications like you would for compilers and CFGs, because the applications covered by decidable languages are "everything else." If you can write code for it, it's in this class.

Recursively-enumerable problems are ones where you know a solution when you see one, but might never know when you're out of potential solutions. You always halt on a "yes" answer, but might never halt for "no". This class is basically first-order theorem proving: we recognize proofs when we see them, but with quantifiers, there's no way to know if no proof exists.

It's also worth mentioning that parsers are CFG recognizers. Other parts of compilers, like translation and type-checking, are definitely not context-free.

Joey Eremondi
  • 29,754
  • 5
  • 64
  • 121
  • I edited the question's title to better suit the actual question. I don't think I've invalidated anything in your answer but, if I have, feel free to do whatever you think best corrects that. – David Richerby Dec 25 '17 at 22:51
0

I'll add some applications of regular languages:

  • Being able to write a regular expression for a language allows us to perform input validation and search, such as on phone numbers, email, and more. The command line tool grep uses regular expressions to search in text documents (incidentally the name "grep" comes from "globally search a regular expression and print").
  • Regular expressions are useful in natural language processing, having applications in segmentation, normalization, and stemming.
  • Regexes are also useful in syntax highlighting.
  • As touched on in comments, finite state machines are used to model the behavior of everyday objects and processes such as circuits and network protocols. Another cool example of this is a standard HTML button.
  • Directed acyclic word graphs are data structures for storing a set of strings as essentially a minimum-state DFA, allowing for fast lookups and good space efficiency.
  • Applications in molecular biology such as improving DNA sequence alignment and splicing languages which are a subset of regular languages that formalize the concept of gene splicing.

To round out the list, the discussion in What is the enlightenment I'm supposed to attain after studying finite automata? addresses the relevance of regular languages from a theoretical/philosophical perspective and is an excellent read!

roctothorpe
  • 1,158
  • 8
  • 20