AQA A2 Computing - 1.6 Regular Expressions, BNF and RPN Flashcards

1
Q

Natural Language

A

Comprises of a set of rules and governed by rules which define the order in which words may be put together to craete speech. These rules define the grammar or syntax of the language.

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

Formal Language

A

Defined using two components: its alphabet and its rules of syntax. For example, a formal language is used to describe the hardness of lead in pencils.

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

Regular Language

A

Any language that a Finite State Machine will accept.

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

Metalanguage

A

A metalaguage is a language used to describe a real language.

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

Real Language

A

A real language is consists of strings of characters chosen from some set or alphabet of characters.

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

Regular Expression

A

A notation for defining all the valid strings of a formal language or a special text string for describing a search pattern.

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

Regular Expressions: Alternation (bed?ban)

A

A vertical bar ? is used to separate alternatives. For example bed?ban is used to match strings bed and ban.

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

Regular Expressions: Character Class (b[ae]d)

A

An alternative way of representing alternation. B[ae]d matched bad and bed because [] encloses a list of alternative characters. Particularly useful for ranges of characters. E.g. [a-z] for all lower case characters, or [A-Za-z] for all upper and lowercase characters.

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

Regular Expressions: Grouping (gr(a?e)y)

A

Round brackets are used to define the scope and prescedence of the operators, among other uses. E.g. gray?grey and gr(a?e)y are equivalent patterns describing the set containing grey and gray.

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

Regular Expressions: Negation (n^t)

A

This will match any character that is not in the character class. N.B This does NOT meat ‘an n not followed by a t’. It means ‘an n followed by a character that is not a t’

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

Regular Expressions: Quatification “?”

A

Indicates that there is zero or one of the preceeding element. E.g. colou?r matches color and colour

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

Regular Expressions: Quatification “*”

A

Indicates that there are zero or more of the preceeding element. E.g. ab*c matches ac, abc, abbc, abbbc and so on

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

Regular Expressions: Quatification “+”

A

Indicates that there are zero or more of the preceeding element. E.g. ab+c matches abc, abbc, abbbc and so on but NOT ac

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

Backus-Naur form (BNF)

A

a notation for expressing the rules for constructing valid strings in a regular language

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

Syntax

A

The rules by which words and symbols are combined to form language structures (expressions, statements etc.)

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

Recursive Definition

A

“A recursive definition is a recursive defininition!” One that is defined in terms of itself.