Is a universal assembly language for all computers possible?

I would like to ask a few questions about Assembly language. My understanding is that it’s very close to machine language, making it faster and more efficient. Since we have different computer architectures that exist, does that mean I have to write different code in Assembly for different architectures? If so, why isn’t Assembly, write … Read more

Is von Neumann’s randomness in sin quote no longer applicable?

Some chap said the following: Anyone who attempts to generate random numbers by deterministic means is, of course, living in a state of sin. That’s always taken to mean that you can’t generate true random numbers with just a computer. And he said that when computers were the equivalent size of a single Intel 8080 … Read more

What are the strongest known type systems for which inference is decidable?

It’s well known that Hindley–Milner type inference (the simply-typed \lambda-calculus with polymorphism) has decidable type inference: you can reconstruct principle types for any programs without any annotations. Adding Haskell-style typeclasses seem to preserve this decidability, but further additions makes inference without annotations undecidable (type families, GADTs, dependent-types, Rank-N types, System \omega, etc.) I’m wondering: what … Read more

Is the language of pairs of words of equal length whose hamming distance is 2 or greater context-free?

Is the following language context free? L={uxvy∣u,v,x,y∈{0,1}+,|u|=|v|,u≠v,|x|=|y|,x≠y} As pointed out by sdcvvc, a word in this language can also be described as the concatenation of two words of the same length the hamming distance of which is 2 or greater. I think it’s not context free but I’m having a hard time proving it. I … Read more

Is there a typed SKI calculus?

Most of us know the correspondence between combinatory logic and lambda calculus. But I’ve never seen (maybe I haven’t looked deep enough) the equivalent of “typed combinators”, corresponding to the simply typed lambda calculus. Does such thing exist? Where could one find information about it? Answer The expressive completeness of the typed combinators compared to … Read more

How can I reduce Subset Sum to Partition?

Maybe this is quite simple but I have some trouble to get this reduction. I want to reduce Subset Sum to Partition but at this time I don’t see the relation! Is it possible to reduce this problem using a Levin Reduction ? If you don’t understand write for clarification! Answer Let (L,B) be an … Read more

Why can’t DFS be used to find shortest paths in unweighted graphs?

I understand that using DFS “as is” will not find a shortest path in an unweighted graph. But why is tweaking DFS to allow it to find shortest paths in unweighted graphs such a hopeless prospect? All texts on the subject simply state that it cannot be done. I’m unconvinced (without having tried it myself). … Read more