Sei sulla pagina 1di 3

Executive summary

Prolog is a declarative logic programming language. In a declarative programming language, we tell the
computer what problems we want to solve, by giving it clues as to what the solution method would look
like. The Prolog will make inference from the database of facts and rules to figure out the solution.
Prolog is particularly suited to programs that involves symbolic and non-numeric computation with a
specific focus on Artificial Intelligence (AI). It is generally used in Natural Language Processing(NLP),
Pattern matching and State space search and planning. Execution of Prolog is equivalent to searching the
tree of possibilities and determining the objects which satisfy the given rules. It has an excellent
backtrack mechanism, which is equivalent to depth first search, which is a very efficient algorithm for
traversing tree with many nodes. A program is run by presenting some query and seeing if this can be
proved by the known rules and facts.

Implement Itinerary Planner for popular attraction in London. This itinerary planner provides high level
of user interaction (like a smartphone AI assistant) by asking the user where would he/she would like to
start their journey from and what popular destination would he like to visit. It also prompts the user if
he would like to choose any other popular attraction after showing the first set of results. After the user
inputs the attraction he would like to visit, it suggests the best route to take for the attraction through
the London underground if the walking distance is more than 500m, however if the walking distance is
less than 500m it will not suggest you take the London underground. In addition to that, if the user is
missing out on other popular attraction via that route it also indicates these suggestions.

The database has the list of popular attraction and around 39 routes via which the user can navigate to
different attractions. Each attraction is like a node in a graph which may be connected to other nodes in
the graph directly or indirectly. The best way to represent the node in the graph is by using a database
of facts to represents the nodes of the graph and its connection. The distance measured between the
node is accurate to ± 100m. The distance was carefully computed with the help of the google maps. So
that the user can navigate to any of these 39 routes which cover almost all popular attraction and plan
their itinerary on the go. it employs the Best First Search algorithm, so that the user always gets to
choose the shortest path between two attractions on the go. Best First Search algorithm is informed
search strategy, which searches the most promising branches of the State space. It finds the solution
more quickly compared to the Depth First Search algorithm that prolog implicitly use to search the state
space. Best first search often finds a better solution, since it searches the more profitable parts of the
state space.

It is important to note that, the route that involves the smallest number of stops may not necessarily be
the route with shortest path. In best first search, to represent a path on the list of alternative paths as a
structure of the form r(M, P), where M is the total length of the path in miles, and P is the list of place
visited. In this program the search_plan predicate finds the shortest of the paths on the list of
alternatives. Where the predicate shortest return the shortest path on the list, and returns the
remaining paths on the list. With the shortest path compute so far, the predicate proceed finds all the
legal extension to the path, and add them to the list.

Potrebbero piacerti anche