Newsgroups: comp.lang.prolog
Path: cantaloupe.srv.cs.cmu.edu!das-news2.harvard.edu!news2.near.net!howland.reston.ans.net!math.ohio-state.edu!jussieu.fr!news.oleane.net!oleane!pipex!harlqn.co.uk!harlequin.co.uk!jason
From: jason@harlequin.co.uk (Jason Trenouth)
Subject: Re: [Q]: Comparing facts from two files
In-Reply-To: Ajith.P.Madurapperuma@cm.cf.ac.uk's message of Wed, 1 Feb 1995 22:29:04 +0000
Message-ID: <JASON.95Feb3124334@wratting.harlqn.co.uk>
X-Attribution: Jason
Sender: usenet@harlequin.co.uk (Usenet Maintainer)
Organization: Harlequin Ltd, Barrington Hall, Cambridge UK
References: <1995Feb1.222905.28198@cm.cf.ac.uk>
Date: Fri, 3 Feb 1995 12:43:34 GMT
Lines: 42


Arith> Hi, I have got an interesting question. 

I'm afraid it isn't _that_ interesting... :-(

Arith> I have two separte files with facts such as. 
Arith> e.g
Arith> 
Arith>   File 1			File 2
Arith> =====================          =====================
Arith>  emp(1,joe,25)			emp(5,joe,25)
Arith>  emp(2,ruth,32)			emp(1,jill,25)
Arith>      .					.
Arith>      .					.
Arith> 
Arith> 
Arith> What I need to do is to compare a fact from file 1 with all the facts in 
Arith> file 2 to check wether there are any similar ones or those 
Arith> that may have partially similar properties. 
Arith> 	
Arith> I can try to consult both files but then there are no ways to distinguish 
Arith> facts from file 1 from facts from file 2. 
Arith> 
Arith> One option could be to name the facts with two different
Arith> predicate names (say emp1 and emp2). 
Arith>  
Arith> Is there any efficient way of doing this kind of things. 

You just have to read the files yourself instead of using
"consult". Then you can assert them with extra distinguishing
information or simply carry them around as a parameter in your
program.

If your files are very large then you may have to consider leaving the
bulk of the information on disk anyway.

	Jason
--
_____________________________________________________________________________
| Jason Trenouth,                        | EMAIL: jason@uk.co.harlequin     |
| Harlequin Ltd, Barrington Hall,        | TEL:   (0223) 872522             |
| Barrington, Cambridge CB2 5RG, UK      | FAX:   (0223) 872519             |
