Strings --> Anything that is made entirely of words, alphabets or symbols
Language
Language
A language is a possibly infinite set of strings over a finite set of alphabets .
Suppose we define two alphabets and . The set containing it is .
is an infinite set of all finite strings that you can make from .
Language is a set, whose elements follow specific rules that uses strings from . For example, a Language that encode any sequence of or that starts with an can be expressed as.
All languages are a subset of .
And the set of all possible languages over is the power of , or . The power set of a set is the set of all possible subsets of that set, including the empty set and the set itself.
The cardinality or size of the set (number of elements) is
where is the number of possible languages given . (Its prob )
Grammar
Grammar
A logical system that can be used to prove that a given string is a member of .
In a grammar, is a finite set of rules of the form , where and are strings, which can be used to derive the strings in a given language.
Atomic Propositions
In propositional logic, atomic propositions are the simplest statements that cannot be broken down into smaller parts. For example, . These atomic propositions represent basic declarative statements that are either true or false. They are the fundamental building blocks of logical formulas.
Terminal and Non-terminal Symbols in Formal Grammars
In formal language theory, a grammar consists of:
Terminal symbols: These are the basic symbols (e.g., words or characters) that appear in the strings generated by the grammar. Terminal symbols cannot be replaced or rewritten further.
Non-terminal symbols: These are placeholders or variables that can be replaced by strings of terminals and/or other non-terminals according to production rules.
A production rule has the form:
where, is a non-terminal symbol, and is a string consisting of terminals and/or non-terminals that can replace . For example, in English, non terminals can be like , or
then the non-terminal noun can be replaced by the terminal symbol "cat".
So if the sentence is . Then, we replace with cat, and with run. To get the sentence cat run. Thus we can say that .
A grammar can be expressed in a tuple with 4 elements
where is the set of non-terminal symbols like , is the set of terminal symbols like . is a set of rules . And is the start symbol.