Reducing Planning to Quantified Boolean Formulae - artificial-intelligence

Why don't we reduce the Planning Problem in AI to the
TQBF Version of SAT in practical solvers.
Many planning problems are in practice "compiled down" or reduced to the SAT problem, which is in turn solved by SAT Solvers. The problem is that , since planning is PSPACE Complete, and SAT is NP Complete, an exponential number of literals may be required.
Why, then, do practical planners use this approach? Why don't we all solve TQBF SAT and then "compile" Planning down to TQBF, which should only take Polynomial time anyway?

This has already been done.
Generally TQBF is used to model conformant planning, but there do exist encodings of purely propositional logic planning problems to (polynomially-sized) TQBF formulae.
The main drawback is that, although we have a much smaller formula, it's not neccessarily easier to solve. TQBF solving is no way near as mature as the research into solving SAT, and Planning as TQBF is still some way behind in performance.
Here is one publication detailing such a transformation (mine):
http://users.cecs.anu.edu.au/~ssanner/ICAPS_2010_DC/Abstracts/cashmore.pdf

SAT solvers today are highly optimized and able to exploit structure inside the problems. They are very fast on most problems (but they can't be fast on all, because SAT is hard).
So by compiling down your planning problem into an instance of SAT, you are able to exploit all the work that went into the development of modern SAT solvers. You'll probably loose some structure related to the planning problem, which you could have exploited by writing a planner directly.
Maybe, when cleverly compiling down the planning problem and exploiting the planning structure in this step you'll be able to obtain easier SAT instances. But when doing so, one could say you're trying to solve the planning problem again, just by the means of another computation model (SAT-solver instead of random access memory machine or more indirectly LISP, whatever).
So why not TQBF?
Obviously, because no one has tried, yet (which I can't confirm). Maybe no one had this idea before or maybe no one thought that current TQBF-solvers are smart enough to quickly solve the compiled down planning problems - at least more quickly than the state-of-the-art planners.
I'm not well informed in the TQBF-solver scene. Actually, I've never heard of something like a general TQBF-solver before (excluding logic programming in general). I think it's way harder to do than SAT (which hasn't been proven yet, supposed Deolalikar is wrong).
So, go ahead and try it. You can post a link to your publication here if you succeed.

Related

Using PDDL or equivalent planning language/systems

I want to do some automatic story generation demonstration and the approach I am taking is using AI planning. I have been reading several relevant papers and have figured out that PDDL is perhaps the most widely used language to form the planning problem. I have been looking at the syntax and several example codes to learn how to use it.
The part where I am stuck is how to get the planner to work. I have found out some popular planners (fast-forward, MBP, IPP) but am not being able to make them work, using the instructions even from the sources itself.
I am using Gnome Terminal on Ubuntu 13.04.
I am very new to planning and this may be a very naive question but I assure that I have been searching for more than 3-4 days without any luck. Also, suggestions on using some other planning system are welcome.
If you are using Linux then I strongly suggest to use Fast Downward (it has its own web page - just google it). First of all, it is currently one of the best-known planning systems in the AI planning community and, further, it is really easy to get it to run. Well, you still need half an hour or so, but there is an easy-to-follow step-by-step description telling you where to check out the code and which commands you need to run.
It has also implemented most of the known planning heuristics that are required to solve problems fast or even optimal (planning requires search and heuristics make the search "goal-oriented" rather than blind and, if the heuristic is admissible and/or monotone (depending on the kind of search algorithm that is chosen -- see fast forward and pddl: is the computed solution the best?), it guarantees to find optimal solutions).
Concerning literature, I suggest to read/skip through the following two journal articles:
Porteous, J.; Cavazza, M.; and Charles, F. 2010. Applying planning to interactive storytelling: Narrative control using state constraints. ACM Trans. Intell. Syst. Tech. 10:1-10:21.
http://dl.acm.org/citation.cfm?id=1869399
Patrik Haslum. "Narrative Planning: Compilations to Classical Planning". Journal of AI Research, vol. 44, p. 383-395, 2012
http://www.jair.org/papers/paper3602.html
Well, both MBP and IPP are really, really old systems. If you're just looking for a ready-made planner to use in an off-the-shelf manner, I'd suggest you to follow the pointers leading to the authors (and software) that took part in the last International Planning Competition (2011):
http://www.plg.inf.uc3m.es/ipc2011-deterministic/ParticipatingPlanners.html

Is Matlab (vs. C/FORTRAN) a respectable language for a professional mathematical researcher of the 21st century? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 9 years ago.
Improve this question
I am a die hard user of matlab, mostly because this is what I learned first and I have not encountered a problem with a significant enough difference to switch. I come from numerical optimization/linear algebra, where I have performed optimization and eigenvalue computations in millions of degrees of freedom. Recently, I have entered the realm of randomness, where I was originally under the impression I would be forced to change. But, after optimizing code, and carefully initializing the seed to the random number generator, I am able to do the same Monte Carlo tasks as my contemporaries in roughly the same time. My understanding has been that base-level 'if' statements, etc., are significantly slower in matlab. However, if there are significant computations within each loop which can be vectorized, I'm not convinced C would be better. And, anyway, matlab seems to do just fine, in the sense that my upper bound is no less than any other professional (and in many cases, seems to be more). I have a feeling that I will get lots of responses from pro-C people here, who have written off matlab long ago as some trivial toy language. I am a professional researcher and contend that matlab is competitive for the highest level computationally intensive mathematical programming. Am I wrong ? Do I need to consider changing to a lower-level language, such as C/FORTRAN ? Why or why not ? Are there others like me ? Thanks alot! Cheers
I work with a team of professional research geophysicists though I'm more of a numerical software engineer myself. I think that if your work is numerical mathematics then Matlab is very suitable, especially so since you are already skilled in its use.
You might write faster programs if you picked up C or Fortran, though perhaps not as much faster as you would hope since Matlab uses, for a lot of its numerical routines, the same BLAS (etc) libraries as you would if you were writing in C or Fortran. But from my working experience my colleagues find the ability to write programs more quickly much more important than writing quicker programs. They generate a lot of ideas which, upon reflection, they later reject. The added speed of development that Matlab gives over and above C and Fortran means that they go through the whole cycle (which generally includes visualisation of results) a lot more quickly and do it more often, so doing more science by some crude measure.
(As an aside: one of the jobs I get is to turn some of the Matlab code that is not rejected into Fortran programs for execution on the company's large clusters. But that's what happens to some of our codes when the initial research is complete and we want to deploy them for production.)
I'd also point out that Matlab has good parallel computing capabilities (if you can afford them) through its Parallel Compute Toolbox, which will probably be of interest as your problems become larger and you realise that you are underusing some of your cores, gosh it's even got integration with GPU computing in the latest release.
In a nutshell I'd suggest that staying with Matlab will allow you to focus on your mathematical research and not divert your attention to wrestling with a new toolset. Especially so since you do not suggest that Matlab is inadequate for your expected needs.
If you are mainly involved in prototyping algorithms that involve simple data structures, matlab is a great choice. The workflow of many academics working in computational fields is: develop a new algorithm, check that it works in matlab, then you write your paper, and you're done. If this is all you wish to do, stick with what you know (matlab).
If you want to do more than that... Well Fortran and C/C++ are not directly comparable to Matlab because there is just no reason to use a compiled language unless performance is critical. Python, on the other hand, has a similar feature set to matlab, in addition to being a free full programming language with a vibrant online community. The downsides to switching to python are surprisingly negligible, and the upsides are huge. I miss some of Matlab's array handling syntax, as Numpy (python's module for array manipulation) has a few quirks, but that's about it. I switched from matlab to Python recently, and I don't plan on going back. Matlab seemed to make me write code in the worst possible way. My python code is much cleaner, more modular, and easier to read. Also, the Sphinx documentation system is terrific.
In short, consider python if:
You are going to need to maintain a large codebase
You want to make your project open source and have others contribute
You want to make your code available to people without a matlab license
You want to write your own custom data structures other than arrays (trees, graphs, ...)
You need to implement non-numeric code (search local directories, download from urls, find local files using regular expressions, text processing)
You want to generate awesome documentation easily and effectively
You don't want to spend cash on a matlab license
Here's a link arguing for python over matlab for scientific research: http://www.stat.washington.edu/~hoytak/blog/whypython.html
Here's a self indulgent link showing the amazing potential of python Sphinx to auto-generate beautiful online documentation that seamlessly integrates mathematical derivations and actual source code: http://pythonhosted.org/fit_neuron/overview.html
Python seems poised to become THE standard in scientific computing, so it's definitely worth learning.
Speaking as someone who moves between academia and industry in an engineering field, the only reason I don't use Matlab more is because of the cost. If you and all the people you want to give code to have Matlab licenses then there's no reason to switch.
If you find that parts of your code need to be optimised, you can rewrite just those bits in a lower-level language and call them from your Matlab program. Switching languages for performance reasons is a case of premature optimisation, in my opinion. I solve computation-intensive problems in an iterative process:
Put together a solution in the quickest and most straightforward way first, which in your case means using the language you know best.
Run it with a limited data set using a profiler and figure out where the bottlenecks are.
Fix the worst bottleneck, using any of the following methods: a) Change the algorithm, b) optimise using the features of the current development environment, c) rewrite that bit of code in something that executes faster for that particular problem.
Go back to 2. until your run time/development time equation reaches whatever threshold you're comfortable with (or, if you're a graduate student, until your supervisor shouts at you to STOP FIDDLING WITH THE BLOODY THING AND JUST RUN IT ALREADY).
In other words, don't stress about performance until it becomes a problem, especially if you're writing code for your own use.
Well I'm more a C++/Java programmer than a Matlab one, although I have used Matlab, but I think that for mathematical research, Matlab is rather well suited. Research is something that involves a lot of experimentation, and C++ is a dire language in which to do experimentation. Matlab makes it very easy to test things quickly, find out which ones work and which don't, and move on. You can always code up your solutions in another language once you know what you want to do, assuming that the Matlab version is too slow (from the limited amount I've seen of it, sometimes it is, sometimes it isn't).
Bottom line: you might not want to use Matlab for everything (the phrase "if all you have is a hammer, everything looks like a nail" springs to mind), but it's certainly a good language for the specific task of mathematical research.
I would also consider the software Mathematica which is great for some of the needs mathematicians have
I think matlab is fine for you, because c is a general purpose language, while matlab is designed for math.
Matlab excels in:
high-level matrix math (just compute A*B, you don't have to call A.multiply(B) or some C++/Java type syntax)
data analysis
data visualization
interfacing with Java
and there are enough libraries/tools to do almost anything else in an easy (but not necessarily optimized) way that you can stay working in MATLAB once you start.
I would hate to use some software package that is great for, say, matrix math, but then when I go to do something else, it is lousy and I face the choice of either accepting that lousiness or abandoning my work and using different software.
You willl certainly see that Matlab is fast on some points, but when you need specialized things like manual memory management for working with a vector that exceeds what Matlab wants to give you, you'll need to jump through some hoops.
I'm sure you can do everything quick and easy in Matlab, but I've come to see it as quite cumbersome in terms of elegance and post-optimization readability. Vector math is certainly fun and quick, but I find it hard to spot the dimensions sometimes.
I'd say stick with what you know, and switch when you're convinced Matlab can't do it. Learning another language is hard, especially when you want quick code, and numerical calculations.
On a sidenote, I prefer C++, together with some awesome libraries (GSL, Eigen, etc.). The funny thing is that I still make my plots in Matlab, because I came to know that part of Matlab very well :)

