How to return clause in findall/3
From: rhapsody (blurrynight_at_yahoo.com)
Date: 08/12/04
- Next message: Sangai: "Re: Help I'm stuck!"
- Previous message: rhapsody: "Append to list"
- Next in thread: Pere Montolio: "Re: How to return clause in findall/3"
- Reply: Pere Montolio: "Re: How to return clause in findall/3"
- Reply: reader: "Re: How to return clause in findall/3"
- Reply: Pere Montolio: "Re: How to return clause in findall/3"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Wed, 11 Aug 2004 21:58:12 -0400
Hi, I am new to Prolog. What is the correct way of returning a list of
clauses 'sc/3' to the variable X? Below is my codes:
Database
sc(symbol Sid,symbol Cid, integer ExamScore).
Clauses
sc("S1","C1",55).
sc("S1","C2",60).
sc("S1","C3",70).
Goal
findall(sc(),sc(X,_,_),List), X="S1", write(List), nl.
Thanks in advance!
Stanly
- Next message: Sangai: "Re: Help I'm stuck!"
- Previous message: rhapsody: "Append to list"
- Next in thread: Pere Montolio: "Re: How to return clause in findall/3"
- Reply: Pere Montolio: "Re: How to return clause in findall/3"
- Reply: reader: "Re: How to return clause in findall/3"
- Reply: Pere Montolio: "Re: How to return clause in findall/3"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|