Cryptarithmetic problem in artificial intelligence, Computer Engineering

Solve the following cryptarithmetic problem using Prolog:

P I N G
P O N G
+ F U N
---------
I G N I P

Each of the 7 different letters stands for a different digit. The aim is to find a substitution of digits for the letters such that the resulting sum is arithmetically correct. Your program should find ALL answers, that do not have leading zeros.

It should be possible to query your solution in this manner:

?- crypt(P,I,N,G,O,F,U).

Your solution should then produce all of the combinations of the digits that satisfy the addition problem above. Don't get
confused between the letter "O" and the number "0" (zero).

HINT - use generate-and-test.

HINT - make sure you never let P=N, or G=F, etc... all of the
distinct letters have to stand for distinct digits.

2. Assume that you have a set of facts about airline flights in the following format:
flight(Number,Source,Dest,Leaves,Arrives).
for example:
flight(22,la,ny,10,15).
means that flight #22 leaves "la" at 10am and arrives
in "ny" at 3pm (assume a 24-hr clock, integers only).

Write the following rules:

-- long(Number,Time)
is true for flights which are in the air longer than Time.
-- route(Source,Dest)
is true for each pair of cities for which there is some sequence of flights starting at Source and ending at Dest.
(it doesn't have to display the route, just be true if there is a route).

You may assume that all flights are completed within the 0-24 time period.... that is, you DON'T have to worry about flights
which arrive after the clock "wraps around" back to zero.
The best solutions are queryable.

Posted Date: 2/21/2013 5:43:07 AM | Location : United States







Related Discussions:- Cryptarithmetic problem in artificial intelligence, Assignment Help, Ask Question on Cryptarithmetic problem in artificial intelligence, Get Answer, Expert's Help, Cryptarithmetic problem in artificial intelligence Discussions

Write discussion on Cryptarithmetic problem in artificial intelligence
Your posts are moderated
Related Questions
The Communication Traffic gives a pictorial view of the communication traffic in the interconnection network with respect to the time in progress. The Communication Traffic shows t

What is a digital multiplexer?  Ans: Multiplexer: Data selector or MUX is a logic circuit selects binary information from one of several input and directs this to a sing

Visibility. Controls should be clearly visible, so users can see the controls that are available to them. Visual feedback should also be clearly visible, so users can understand wh

Synchronization Latency Problem:  If two simultaneous processes are performing remote loading, then it is not recognized by what time two processes will load, as the issuing proces

What is reduction?  A reduction is a way of changing one problem into another in such a way that a solution to the second problem can be used to explain the first problem.

Explain difference between Security and Protection? Protection mechanism: The subsequent mechanisms are commonly utilized for protecting files having programs and data. (a

In computer science, garbage collection (GC) is a form of automatic memory management. The garbage collector, or just collector, attempts to reclaim garbage, or memory occupied by

explain the construction and working of calomel electrode

Explain Sequential logic circuit Ans. Sequential logic circuit:- (i) Output not only depends upon the recent state of the input but also depend upon the earlier state

Determine the function of Dynamic model Dynamic model: Dynamic model describes how system responds to external events. The implementation of the control flow in a program must