Logic and Prolog
Posted by JF on 02 Dec 2009 at 07:27 PM
$0.00
Programming Languages / Assembly and Machine Lang
Q. Without using the built-in predicate subtract/3, write a Prolog predicate diff/3 to compute the difference between two given sets. Explain your answer. Recall that lists may be interpreted as sets if the ordering and duplicate elements are ignored.
Example: ?- diff([1,3,3,4], [4,5,8], X)
X = [1,3]
Example: ?- diff([1,3,3,4], [4,5,8], X)
X = [1,3]
Proposed Answers and Comments (oldest first)
In the event of multiple correct answers, you should accept the answer of the first user who provided a complete and valid answer to your question.
| Proposed answer by admin on 26 Sep 2008 at 05:23 AM Hi, |
Ask a Question
Most Recent Questions
Most Recent Answers
Home Page
Login
Register
Information Technology
Programming Languages
- ASP and ASP.NET
- Assembly and Machine Lang
- C and C++
- C#
- Carbon (Macintosh)
- Cold Fusion
- Delphi
- Flash
- FoxPro
- HTML and XHTML
- Java
- Javascript and JScript
- JSP
- Perl
- PHP
- Python
- Ruby on Rails
- VB, VBA, and VB.NET
- VBScript
- XML and XSL
Database
Graphic Design
Operating Platforms
Hardware and Networking
Math and Science
Biology and Geology
Math and Statistics
Chemistry
Physics
Engineering

Are you an information
Most Recent Questions
Most Recent Answers
Home Page
Login
Register
Information Technology
Software, Hardware, Design
Programming Languages- ASP and ASP.NET
- Assembly and Machine Lang
- C and C++
- C#
- Carbon (Macintosh)
- Cold Fusion
- Delphi
- Flash
- FoxPro
- HTML and XHTML
- Java
- Javascript and JScript
- JSP
- Perl
- PHP
- Python
- Ruby on Rails
- VB, VBA, and VB.NET
- VBScript
- XML and XSL
Database
Graphic Design
Operating Platforms
Hardware and Networking
Math and Science
Homework Help
Biology and GeologyMath and Statistics
Chemistry
Physics
Engineering
Are you an information
technology or
math/science expert?
You can earn money by
providing answers to questions
at AnswerArchive.com.
Learn How