Cryptarithmetic problem in artificial intelligence, Computer Engineering

Solve the following cryptarithmetic problem using Prolog:

+ F U N

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:
for example:
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
Building on their knowledge of research methods and their interest in a particular aspect of information technology this assessment enables students to put this knowledge into prac

Explain Tri-state logic inverter with the help of a circuit diagram. Give its Truth Table. Ans: Tri-state Logic Inverter: The functional diagram of Tri-state Logic Inve

Explain the term middleware in context of RPC. A variety of commercial tools have been urbanized to assist the programmer in constructing client- server software. These tools a

Question 1 What are the different schemes in power management? Explain 2 Explain the functions of parallel port in detail 3 (a) List and explain the functions of keyboard

What do you understand by Hit ratio? When a processor refers a data item from a cache, if the referenced item is in the cache, then such a reference is called hit. If the refer

What are the major components of a web browser? A browser contains a set of clients, a controller and a set of interpreters which manages them. All browsers must have an HTML

Accessing a Cache:  Direct mapping: (Block address) modulo (Number of cache block in the cache) The valid bit indicate whether an entry contain a valid address.

Q. RISC Performance using optimizing compilers? Performance using optimizing compilers: As instructions are simple compilers can be developed for efficient code organization a

What is refactoring? Refactoring is explained as the changes to the internal structure of software to improve its design without changing its external functionality. It is an e