Help with structures
- From: "Wendy S" <wendywds@xxxxxxxxxxx>
- Date: Sat, 23 Apr 2005 18:55:58 -0700
I'm trying to understand structures. Specifically, how to change them or
make one go away. Using the example of cars here:
http://www.cs.may.ie/~jpower/Courses/PROLOG/structures.html
If you have:
has(joe, car(ford,3,5000)).
has(joe, car(opel,2,6000)).
What if joe sells his ford? How do you "get rid" of that statement?
Similarly, what if the third attribute is not price, but value, and the car
is now considered antique. How do you make
has(joe, car(ford,3,5000)).
"turn into"
has(joe, car(ford,25,25000)).
?
I had an intro class about four years ago, and all we did were the simple
'family relationships' type problems. Now, having finally gotten around to
taking the second class in the series, I'm being asked to read in atoms from
a text file and somehow represent objects based on the input... and they
will have to change and disappear during this process. (Yes, it's a
homework assignment.)
Thanks,
Wendy Smoak
.
- Follow-Ups:
- Re: Help with structures
- From: tmp123
- Re: Help with structures
- Prev by Date: Re: in praise of tabling
- Next by Date: Re: Wolf, Goat, Cabbage problem again
- Previous by thread: Wolf, Goat, Cabbage problem again
- Next by thread: Re: Help with structures
- Index(es):
Relevant Pages
|
|