computation-theory

How many control-of-flow paradigms are there? (deleted)

----zvolkov: trying to delete this old question but it won't let me ---- --Note: the question is NOT about programming language paradigms as in OOP vs functional vs. formal logic!-- I'm trying to grok different ways a logic can be expressed in a computer language. The thinking goes along the lines of imperative/declarative but at so...

Pac-Man representation with Finite State Automaton

Hi there, Consider a game similar to pac-mac that we want to represent it with an FSA graph. We have a maze (table) and there are berries into it in random positions. The goal is to eat all the berries in the maze. The commands we have to consider for the control are the following: GOAHEAD, LEFT, RIGHT, CHECKBERRY(that checks if there is...

How to write an enumeration of all computable functions?

Motivation: I'd like to be able to use toy functional programming in languages without first-order functions, by using natural numbers instead of functions. A universal function is a function f : N -> (N -> N), equivalently f : N * N -> N that enumerates all possible computable functions. In other words, there's a number k such that f(k...

NFA to DFA question

First, this is not a question asking for the algorithm to convert a NFA to DFA. It's known (and proved) that the equivalent DFA of a NFA has at most 2n states, even though most of the times it will have more or less the same number of states as the NFA. How may I predict an estimate for the number of states the NFA-equivalent DFA will ...

Good resources to learn about models of computation?

Out of curiosity, I am trying to identify what model of computation a system I work with is functionally equivalent to, and prove the equivalence. The longer I spend on this problem the more I suspect the system isn't Turing-equivalent. My understanding of Turing Machines and recursively enumerable languages is good but I don't know mu...

What is the name of a function whose result depends only on its parameters?

I'm writing a toy compiler thingy which can optimise function calls if the result depends only on the values of the arguments. So functions like xor and concatenate depend only on their inputs, calling them with the same input always gives the same output. But functions like time and rand depend on "hidden" program state, and calling t...

Designing a Turing Machine's state table

Are they any helpful guidelines to describing what a Turing machine does if you already have the pseudo code for the algorithm? I'm taking a course on complexity theory and it takes me a while to describe a Turing machine that decides or accepts some language (states, transitions, etc.) even though I know how I could code it in somethin...

Important topics in the theory of computation

During my studies at university I had to learn a lot about the theory of computation. I studied the subject for three terms. I had a hard time and I have to admit that I forgot a lot. I am wondering whether this is a personal problem, or if we just had to learn a lot of (more or less) useless stuff. So my question is: What topics in th...

Why is this an invalid Turing machine?

Whilst doing exam revision I am having trouble answering the following question from the book, "An Introduction to the Theory of Computation" by Sipser. Unfortunately there's no solution to this question in the book. Explain why the following is not a legitimate Turing machine. M = { The input is a polynomial p over variables x1, ...,...

What efforts exist to use programming languages to model legal code?

Legalese can be considered an extremely inefficient language, and it certainly has ambiguities. What attempts exist out there to use programming languages (or any symbolic logic approaches, for that matter) to model legal code (such as laws and contracts)? ...

Regular Expression for numerical constant

In Sipser's book of Theory of computation, following is given : a numerical constant that may include a fractional part and/or a sign may be described as a member of the language ( + U - U e) (D+ U D+ . D* U D* . D+) where D = {0,1,2,3,4,5,6,7,8, 9} is the alphabet of decimal digits. Examples of generated strings are: 72, 3.14159,...

How to get DFA intersection ?

How do we combine two dfa using intersection method ? ...

Decide if number is negative (in URM machine like language)

Hello! So I'm learning to program in an assembly language for an abstract machine wich is very similar to an URM Machine. An URM machine has 3 basic instructions (or 4 in some literature): To zero a register: Z(r) To increment a register: S(r) To Jump to a line or label if registers r1 and r2 contain the same val...

Does Provable == Decidable?

In computation theory are the terms Provable and Decidable interchangable? Do they mean the same thing? For example you often see the question whether something is provable referred to as a decision problem (Das Entscheidungsproblem). ...

Key points and Importance of Decidability

A language is decidable If a TM recognises the language and goes into an Accept or Reject state. As a dev. I think this is important as it would mean we could determine if a program contains buffer overflows or deadlocks. Also, the following problems are Un-Decidable: Does a program ever access an uninitialized variable. Do two cont...