sicstus-prolog

Generalizing Fibonacci sequence with SICStus Prolog

I'm trying to find a solution for a query on a generalized Fibonacci sequence (GFS). The query is: are there any GFS that have 885 as their 12th number? The initial 2 numbers may be restricted between 1 and 10. I already found the solution to find the Nth number in a sequence that starts at (1, 1) in which I explicitly define the initia...

Code style preferences using Sicstus and Eclipse (Spider)

Hi all, i I am currently using Sicstus Prolog VC9 4.1.1 within Eclipse Galileo (Spider). I have got a very newbie question: how can I automatically control indentation and in general code style preferences? Thanks, I. ...

Variable binding in Prolog

Hi all, I have written a predicate common_participant(Person, PairEvent). which returns pairs of facts from my knowledge base. I was wondering whether there is any way to perform variable binding and collect all results without using the semicolon every time. Thanks, I. ...

regular expressions and Sicstus Prolog

Is there any regular expression library I can use with Sicstus Prolog VC9.4.1.1.? I am currently working under windows Vista. Thanks, Regards, I. ...

Prolog: Getting unique atoms from propositional formulas

Hi there, I can easily write a predicate to get unique elements from a given list in Prolog e.g. no_doubles( [], [] ). no_doubles( [H|T], F ) :- member( H, T ), no_doubles( T, F ). no_doubles( [H|T], [H|F] ) :- \+ member( H, T ), no_doubles( T, F ). However, how can you do the same thing but for something other than a normal lis...

Matching Multiple Lists

Hi there, I can write a predicate that is satisfied when two lists are equal e.g. equal([2,3],[2,3]) would be true and equal([2,3],[4,5]). would be false. However, what if I want to have a list and try and match it with any list in a list of lists e.g. match([2,3],[[5,6],[4,6,2],[2,3]]). would be true because of the last list in the li...