🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.prolog
Article #4345

Urgently need help !!!!

#4345
From: nicholas
Date: Tue, 23 Feb 1999 00:00
27 lines
1483 bytes
Hello everyone, I urgently need help on prolog programming in my coursework.
Please help me if possible!!

The question is as below:

1. Define a predicate int that takes three lists as arguments and return Yes
if and only if the first two lists have the same length and the third list
is the same as the first two interleaved.
For example, int ([1,2], [4,5], [1,4,2,5]) should return Yes.

2. Explain how the predicate int, defined above, could be used to define a
predicate even that returns Yes if and only if its argument is a list with
even length.

Define even in this manner and explain why the following does not correctly
define a predicate odd that returns Yes if and only if its argument is a
list of odd length:

odd(X) :- not even(X).

How could this be changed to correct the deficiencies.

Please help me and e-mail me the answer for the above two questions. Thank
you in advanced.

Best Regards,
Nicholas
Technical Details
Message-ID: <7as4t8$cjs$1@mawar.singnet.com.sg>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f907c,3da97644542a4068,start
X-Google-Attributes: gidf907c,public
X-Google-Thread: 1217ff,3da97644542a4068,start
X-Google-Attributes: gid1217ff,public
From: "nicholas" <veryyong@mbox4.singnet.com.sg>
Subject: Urgently need help !!!!
Date: 1999/02/23
Message-ID: <7as4t8$cjs$1@mawar.singnet.com.sg>
X-Deja-AN: 447147469
Organization: Singapore Telecommunications Ltd
X-MimeOLE: Produced By Microsoft MimeOLE V4.71.1712.3
Newsgroups: comp.lang.prolog,fj.lang.prolog