What's the start state of C's BNF? - bnf

I can't know which is the start state in C's BNF
Anyone knows?

It's the non-terminal named "translation-unit".

Related

How can i read this kind of text

First of all i dont understand all this coding thing, im just doing this out of curiousity and boredom.
So what i want to ask is...
Is there a way to read this in English
or you know in any languange people speak
(Like any languange, since i can use google translate)
\x79\x5D\xEF\xBF\xBD\x0F\xE6\x99\xB8\xEF\xBF\xBD\x5D\x2C\xEF\xBF\xBD\x10\x33\x2D\x23\xEF\xBF\xBD
If yes, then how to do it ?
If no, thanks for reading and trying to help.
Thanks
Most people would easily be able to do this with a bit of practice.
As it's a language not designed for humans, it will take a while
The above test is in ASCII.
Broken down: \xST is how ASCII is written
\x tells the machine to convert to hexadecimal
ST are just any one of 0-9 and a-f
So you just have to find the translator tool and start learning

Can't understand why is prolog looping infinitly

From Bratko's book, Prolog Programming for Artificial Intelligence (4th Edition)
We have the following code which doesn't work -
anc4(X,Z):-
anc4(X,Y),
parent(Y,Z).
anc4(X,Z):-
parent(X,Z).
In the book, on page 55, figure 2.15, is shown that parent(Y,Z) is kept calling until stack is out of memory.
What I don't understand is that prolog does a recursiv call to anc4(X,Y), and not to parent (Y,Z) first. Why doesn't prolog goes over and over to the first line, anc4(X,Y), and rather goes to the second line?
Can you please elaborate why is the line parent(Y,Z) is kept being called?
Thank you.
The origin of your 'problem' (i.e. goals order) is deeply rooted in the basic of the language.
Prolog is based on the simple and efficient strategy of chronological backtracking, to implement SLD resolution, and left recursive clauses, like anc4/2, cause an infinite recursion.
Indeed, the comma operator (,)/2 stands for
evaluate the right expression only if the left expression holds
So, order of goals in a clause is actually an essential part of the program.
For your concrete case,
... , parent(Y,Z).
cannot be called if
anc4(X,Y),
doesn't hold.
The counterpart to goals order is clauses order.
That is, the whole program has a different semantics after the clauses are exchanged:
anc4(X,Z):-
parent(X,Z).
anc4(X,Z):-
anc4(X,Y),
parent(Y,Z).
To better understand the problem, I think it's worth to try this definition as well.
Prolog cannot handle left recursion by default without a tabling mechanism. Only some Prolog systems support tabling and usually you need to explicitly declare which predicates are tabled.
If you're using e.g. XSB, YAP, or SWI-Prolog, try adding the following directive on top of your source file containing the definition for the anc4/2 predicate:
:- table(anc4/2).
and retry your queries. The tabling mechanism detects when a query is calling a variant (*) of itself and suspends execution of that branch until a query answer is found and tries an alternative branch (provided in your case by the second clause). If that happens, execution is resumed with that answer.
(*) Variant here means that two terms are equal upon variable renaming.

Determining if some dig answer is authoritative or not

I'm being asked to determine whether this dig answer is authoritative or not.
I'd say yes, but I am not too keen on that.
The rationale behind believing it is indeed authoritative is that the AUTHORITATIVE SECTION contains two addresses, that from what one can see from the ADDITIONAL SECTION map to 194.117.22.138 and 10.101.85.6.
We know that this answer was replied from 194.117.22.138, so it must be the case that the server is authoritative.
Is my reasoning correct or am I taking the wrong approach here?
Please see DNS response flags on the third line of dig output. There is a flag named aa which means "authoritative answer".

What is used to inverse an RC4 cipher?

I'm doing a research paper on WEP, and one of the things that has popped up immediately is that it's possible to obtain the keystream derived from specific IV, denoted RC4(v,k). I won't bother posting the proofs (unless requested), as I'm sure they're online and can be easily found.
The question is:
Once you have the value of RC4(v,k) where v is the IV (which is given) and k is the key (which is not given), how do you find the value of k?
I don't need detailed answers, just pointers in the right direction. I read something about rainbowtables, but I didn't really take the time to understand it. If possible, links would be awesome.
Thanks in advance!
Here is a link to an attack by Fluhrer Mantin and Shamir

Please explain History Monoid in Simpler Terms

I tried to read the History monoid but couldn't wrap my head around it. Could somebody please explain it in simpler terms?
Thank you
Reference: http://en.wikipedia.org/wiki/History_monoid
The history monoid is the set of possible sequences of primitive actions in the threads, taking into account synchronization primitives which occur in more than one thread simultaneously.
Actually it is not just a set but a monoid, which means that you can concatenate the sequences to get a new sequence in the monoid, and there is a neutral element, the empty sequence.

Resources