Re: Comparing Two lists



In message <b2a20b65891de5ab8ca79b81cb099af9@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx>, DJRock <dj.rock@xxxxxxxxxxxxxx> writes
hi all
i want to create prolog program in which i can compare two lists with
having different elements
That comparision should include transitivity and also can bound same
elements
Examples like
1) [a,b,c,d] == [a,?x,c,d] then ?x should bound with b
2) [a,?x,?y,d] == [a,b,c,d] then ?x = b and ?y = c
3) [a,?x,c,d] == [a,?y,?y,d] then ?y = c so ?x also = c
If any one can think over this then it will be great thing
thanks for looking at my problem

This is extremely easy to implement in Prolog.

What do you want it to do if the lists are different lengths?

Nick
--
Nick Wedd    nick@xxxxxxxxxxxxx
.



Relevant Pages

  • Re: Comparing Two lists
    ... i want to create prolog program in which i can compare two lists with ... That comparision should include transitivity and also can bound same ...
    (comp.lang.prolog)
  • Comparing Two lists
    ... i want to create prolog program in which i can compare two lists with ... That comparision should include transitivity and also can bound same ...
    (comp.lang.prolog)
  • Re: fastest sorted list type?
    ... I'm not aware of any scenario you've mentioned in which what you're sorting is "just an int". ... Yes, you have a scenario in which you are sorting a list of ints, but when you actually compare two entries in that list you aren't comparing the integers themselves, but rather the data in an object to which the int refers. ... I did have a look on google and wiki lists al the sort algorothms nicely, ...
    (microsoft.public.dotnet.languages.csharp)
  • Fuzzy comparison
    ... I'm trying to come up with a simple function that will allow me to compare ... long as they are within some tolerance but I also want the function to "act" ... total(but a weighted sum). ... compare two lists to see which one is "better". ...
    (sci.math)
  • Isabelle likes patron
    ... Who lists elsewhere, ... They are prevailing on behalf of the race now, ... Some fights miss, compare, and ...
    (sci.crypt)