Welcome! Log In Create A New Profile

Advanced

chapter 11.1

Posted by chaospixel 
Announcements Last Post
Announcement SoC Curricula 09/30/2017 01:08PM
Announcement Demarcation or scoping of examinations and assessment 02/13/2017 07:59AM
Announcement School of Computing Short Learning Programmes 11/24/2014 08:37AM
Announcement Unisa contact information 07/28/2011 01:28PM
chapter 11.1
August 10, 2008 11:33AM
Has anyone else noticed that:

solve([[c,a,b],[],[]], Sol).

given:

s(Stacks, [Stack1, [Top1 | Stack2] | OtherStacks]) :-
del([Top1 | Stack1], Stacks, Stacks1),
del(Stack2, Stacks1, OtherStacks).

del(X, [X|L], L).
del(X, [Y|L], [Y|L1]) :-
del(X, L, L1).

goal(Situation) :-
member([a,b,c], Situation).

member(X, L) :- del(X, L, _).

solve(N, [N]) :-
goal(N).
solve(N, [N | Sol1]) :-
s(N, N1),
solve(N1, Sol1).

does not actually work? I think the problem is with s - but I can't figure out what is wrong with it.
avatar Re: chapter 11.1
September 14, 2008 11:00PM
Yeah.. it seems it only uses two stacks and doesn't check for repeating states.

I've been out of the loop and in a huge project.

I've just answered 3 out of the 4 questions for my overdue Assignment 3 and probably going to submit it with only these 3 question done.

sad smiley

 
  ,= ,-_-. =.
 ((_/)o o(\_))
  `-'(. .)`-'
      \_/
http://ilanpillemer.com
Entia non sunt multiplicanda praeter necessitatem
avatar Re: chapter 11.1
September 15, 2008 06:28PM
ok. worked it out and submitted complete assignment a wee bit late.

 
  ,= ,-_-. =.
 ((_/)o o(\_))
  `-'(. .)`-'
      \_/
http://ilanpillemer.com
Entia non sunt multiplicanda praeter necessitatem
Sorry, only registered users may post in this forum.

Click here to login