[ 3 / biz / cgl / ck / diy / fa / ic / jp / lit / sci / vr / vt ] [ index / top / reports ] [ become a patron ] [ status ]
2023-11: Warosu is now out of extended maintenance.

/sci/ - Science & Math


View post   

File: 55 KB, 319x475, compilers.jpg [View same] [iqdb] [saucenao] [google]
6001552 No.6001552 [Reply] [Original]

I'm working on an exercise from the Red Dragon Book (book on compiler design), and it seems that I need to write an inductive proof for it.

I wrote some sloppy reasoning here (http://pastebin.com/Mz3WXiRA)), but I'm not sure if it's correct. I've never really practiced proofs before. Am I making any mistakes in my reasoning?

>> No.6001705

b-bump

>> No.6001801

>>>/g/
or
>>>/prog/
Ask those guys.

better yet, ask /b/. Since /g/ and /prog/ are just retards on wheels

>> No.6001803

>>6001801
>/g/
Too busy showing off editors and fighting about the merits of python.
>/b/
Why would I ask /b/ about inductive proofs?

>> No.6001842

>This produces the patterns "11", "1001", "111001", and "100111" with an
arbitrary number of zeros. (This statement isn't actually true, but go with
it.)
lol
> Since those patterns are obviously divisible by three, we can say that this
holds:
11 is three then? (I was going to say this wasn't divisible)
>(11 * n) mod 3 = (1001 * n) mod 3 = (111001 * n) mod 3 = (100111 * n) mod 3 = (3 * n) mod 3
what's n?

>> No.6001844

>>6001842
nvm. i get it.
looks good to me.

>> No.6001848

>>6001844
I lied how do you generate numbers?

>> No.6001867

>>6001848
Following the grammar. "Generates" is kind of used loosely here. It's meant to parse strings, but I just threw patterns together until I saw something I could use.

e.g. num -> num num -> 11 1001 -> 111001