jimin-kiim / Programming-Language-and-Compiler

formal languages, automata, concepts of programming languages
0 stars 0 forks source link

Introduction to formal languages and automata #4

Closed jimin-kiim closed 1 year ago

jimin-kiim commented 1 year ago
jimin-kiim commented 1 year ago

Languages

alphabet : set of symbols

string : a sequence of letters defined over an alphabet

string operations

empty string : a string with no symbols (length of the string is 0)

substring of string : a subsequence of consecutive characters

prefix and sufix

a language : any subset of star closure of alphabet

operations on languages

jimin-kiim commented 1 year ago

Grammars

G = (V, T, S, P) V : a finite set of variables T : a finite set of terminal symbols S : a special symbol called start variable P : a finite set of productions

derivation of sentence(string) : producing a string(sentence) following the grammar rule sentential form : a sentence that contains variables and terminals

language of a grammar L(G) = { w: S *=> w} the language which is following the grammar

q->ap q: variable a: terminal p: variable

jimin-kiim commented 1 year ago

Automata

temporary memory, input memory, output memory, CPU, program memory

Automata

power of automata Finite Automata < Pushdown Automata < Turing Machine the more powerful, the more computational problems can be solved with