Show that the language is undecidable - computation-theory

Consider the language
Consider the language
Aabb = {< M > | M is a TM, and M accepts abb}
a) What is the computational problem that is represented by Aabb?
b) Show that Aabb is undecidable.
I tried proving it but didn't know what to do.

You can use Rice's theorem directly and correctly prove the claim by noting that some TMs accept aab, some don't, and acceptance of abb is a semantic property of languages (it has to do only with the strings accepted, not the manner of accepting them). Rice guarantees this language is undecidable.
If you want another kind of proof, consider the following. There's nothing special about the string abb. If this problem is decidable, we'd expect the problem to be decidable for any arbitrary string. If it were decidable for any arbitrary string, we could use dovetailing to decide whether the language of the TM were empty. If we could decide whether the language of a TM were empty, we could take any TM, change all instances of halt-reject to halt-accept, and then decide whether the TM halts on at least one input. Etc. Etc. Basically, you can construct a chain of implications as long as you want but you quickly find known undecidable problems you can reduce to.

Related

Show that the language L = {w ∈ {0, 1} ∗ | Mw(x) ↓ for an input x} is partially decidable but not decidable

I am trying to prove that the language L = {w ∈ {0, 1} ∗ | Mw(x) ↓ for an input x} is partially decidable but not decidable. Mw is an encoding of M, thus the language L is such that all encodings of machine M halt on some input x.
I have two ideas:
reduce this to the halting problem using some decider TM
use Post's Theorem and somehow prove that the complement of L is undecidable but L is partially decidable
However, I'm having trouble deciding which of these two would actually be correct and how to write it with correct notation. Can anyone offer some hints?
This answer assumes that L is the language of all representations of Turing machines which halt on some input.
First, this language must be semi-decidable, or recursively enumerable, because we can enumerate Turing-machine encodings that halt on some input. To accomplish this, begin enumerating all binary strings. At each stage, begin a new TM which begins simulating execution of the machine encoded by the string just generated on all possible inputs. Continue on so that all possible TM encodings are being simulated on all possible inputs. Dovetail the executions of these machines so that each one gets its next time quantum within finite time so that every possible input is simulated on every possible TM in finite time. If any of the simulations ever halt, then we print out the encoding that halted on the input and we can stop simulating that encoding. This must eventually print out any encoding in the language, so the language is enumerated. This means we can answer the question, "is this TM in the language?" for any provided TM given that the answer is yes (since we will eventually encounter it).
Second, the language cannot be decidable, or recursive, because this gives us a clear method of deciding the halting problem: ask whether the TM in question in in the language, and get a yes or no answer back as to whether it halts on some input. We can always modify the TM of interest so that it can only possibly halt on whatever input is of interest and then feed it into our decider if we have a specific input in mind.
Third, these facts imply that the language is not co-recursively enumerable, since its being both recursively enumerable and co-recursively enumerable would imply it is recursive, which is not the case.

Challenge on Alphabet and Formal Grammar and Language

We know set A is countable if A is finite or in a one-to-one mapping to natural numbers.
Suppose ALPH be an arbitrary finite alphabet.
I summarize my inference:
a) Each arbitrary Language on ALPH is Countable. (I think this is True)
b) the set of all language from ALPH is Countable.(I think this is False)
c) for Each arbitrary Language on ALPH we have a generative formal grammar. (I think this is False)
d) Each arbitrary Language on ALPH that can be generated by formal grammar, is recursive. (I think this is True)
anyone could help me, and maybe correct me?
Without loss of generality, we can assume that ALPH is merely the set {0,1}. (Any other finite language can of course be encoded using the set {0,1}). Assuming that by a language L that you intend some arbitrary subset of ALPH*, we can assume that L is an arbitrary subset of {0,1}*.
Let S = {0,1}*.
a) The set S is countable. Since L is a subset of S, L is countable.
b) The set of all languages over S then is the powerset of S, which can be put into 1-1 correspondence with the Real numbers. Hence, not countable.
c) I believe that this is false, agreeing with your supposition. However, it depends on your definition of a 'generative formal grammar'. If you allow for formal grammars where individual rules of the grammar are undecidable, and/or allow for infinite generation rules, this becomes less clear. For any particular definition for 'generative formal grammar', where the collection of 'generative formal grammars' is enumerable, then of course, the answer is false.
d) In general, I believe that the answer to this is false. If you restrict yourself to formal grammars corresponding to context-free languages, then of course, your answer is true. However, consider http://en.wikipedia.org/wiki/Post_correspondence_problem The problem is undecidable, yet the generation rules are pretty clear.

language over {1} which is recognizable but not decidable?

