Regular languages Flashcards

You may prefer our related Brainscape-certified flashcards:
1
Q

Define a finite state machine

A

An abstract model of computation that is used to model logic

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

When is a language considered regular?

A

Only if it can be recognised by a FSM

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Define regular languages

A

A formal language compromised of a set of strings

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What’s a state transition diagram?

A

A model of a finite state machine

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What’s an accepting state?

A

Indicated by a double circle, it’s reached when a valid string is entered

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What’s a Mealy machine?

A

A FSM which produces an output determined by its current state and the input

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Define regular expressions

A

A compact notation to describe a set of strings that make up a regular language

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

How do regular expressions work?

A

They work on the principle of providing characters that must be matched

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What are regular expressions used for?

A

Searching strings, Implementing find & replace functions, validating user input

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What are metacharacters?

A

Symbols used to help you interpret regular expressions

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

+

A

One or more preceding characters/ group of characters

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

*

A

Zero or more of the preceding characters/group of characters

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

?

A

Zero or one of the preceding characters/ group of characters

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

|

A

Alternation (what is on the left or what is on the right)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

()

A

Defines a group

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Which direction are regular expressions evaluated?

A

Left to right