فهرست منبع

Added FLC lesson 4 bits

Federico Amedeo Izzo 9 سال پیش
والد
کامیت
7be564fb93
3فایلهای تغییر یافته به همراه62 افزوده شده و 16 حذف شده
  1. 24 16
      Formal Languages and Compilers/lesson_04.md
  2. 25 0
      Formal Languages and Compilers/lesson_07.md
  3. 13 0
      OR_Lab/lab_1.md

+ 24 - 16
Formal Languages and Compilers/lesson_04.md

@@ -1,25 +1,33 @@
 # FLC - lesson 04
 ##### Luca Oddone Breveglieri
 ###### 12 october 2015
-## Grammars pt.I
+## Free Grammars pt.I
 
-#### Linguistic Abstraction //Optional
-Transforms the phrases of a real language and gives them an __abstract representation__  
-> At the abstract level, the typical structures...
-
-#### Substitution operation
-Replaces the terminal characters of the source language with the phrases of the target language.
+### Grammars
+Are meant to overcome the limits of regexp  
+Are composed by:
+- A __starting language__
+- A __set of rules__ which can be applied a finite number of times
 
-#### Nested Lists
-Lists may contain:
-- atomic objects
-- Other lists of *lower level*
+A language can be defined by rules that after multiple applications allow to generates all and only the phrases in the language  
 
-## Grammars
-Are meant to overcome the limits of regexp
-Are composed by:
-- a startin language
-- a set of rules which can be applied a finite number of times.
+##### example:
+__Language__
+$$L=\{uu^R|u\in \{a,b\}^*\}=\{\varepsilon,aa,bb,abba,baab,...,abbbba,...\}$$
+__Grammar rules__
+$\text{frase}\rightarrow \varepsilon$  - The empty string is a valid phrase
+$\text{frase}\rightarrow a\;\text{frase}\;a$ - A phrase encloses in a, a it's a phrase
+$\text{frase}\rightarrow b\;\text{frase}\;b$ - A phrase encloses in b, b it's a phrase
+<!--*-->
+__Derivation chain__
+$$\text{frase}\Rightarrow a\;\text{frase}\;a$$
+Lista, frase are __non-terminal__ symbols
+##### example 2:
+The metalanguage of regular expressions
+__syntax__
+$1.\;espr \rightarrow\emptyset$
 
 #### Context-free Grammars
 Is a generalization of regexp
+
+###Reduction of the grammars

+ 25 - 0
Formal Languages and Compilers/lesson_07.md

@@ -0,0 +1,25 @@
+# FLC - lesson 07
+##### Luca Oddone Breveglieri
+###### 22 october 2015
+## Grammars pt.V
+
+###Chomsky Normal Form
+
+The production rules are only of two types
+- Binary rule
+$$A\rightarrow BC\;\text{where}\;B,C\in V$$
+- Terminal rule
+$$A\rightarrow \alpha\;\text{where}\;\alpha \in \Sigma$$
+
+If the language contains the empty string, add the rule
+$$S\rightarrow\varepsilon$$
+
+#### Syntax tree
+- Every internal node has *arity* 2
+- Every node that is parent of a leaf as *arity* 1
+
+### How to transform left recustion into right recursion
+Construction of the __non left-recursive form__
+1. Transformation of the immediate left recursion
+
+### Transformation ...

+ 13 - 0
OR_Lab/lab_1.md

@@ -0,0 +1,13 @@
+## Shoes production example
+
+### Set
+- $I$: Artisan
+- $J$: Model
+### Par
+- $t_{i,j}$:Time for $i$ to produce $j$ $\;\forall i, \forall j$
+- $P_j$ Price
+- $q_j$ Demand
+
+###Model
+
+Var $x_{i,j}$ $\;\;\forall i\in I\forall j\in J,\;\;\; x\ge 0, x\in Z$