What is an example of a language over the alphabet {1}* which is recognizable but not decidable?
I have troubles finding an example of this. After a long search, I am still curious for the answer though.
A hint would be very welcome.
Since the universe of strings over any finite alphabet is countable, every language can be mapped to a subset of the natural numbers. So you just have to take a Recursively enumerable language wich is not decidable and map it into a subset of {1}*.
For example, in the classic version of the halting problem we enumerate every turing machine into a binary string; you can now sort all the turing machines and define a map f : TM -> N from Turing machines to integers where f(TM) = n if TM is the nth turing machine in the ordered list of all TM.
Now, the halting problem for turing machines coded as unary numbers is r.e. but not decidable.
Imagine a machine that given two machines whose alphabets are {1}*, accepts if the first can generate all strings that the second can generate.
Our machine halts if it accepts. But for strings not in the language (the first given machine cannot generate all the strings the second one can), our machine may halt and reject, or may never halt. This means that our Turing Machine is Recognizable, but it is not decidable.
See the Encyclopedia of Mathematics for more on recognizable and undecidable languages (specifically page 56).
The only subset that is not decidable in {1}* is the empty set.
We can define a Language over {1}* in terms of a TM:
L = { < M > | M is a TM and L(M) = empty }
So we can show that L is not decidable, because a TM U that receive L as a input need to test all elements over {1}* and then decide to accept in case of M rejected all of them, so it will never halt and it means that L is not decidable, implies that the empty Language is not decidable

Extending LINQ-based Specification Pattern to implement subsumption

There are a lot of LINQ-based implementations of the Composite Specification Pattern. I have not seen one that used Subsumption.
Are there any such examples that have been documented (blogs, etc.) or published as open source? I have an idea and proof of concept for how this could work by having an ExpressionVisitor translate every specification into a canonical logical form (CNF/DNF), but I am concerned that this is overly complicated. Is there a better way?
I am concerned that this is overly complicated. Is there a better way?
The short answer is "No, there isn't" 1
The long answer: The "overly complicated" captures the essence of the problem: it is NP-hard. Here is a short informal proof relying upon the fact that the satisfiability problem is NP-complete:
Suppose that you have two Boolean formulas, A and B
You need to test if A implies B, or equivalently ¬A | B for all assignments of variables upon which A and B depend. In other words, you need a proof that F = ¬A | B is a tautology.
Suppose that the tautology test can be performed in polynomial time
Consider ¬F, the inverse of F. F is satisfiable if and only if ¬F is not a tautology
Use the hypothetical polynomial algorithm to test ¬F for being a tautology
The answer to "is F satisfiable" is the inverse of the answer to "is ¬F a tautology"
Therefore, an existence of a polynomial tautology checker would imply that the satisfiability problem is in P, and that P=NP.
Of course the fact that the problem is NP-hard does not mean that there would be no solutions for practical cases: in fact, your approach with the conversion to a canonical form may produce OK results in many real-world situations. However, an absence of a known "good" algorithm often discourages active development of practical solutions2.
1 With the obligatory "unless P=NP" disclaimer.
2 Unless a "reasonably good" solution would do, which may very well be the case for your problem, if you allow for "false negatives".

Prolog - what sort of sentences can't be expressed

I was wondering what sort of sentences can't you express in Prolog? I've been researching into logic programming in general and have learned that first-order logic is more expressive compared to definite clause logic (Horn clause) that Prolog is based on. It's a tough subject for me to get my head around.
So, for instance, can the following sentence be expressed:
For all cars, there does not exist at least 1 car without an engine
If so, are there any other sentences that CAN'T be expressed? If not, why?
You can express your sentence straightforward with Prolog using negation (\+).
E.g.:
car(bmw).
car(honda).
...
car(toyota).
engine(bmw, dohv).
engine(toyota, wenkel).
no_car_without_engine:-
\+(
car(Car),
\+(engine(Car, _))
).
Procedure no_car_without_engine/0 will succeed if every car has an engine, and fail otherwise.
The most problematic definitions in Prolog, are those which are left-recursive.
Definitions like
g(X) :- g(A), r(A,X).
are most likely to fail, due to Prolog's search algorithm, which is plain depth-first-search
and will run to infinity and beyond.
The general problem with Horn Clauses however is, that they're defined to have at most one positive element. That said, one can find a clause which is limited to those conditions,
for example:
A ∨ B
As a consequence, facts like ∀ X: cat(X) ∨ dog(X) can't be expressed directly.
There are ways to work around those and there are ways to allow such statements (see below).
Reading material:
These slides (p. 3) give an
example of which sentence you can't build using Prolog.
This work (p. 10) also explains Horn Clauses and their implications and introduces a method to allow 'invalid' Horn Clauses.
Prolog is a programming language, not a natural language interface.
The sentence you show is expressed in such a convoluted way that I had hard time attempting to understand it. Effectively, I must thanks gusbro that took the pain to express it in understandable way. But he entirely glossed over the knowledge representation problems that any programming language pose when applied to natural language, or even simply negation in first order logic. These problems are so urgent that the language selected is often perceived as 'unimportant'.
Relating to programming, Prolog lacks the ability to access in O(1) (constant time) any linear data structure (i.e. arrays). Then a QuickSort, for instance, that requires access to array elements in O(1), can't be implemented in efficient way.
But it's nevertheless a Turing complete language, for what is worth. Then there are no statements that can't be expressed in Prolog.
So you are looking for sentences that can't be expressed in clausal logic that can be expressed in first order logic.
Strictly speaking, there are many, simply because clausal logic is a restriction of FOL. So that's true by definition.
What you can do though is you can rewrite any set of FOL sentences into a logic program that is not equivalent but with good properties. So for example if you want to know if p is a consequence of your theory, you can use equivalently the transformed logic program.
A few notes on the other answers:
Negation in Prolog (\+) is negation as failure and not first order logic negation
Prolog is a programming language, as correctly pointed out, we should be talking about clausal logic instead.
Left recursion is not a problem. You can easily use a different selection rule, or some other inference mechanism.

Resources