RIPAL: Responsive and Intuitive Parsing for the Analysis of Language

Pages

Recognizing finite languages

Problem statement

Given a finite language L and an input string s, how do we determine whether s ∈ L?

Algorithm

For each string l ∈ L If s = l Return true Return false

Examples

Example

Σ = {red, yellow, blue, orange, purple, green}

L = {red, yellow, blue}

red ∈ L, since the matching element red appears in its definition.

green ∉ L, since the matching element does not appear in its definition.

Example

Σ = {0, 1}

L = {00, 01, 10, 11}

11 ∈ L, since the matching element 11 appears in its definition.

111 ∉ L, since the matching element does not appear in its definition.


GitHub Repository: https://github.com/bprollinson/ripal

Copyright © 2017 Brendan Rollinson-Lorimer