I'm trying to write a rule to compare two atoms to see which one is better for example (memory_with_gb_2 is better than memory_with_gb_1) and what I've written and tried in SWI-prolog is the following:
better_attribute3_in(Attribute3_in,Attribute3):-
atom_codes(Attribute3,List_Attribute3),
startsWith(List_Attribute3,Attribute3_Start,Rest_Attribute3_List),
atom_to_term(Rest_Attribute3_List,Attribute3_Number,_),
number(Attribute3_Number),
atom_codes(Attribute3_in,List_Attribute3_in),
startsWith(List_Attribute3_in,Attribute3_in_Start,Rest_Attribute3_in_List),
atom_to_term(Rest_Attribute3_in_List,Attribute3_in_Number,_),
number(Attribute3_in_Number),
Attribute3_in_Number>=Attribute3.
which is working perfectly in SWI-Prolog but when I try it in SICStus Prolog it just does not seem to work, is there anyway to implement the upper code in SICStus.
List_Attribute3
andList_Attribute3_in
should be the same. Otherwise, see @Per's response. BTW, you really should read the introductory tour to understand how this site works. I.e. if you get a fitten answer to your question, the accept/upvote. – false