flex Examples - LPIS
flex Examples - LPIS
flex Examples - LPIS
- No tags were found...
You also want an ePaper? Increase the reach of your titles
YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.
16 Flex Example Listings*/The blocks world example - Adapted by - Phil Vasey==================================================This example implements the blocks world problem, as defined in'Logic for Problem Solving' by Robert Kowalski.Description-----------Essentially the problem is to move three blocks, one at a time,from the initial state to the final state shown below:Initial State Final State╔═╗║a║╚═╝╔═╗║b║╚═╝╔═╗ ╔═╗ ╔═╗ ╔═╗║c║ ║a║ ║b║ ║c║╚═╝ ╚═╝ ╚═╝ ╚═╝_______ _______ _______ _______ _______ _______Table p Table q Table r Table p Table q Table rRunning The Example-------------------The following goal reports each move as it is madewill run this example:?- find_blocks_solution.Flex Technical Points---------------------The following <strong>flex</strong> technical points are demonstrated in this example:1. The use of a single forward chaining rule to generate valid moves.2. The use of square brackets in conjunction with "or".group tablep, q, r.group blocka, b, c.template clearthere is nothing on top of ^ ./**/Templates also allow the definition of the inverse relationship,the second alternative for the ontop template shows this.template ontopblock ^ is on top of ^ ;block ^ is not on top of ^ .A Guide to the Flex Expert System Toolkit