🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.prolog
Article #3610

Re: Random Clause Selection

#3610
From: Thom Fruehwirth
Date: Fri, 26 Aug 1988 13:50
19 lines
994 bytes
I still think that random_permutation/2 should do the same think as
permutation/2, but return solutions in random order. This is also
how I specified random_perm/2 in my recent posting.

Besides, I think there is a more natural solutions to random clause
selection, which avoids indexing clauses:

	random_solve(true).
	random_solve((A,B)):- random_solve(A), random_solve(B).
	random_solve(A):- findall((A:-B),rule(A,B),RuleList),
			  random_perm(RuleList,RulePerm),
			 		   !,
			  member((A:-B),RulePerm),
			 		   random_solve(B).

Note that this is no implementation version.

thom
  
Technical Details
Message-ID: <1179@tuhold>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!water!watmath!clyde!att!osu-cis!tut.cis.ohio-state.edu!mailrus!ames!amdcad!sun!pitstop!sundc!seismo!uunet!mcvax!tuvie!tuhold!thom

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!water!watmath!clyde!att!osu-cis!tut.cis.ohio-state.edu!mailrus!ames!amdcad!sun!pitstop!sundc!seismo!uunet!mcvax!tuvie!tuhold!thom
From: thom@tuhold (Thom Fruehwirth)
Newsgroups: comp.lang.prolog
Subject: Re: Random Clause Selection
Message-ID: <1179@tuhold>
Date: 26 Aug 88 13:50:59 GMT
Organization: Institut f. Angewandte Informatik, TU Vienna
Lines: 19