qertlc.blogg.se

Block world problem in prolog
Block world problem in prolog








block world problem in prolog

To make the problem simpler, here we mainly focus on the syntax, without worrying about the semantics, e.g., what objects can or cannot be taken. Then other grammar rules will be updated accordingly to use “V-Put” and “V-Take”.Īre cubes, cones, and blocks the only nouns that can have action taken against them? (e.g., you cannot take a square or circle) Basically, instead of a general “V”, we can separate it to “V-Put” and “V-Take”. A larger disk cannot be placed on a smaller disk. There are two conditions that are to be followed while solving this problem. However, for your information, to distinguish “put” and “take” in this use, we can have lexicalized grammar. Towers of Hanoi Problem is a famous puzzle to move N disks from the source peg/tower to the target peg/tower using the intermediate peg as an auxiliary holding peg. My testing cases will be strictly following the training examples, will not be testing anything like “put that ball”. It is clear that heuristics, exploitation of.

block world problem in prolog

There is no sense trying with more, especially not with 4 places, 7 blocks. 3 places, 5 blocks succeeds with 9 moves after 97'288'255 calls to plan/3. 3 places, 4 blocks succeeds with 7 moves after 915'703 calls to plan/3. We have not talked about lexicalized grammar, so we will not worry about this difference for now. 4 places, 3 blocks succeeds with 5 moves after 98'304 calls to plan/3. Good catch here! There is indeed a difference between “put” and “take”.

#Block world problem in prolog how to#

I'm not sure how to accept take but not put for my one rule that accepts a noun with an empty pp. But all the testing cases will not go beyond the ones you've seen in the training data.Ī valid sentence is take the ball, but it looks like put the ball is not. It should be able to support an arbitrary number of pps as valid input.

block world problem in prolog

Is it alright to have an infinite number of chains for the prepositional section of the sentence? For example, is valid input, or should this terminate after 1 or 2 prepositions? You can change np->np, pp to " np->det, n, pp, etc. Your third rule np->np, pp will loop infinitely.










Block world problem in prolog