Re: How to create a list of sharing variables?



On Tue, 12 Sep 2006, bart demoen wrote:

1) only two problems in the book benefit from using assert; in most
contests, it was actually forbidden explicitly to use assert; the reason
is that using assert drives you away from logic (which Prolog is only
an approximation to anyway, but assert makes it worse)

I guess you are right with this. After successfully solving the task I saw
that my approach was quite different from the given solution. I hadn't
stored the crossword in an array but as a number of facts field(X,Y,_). I
also had the idea to transpose rows and columns but did it by replacing
the facts with transposed ones...

Now let me give a hint on how to implement the hint on page 9 of the book:

Thanks for your help. In fact, I got rid of the problem with the
non-sharing variables by storing all facts as objects in a list and using
member/2 to access them. BTW, I liked the predicate fill_in/2 from the
given solution. It is very elegant (even though not too quick).

This leads me to a different, but related question:

Given a general task, where the input consists of some objects (maybe of
more than one type) that shall be combined to create new objects (of a
different type). What would be the best way to represent the objects in a
Prolog program? Should I enter/assert them as facts or would it be better
to put them all into a single list?


Wolfgang
.



Relevant Pages

  • Re: BizTalk 2004 :: Fact retriever :: more than 1 data connection?
    ... I tried executing the assert statement twice so that my rules policy can go ... Object facts, Object data, EngineState nextState) ... > connection being handed back. ...
    (microsoft.public.biztalk.general)
  • Re: The Tears Of Finding The Truth
    ... I know in some sense you do, because there's little factual room to disagree, even though you yourself like to deflect to 'HYPERETHNOCENTRISM' and the hatreds as living proof of...? ... And you provided nothing to assert, when I provided a small mountain of evidence and a forum for discussing what it means and entails. ... Your's was a flatus in a blizzard- a pile of not much of anything except your conclusion, which you just stated with no more facts than your own erroneous review, a faked one, taken from a one page reading from somewhere, that clearly shows this: you need to believe you are a giant. ... source and how it fits and then try to sell how I don't understand the causes, and all you had was hyperethnocentrism, and a few other flatulent self blame and blame of america, and it's you who are very very short of minimal study in the issues, the facts. ...
    (rec.martial-arts)
  • Re: BizTalk 2004 :: Fact retriever :: more than 1 data connection?
    ... > at Microsoft.RuleEngine.Rete.Rete.ExecuteInternal(Object facts, Object ... > object factsHndlOut = null; ... >> Simply create and assert more than one dataconnection. ... >> connection being handed back. ...
    (microsoft.public.biztalk.general)
  • Re: IFactRetirever -- can we parameterize on already asserted fact
    ... long term facts, but not through the use of DataConnection. ... UpdateFacts method so that I can run the SQL query and populate my cache. ... data has been cached and assert it into the BRE without going to the database. ...
    (microsoft.public.biztalk.general)