dfgp_ has quit [Read error: 113 (No route to host)]
dfgp has joined #ocaml
skylan_ is now known as skylan
premchai21 has joined #ocaml
asymptote has joined #ocaml
metaperl has quit [Read error: 104 (Connection reset by peer)]
revision17_ is now known as Revision17
pango_ has joined #ocaml
premchai21 has quit ["Hey! Where'd my controlling terminal go?"]
premchai21 has joined #ocaml
pango has quit [Read error: 145 (Connection timed out)]
dfgp has quit [Read error: 104 (Connection reset by peer)]
asymptote has quit [Read error: 110 (Connection timed out)]
albertelegance has quit ["Leaving"]
albertelegance has joined #ocaml
vezenchio has joined #ocaml
Frederick has joined #ocaml
<Frederick>
hi folks anyone familiar with grammar simplification?
<Smerdyakov>
What do you mean by that?
<Frederick>
Smerdyakov, do you know Chomsky Normal Form?
<Smerdyakov>
Yes
<Frederick>
Smerdyakov, I got a grammar I must simplify, get rid of empty productions, variables that substitute other variables, uselles symbols
<Frederick>
but I cant finish it I get stuck on the same point allways
<Smerdyakov>
Is it homework?
<Frederick>
Smerdyakov, it is an exercise that is on the list for the test I have tommorow
<Frederick>
I dont have to show to the teacher but high chances it will be on the test
<Smerdyakov>
Sipser contains a Chomsky Normal Form translation procedure.
<Frederick>
Smerdyakov, what is sipser?
<Smerdyakov>
Sipser is a mathematician and the textbook on theory of computation that he wrote.
<Frederick>
Smerdyakov, I got the algorithm but by some reason it fails
<Smerdyakov>
Clearly it doesn't. :-)
<Smerdyakov>
Or the (correct) algorithm in Sipser never fails.
<Smerdyakov>
I don't know what you're using.
<Frederick>
Smerdyakov, the one is poorly described in the book my teacher "wrote" (copied stuff from several ppl)
Snark has joined #ocaml
<Smerdyakov>
Get a real textbook, then. Sipser is standard in the USA.
<Frederick>
Smerdyakov, I live in brazil
<Smerdyakov>
I'm sure that doesn't stop you from reading textbooks that are popular in other places.
<Frederick>
Smerdyakov, 1 real (our money) is 3 dollars so it is almost impossible for us buy books from usa
<Smerdyakov>
There's really no help for you if your only sources of information are poorly written.
<Smerdyakov>
Computer science isn't something you learn by guesswork.
<Frederick>
Smerdyakov, Im really in need
<Smerdyakov>
Sorry, but I'm not going to give you a lesson on something that should be learned from a book.
<Frederick>
Smerdyakov, I got teacher who memmorize books
* premchai21
arghs.
premchai21 has left #ocaml []
<Frederick>
Smerdyakov, I just need it done cause i believe this is impossible in this case
<Smerdyakov>
Every CFG has a Chomsky-Normal form.
<Smerdyakov>
This is easy to prove,.
<Frederick>
Smerdyakov, this is suggested as exercise on my book probably, in order to dont prove stuff the teacher suggeests it to students
<Smerdyakov>
[I also expect that you'
<Smerdyakov>
[I also expect that you've had lots of time to realize that you don't understand the material and seek help, instead of waiting until the night before the test.]
<Frederick>
Smerdyakov, teaccher gave the subject yesterday
<Frederick>
I got tons of tests
<Smerdyakov>
*sigh*
<Frederick>
as everybody and I went today to the uni to talk with him and he wasnt there
<Smerdyakov>
Which grammar are you trying to CNFize?
<Frederick>
Smerdyakov, I need to simplify it, or reduce as you might cal in english I need to remove empty productions (there are none), get rid of productions like A->B (variables generating variables, there is where im stuck at)
<Snark>
Frederick: isn't C <- a
<Snark>
Frederick: isn't C <- a*c, sorry
<Frederick>
Snark, what do you mean?
<Smerdyakov>
That's always easy to do. When you have A <- B, just copy every rule for B, but make it produce A instead of B.
<Frederick>
Smerdyakov, for this specif grammer I have 3 pages of my notebook trying to do it
* Snark
is perhaps thinking regex where he shouldn't
<Smerdyakov>
Frederick, you only have one unit rule.
<Smerdyakov>
Frederick, you replace it with two non-unit rules, by copying the productions for C.
<Frederick>
Smerdyakov, what do you mean by non-unit rules?
<Smerdyakov>
By "unit rule", I mean a production that derives one non-terminal from another, such as A -> B.
<Smerdyakov>
A "non-unit rule" would be any production that isn't a unit rule.
<Frederick>
Smerdyakov, I give you my word under my soul Ive tried with all my forces but Ive failed for this given exercise
<Smerdyakov>
Frederick, do you understand what I've just suggested?
<Frederick>
Smerdyakov, yes I will do it
<Frederick>
Smerdyakov, but I get something like S-> aCA | abB | abC | aC | c I cant simplify further
<Smerdyakov>
No, you get S -> aA | aB | aC | c
<Frederick>
I cant see how did you do it =/
<Frederick>
Smerdyakov, I can see
<Smerdyakov>
You can or you can't?
<Frederick>
but I dont know how to fix the b
<Smerdyakov>
"The b"?
<Frederick>
Yes sinvce C-> aC | c you replaced the C for its productions
<Frederick>
the B
<Smerdyakov>
What is there to "fix"?
<Frederick>
replace it for its productions
<Smerdyakov>
Why would you want to do that?
<Smerdyakov>
You already have every S production in the right form (almost).
<Smerdyakov>
You just need to add an extra non-terminal for each terminal.
<Frederick>
hm
<Frederick>
should I add bC too?
<Frederick>
?????????
<Smerdyakov>
Why would you do that?
<Frederick>
do you agree abc is a word of the language?
<Smerdyakov>
Do you understand what it means for a grammar to be in CNF?
<Smerdyakov>
Yes, I agree on that.
<Frederick>
Smerdyakov, I do, it is a form where all productions are like A->BC or A->a
<Smerdyakov>
OK, so why would you want to add extra productions when those you have are already enough and in the right form?
<Frederick>
so the current set of productions doesnt allow us ti have abc
<Smerdyakov>
Sure it does.
<Frederick>
how?
<Smerdyakov>
S -> aB -> abC -> abc
<Frederick>
Smerdyakov, so I dont need to change nothing in the productions of A and B nor C?
<Frederick>
cause the productions of there variables arent in the CNF
<Smerdyakov>
Clearly you do, since they contain productions with multi-element righthand sides that mix terminals and non-terminals.
<Smerdyakov>
However, all of them are in _almost_ the right form, which you can correct by adding a new non-terminal for each terminal and using the corresponding non-terminals in place of terminals in those rules.
<Frederick>
oki so we must CNFize B and C right?
<Frederick>
k
<Frederick>
Smerdyakov, it fitted perfectly thx a lot
<Frederick>
I got it
<Smerdyakov>
Great. Now complain to someone at your university about the bad class, and, if nothing is done about it, move to another university.
<Frederick>
Smerdyakov, we have complained like 200 times but there is only 1 teacher that gives this class
<Smerdyakov>
OK, so move to another university.
<Frederick>
Smerdyakov, this is the "best" university around, the only free one also
OtherAlfie has quit ["Sleepytime for alfiekat"]
<Smerdyakov>
OK, so become a hermit.
<Smerdyakov>
Or save up your money and buy a real textbook on the subject.
<Frederick>
Smerdyakov, thx a lot I will sleep now and wake up in like 3 hour to study thx A LOT MAN
Frederick has quit ["Leaving"]
dfgp has joined #ocaml
cmeme has quit [Remote closed the connection]
dfgp_ has joined #ocaml
cmeme has joined #ocaml
cmeme has quit [Remote closed the connection]
cmeme has joined #ocaml
dfgp has quit [Read error: 113 (No route to host)]
vodka-goo has joined #ocaml
ramkrsna has joined #ocaml
Chipster1 has joined #ocaml
chs_ has quit [Read error: 110 (Connection timed out)]
dfgp_ has quit [Read error: 113 (No route to host)]
<Chipster1>
salut tout le monde
Chipster1 has left #ocaml []
vodka-goo has quit []
pango_ has quit [Remote closed the connection]
pango has joined #ocaml
mlh has quit [Client Quit]
ramkrsna has quit [Read error: 113 (No route to host)]
Skal has joined #ocaml
ppsmimou has joined #ocaml
ppsmimram has joined #ocaml
ppsmimou has quit [Read error: 104 (Connection reset by peer)]
ppsmimou has joined #ocaml
ppsmimram has quit [Read error: 104 (Connection reset by peer)]
Bigb[a]ng is now known as Bigbang
jiji has joined #ocaml
pnou has quit [Read error: 110 (Connection timed out)]
revision17_ has joined #ocaml
mauke has quit [Read error: 110 (Connection timed out)]
Revision17 has quit [Read error: 110 (Connection timed out)]
_fab has quit [Read error: 110 (Connection timed out)]
mauke has joined #ocaml
ramkrsna has joined #ocaml
pnou has joined #ocaml
ramkrsna has quit [No route to host]
chs_ has joined #ocaml
ramkrsna has joined #ocaml
ramkrsna has quit ["printk("Rusty's brain broke \n");"]
ramkrsna has joined #ocaml
Bigbang is now known as Bigb[a]ng
jiji has quit ["sikko"]
ramkrsna has quit ["printk("Rusty's brain broke \n");"]
mercurylala has joined #ocaml
albertelegance has quit [Read error: 104 (Connection reset by peer)]
brx has joined #ocaml
brx has quit [Remote closed the connection]
brx has joined #ocaml
exa has quit [Remote closed the connection]
Bigb[a]ng is now known as Bigbang
OtherAlfie has joined #ocaml
__DL__ has joined #ocaml
vincenz has joined #ocaml
<vincenz>
Hello
<vincenz>
Anyone know anyway of doing macros in ocaml?
<Submarine>
camlp4
<vincenz>
I was hopinig more for a camlp4 module that easily lets one create simple hygienic macros
exa has joined #ocaml
<Schmurtz>
you may also use the cpp preprossesor
<Schmurtz>
but it's not the caml way to do it
<vincenz>
lol
<vincenz>
I said -hygienic-
<Schmurtz>
so.... camlp4
<Schmurtz>
;)
<vincenz>
basically I find myself with bits of code that are the same nad would like to find a way to easily define a macro to call these bits of code without having to define a function that takes in all the possible variables that occur in these bits of code
<KrispyKringle>
Is there no way to refer to the cons operator functionally? I'd have thought (::)?
<KrispyKringle>
I want to use it as a HOF...
<vincenz>
nope
<Schmurtz>
vincenz, there's no other possibilities than using a function or camlp4
<vincenz>
ok
<vincenz>
Schmurtz: maybe a camlp4 module that has a way of doing it
<vincenz>
but I ahvve to run
<dylan>
that's a fascinating typo.
ppsmimou has quit ["Leaving"]
pango has quit ["Leaving"]
vodka-goo has joined #ocaml
pango has joined #ocaml
Banana has quit [Read error: 104 (Connection reset by peer)]
Banana has joined #ocaml
mattam_ has quit [Read error: 104 (Connection reset by peer)]
vezenchio has quit ["\o/ futari ga kitto deaeru you na mahou wo kakete, ryoute wo sotto kasanete hora hohoemu kara - hontou no kimochi kizukanai f]
mattam has joined #ocaml
smimou has joined #ocaml
brx has quit [Remote closed the connection]
yakiste has quit [Read error: 110 (Connection timed out)]
brx has joined #ocaml
brx has quit [Read error: 104 (Connection reset by peer)]
brx has joined #ocaml
brx has quit [Remote closed the connection]
brx has joined #ocaml
Mathman has left #ocaml []
_fab has joined #ocaml
Snark has quit ["Parti"]
brx has quit [Read error: 104 (Connection reset by peer)]
brx has joined #ocaml
brx has quit [Remote closed the connection]
brx has joined #ocaml
brx has quit [Remote closed the connection]
brx has joined #ocaml
_DL_ has joined #ocaml
__DL__ has quit [Read error: 110 (Connection timed out)]
iter has quit [Read error: 110 (Connection timed out)]
ski has joined #ocaml
exa has left #ocaml []
shammah has joined #ocaml
brx has quit [Connection timed out]
brx has joined #ocaml
brx has quit [Remote closed the connection]
brx has joined #ocaml
vodka-goo has quit []
Chipster1 has joined #ocaml
ski has quit [Nick collision from services.]
ski__ has joined #ocaml
ski__ is now known as ski
Skal has quit [Remote closed the connection]
brx has quit [Connection timed out]
Submarine has quit ["Leaving"]
Chipster1 has quit []
_DL_ has quit [Remote closed the connection]
brx has joined #ocaml
Matoras_ has joined #ocaml
brx has quit [Remote closed the connection]
Matoras_ is now known as Matoras
brx has joined #ocaml
brx has quit [Remote closed the connection]
brx has joined #ocaml
ski__ has joined #ocaml
vincenz has quit [Remote closed the connection]
mattam_ has joined #ocaml
Banana has quit [Read error: 104 (Connection reset by peer)]
Banana has joined #ocaml
mattam has quit [Read error: 104 (Connection reset by peer)]
brx has quit [Connection timed out]
ski_ has quit [Read error: 110 (Connection timed out)]
vodka-goo has joined #ocaml
mrsolo has joined #ocaml
vodka-goo has quit []
brx has joined #ocaml
brx has quit [Read error: 104 (Connection reset by peer)]
Matoras has left #ocaml []
premchai21 has joined #ocaml
TaXules has quit [Remote closed the connection]
mlh_ has joined #ocaml
smimou has quit ["bli"]
mrsolo has quit [Read error: 104 (Connection reset by peer)]