Basic guidelines for high-performance benchmarking

I am going to benchmark several implementations of a numerical simulation software on a high-performance computer, mainly with regard to time - but other resources like memory usage, inter-process communication etc. could be interesting as well.
As for now, I have no knowledge of general guidelines how to benchmark software (in this area). Neither do I know, how much measurement noise is reasonably to be expected, nor how much tests one usually carries out. Although these issues are system dependent, of course, I am pretty sure there exists some standards considered reasonable.
Can you provide with such (introductory) information?
If a test doesn't take much time, then I repeat it (e.g. 10,000 times) to make it take several seconds.
I then do that multiple times (e.g. 5 times) to see whether the test results are reproduceable (or whether they're highly variable).
There are limits to this approach (e.g. it's testing with a 'warm' cache), but it's better than nothing: and especially good at comparing similar code, e.g. for seeing whether or not a performance tweak to some existing code did in fact improve performance (i.e. for doing 'before' and 'after' testing).
The best way is to test the job you will actually be using it for!
Can you run a sub-sample of the actual problem - one that will only take a few minutes, and simply time that on various machines ?

Less Mathematical Approaches to Machine Learning?

Out of curiosity, I've been reading up a bit on the field of Machine Learning, and I'm surprised at the amount of computation and mathematics involved. One book I'm reading through uses advanced concepts such as Ring Theory and PDEs (note: the only thing I know about PDEs is that they use that funny looking character). This strikes me as odd considering that mathematics itself is a hard thing to "learn."
Are there any branches of Machine Learning that use different approaches?
I would think that a approaches relying more on logic, memory, construction of unfounded assumptions, and over-generalizations would be a better way to go, since that seems more like the way animals think. Animals don't (explicitly) calculate probabilities and statistics; at least as far as I know.
The behaviour of the neurons in our brains is very complex, and requires some heavy duty math to model. So, yes we do calculate extremely complex math, but it's done in a way that we don't perceive.
I don't know whether the math you typically find in A.I. research is entirely due to the complexity of the natural neural systems being modelled. It may also be due, in part, to heuristic techniques that don't even attempt to model the mind (e.g., using convolution filters to recognise shapes).
If you want to avoid the math but do AI like stuff, you can always stick to simpler models. In 90% of the time, the simpler models will be good enough for real world problems.
I don't know of a track of AI that is completely decoupled from math though. Probability theory is the tool for handling uncertainty which plays a major role in AI. So even if there was not-so-mathematical subfield, math techniques would most be a way to improve on those methods. And thus the mathematics would be back in game. Even simple techniques like the naive Bayes and decision trees can be used without a lot of math, but the real understanding comes only through it.
Machine learning is very math heavy. It is sometimes said to be close to "computational statistics", with a little more focus on the computational side. You might want to check out "Collective Intelligence" by O'Reilly, though. I hear they have a good collection of ML techniques without math too hard.
You might find evolutionary computing approaches to machine learning a little less front-loaded with heavy-duty maths, approaches such as ant-colony optimisation or swarm intelligence.
I think you should put to one side, if you hold it as your question kind of suggests you do, the view that machine learning is trying to simulate what goes on in the brains of animals (including Homo Sapiens). A lot of the maths in modern machine learning arises from its basis in pattern recognition and matching; some of it comes from attempts to represent what is learnt as quasi-mathematical statements; some of it comes from the need to use statistical methods to compare different algorithms and approaches. And some of it comes because some of the leading practitioners come from scientific and mathematical backgrounds rather than computer science backgrounds, and they bring their toolset with them when they come.
And I'm very surprised that you are suprised that machine learning involves a lot of computation since the long history of AI has proven that it is extremely difficult to build machines which (seem to) think.
I've been thinking about this kind of stuff a lot lately.
Unfortunately, most engineer/mathematician types are so tied to their own familiar mathematical/computational worlds, they often forget to consider other paradigms.
Artists, for example, often think of the world in a very fluid way, usually untethered by mathematical models. Much of what happens in art is archetypal or symbolic, and often doesn't follow any seemingly conventional logical arrangement. There are, of course, very strong exceptions to this. Music, for instance, especially in music theory, often requires strong left brained processes and so forth. In truth, I would argue that even the most right brained activities are not devoid of left logic, but rather are more complex mathematical paradigms, like chaos theory is to the beauty of fractals. So the cross-over from left to right and back again is not a schism, but a symbiotic coupling. Humans utilize both sides of the brain.
Lately I've been thinking about a more artful representational approach to math and machine language -- even in a banal world of ones and zeroes. The world has been thinking about machine language in terms of familiar mathematical, numeric, and alphabetic conventions for a fairly long time now, and it's not exactly easy to realign the cosmos. Yet in a way, it happens naturally. Wikis, wysisygs, drafting tools, photo and sound editors, blogging tools, and so forth, all these tools do the heavy mathematical and machine code lifting behind the scenes to make for a more artful end experience for the user.
But we rarely think of doing the same lifting for coders themselves. To be sure, code is symbolic, by its very nature, lingual. But I think it is possible to turn the whole thing on its head, and adopt a visual approach. What this would look like is anyone's guess, but in a way we see it everywhere as the whole world of machine learning is abstracted more and more over time. As machines become more and more complex and can do more and more sophisticated things, there is a basic necessity to abstract and simplify those very processes, for ease of use, design, architecture, development, and...you name it.
That all said, I do not believe machines will ever learn anything on their own without human input. But that is another debate, as to the character of religion, God, science, and the universe.
I attended a course in machine-learning last semester. The cognitive science chair at our university is very interested in symbolic machine learning (That's the stuff without mathematics or statistics ;o)). I can recommend two outstanding textbooks:
Machine Learning (Thomas Mitchell)
Artificial Intelligence: A Modern Approach (Russel and Norvig)
The first one is more focused on machine learning, but its very compact has got a very gentle learning curve. The second one is a very interesting read with many historical informations.
These two titles should give you a good overview (All aspects of machine learning not just symbolic approaches), so that you can decide for yourself which aspect you want to focus on.
Basically there is always mathematics involved but I find symbolic machine learning easier to start with because the ideas behind most approaches are often amazingly simple.
Mathematics is simply a tool in machine learning. Knowing the maths enables one to efficiently approach the modelled problems at hand. Of course it might be possible to brute force one's way through, but usually this would come with the expense of lessened understanding of the basic principles involved.
So, pick up a maths book, study the topics until it you're familiar with the concepts. No mechanical engineer is going to design a bridge without understanding the basic maths behind the system behaviour; why should this be any different in the area of machine learning?
There is a lot of stuff in Machine Learning, outside just the math..
You can build the most amazing probabilistic model using a ton of math, but fail because you aren't extracting the right features from the data (which might often require domain insight) or are having trouble figuring out what your model is failing on a particular dataset (which requires you to have a high-level understanding of what the data is giving, and what the model needs).
Without the math, you cannot build new complicated ML models by yourself, but you sure can play with existing tried-and-tested ones to analyze information and do cool things.
You still need some math knowledge to interpret the results the model gives you, but this is usually a lot easier than having to build these models on your own.
Try playing with http://www.cs.waikato.ac.nz/ml/weka/ and http://mallet.cs.umass.edu/ .. The former comes with all the standard ML algorithms along with a lot of amazing features that enable you to visualize your data and pre/post-process it to get good results.
Yes, machine learning research is now dominated by researchers trying to solve the classification problem: given positive/negative examples in an n-dimensional space, what is the best n-dimensional shape that captures the positive ones.
Another approach is taken by case-based reasoning (or case-based learning) where deduction is used alongside induction. The idea is that your program starts with a lot of knowledge about the world (say, it understands Newtonian physics) and then you show it some positive examples of the desired behavior (say, here is how the robot should kick the ball under these circumstances) then the program uses these together to extrapolate the desired behavior to all circumstances. Sort of...
firstly cased based AI, symbolic AI are all theories.. There are very few projects that have employed them in a sucessfull manner. Nowadays AI is Machine Learning. And even neural nets are also a core element in ML, which uses a gradient based optimization. U wanna do Machine learning, Linear Algebra, Optimization, etc is a must..

Exhaustive testing and the cost of "Bug Free"

When I was learning software development, we were taught that actual "bug free" software was mathematically impossible for anything but the most trivial programs. For a mathematical mind, it's very simple to see how basic thingslike the number of possible inputs and the variability of platforms makes bug free not only impossible (in realistic time), but economically stupid for anything short of nuclear power generation.
However I'm constantly hearing business people spout off with "It's understood that software will be bug free, and if it's not all bugs should be fixed for free". I typically respond with "No, we'll fix any bugs found in the UAT period of (x) weeks" where x is defined by contract. This leads to a lot of arguments, and loss of work to people who are perfectly willing to promise the impossible.
Does anyone know of (or can express one) a good explanation of why "bug free" is NOT realistic OR standard -- that your average middle manager can understand?
See Gödel's incompleteness theorems
See also Hilbert's second problem
See also Turing: Halting Problem
See also MSFT financial reports for headcount numbers and Microsoft Connect for bug reporting on Microsoft products for a less intellectual explanation.
Perhaps the best way to explain it would be to read up a little on places that really, really, really don't want software bugs, and what they do about it. (You can use NASA as an example, and the Ariane 5 first launch as an example of what happens with such software bugs.) Middle managers tend to relate to stories and parallel examples.
Alternately, find out what happens with deals where one side does promise the impossible (and it happens much more often than developers like). If you can show that it doesn't end well for the promisee, that might help.
Also, you might want to go into what you would need as a bare minimum to promise bug-free software, which would be a truly comprehensive spec.
I usually walk managers through a simple explanation of how most programs are really state engines, and that as soon as you start interfacing with the real world the number of possible input states rapidly reaches infinity: because the user over here is inputting X while Y happens over here within 50ms of Z happening over there... etc, etc.
Granted, after about five minutes of this their eyes tend to glaze over. But at least I tried.

Resources