🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.prolog
Article #4351

Re: Urgently need help !!!!

#4351
From: James M J Smith
Date: Thu, 18 Mar 1999 00:00
44 lines
1889 bytes
Dear Nicolas,

I have sat down for only three or four minutes and have defined the
predicates that answer all of the questions below.

My conclusion is that they are all answerable.

I hope that this help you.

Regards,
James M J Smith.

nicholas wrote in message <7as4t8$cjs$1@mawar.singnet.com.sg>...
>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: <36f088bf.0@duster.adelaide.on.net>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <7as4t8$cjs$1@mawar.singnet.com.sg>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f907c,3da97644542a4068
X-Google-Attributes: gidf907c,public
X-Google-Thread: 1217ff,3da97644542a4068
X-Google-Attributes: gid1217ff,public
From: "James M J Smith" <jamesmjsmith@onaustralia.com.au>
Subject: Re: Urgently need help !!!!
Date: 1999/03/18
Message-ID: <36f088bf.0@duster.adelaide.on.net>
X-Deja-AN: 455993084
References: <7as4t8$cjs$1@mawar.singnet.com.sg>
X-MimeOLE: Produced By Microsoft MimeOLE V4.72.2106.4
X-Trace: 18 Mar 1999 15:31:51 -1050, router.ffr.net
Newsgroups: comp.lang.prolog,fj.lang.prolog