Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1054249
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T17:22:32+00:00 2026-05-16T17:22:32+00:00

I have been learning prolog.. I’m using a editor named prol1.1.1 I need to

  • 0

I have been learning prolog.. I’m using a editor named prol1.1.1 I need to write rule to compare 2 strings, when i give something like

rel(a1,b1).
rel(a2,b2).
rel(b2,c2).

associatedWith(X,Y,Z) :- rel(X,Y),rel(Y,Z).

?- associatedWith(X,Y,Z).

it works

but when i give

?- associatedWith(X,Y,Z),X=\=Z.

i get parser exception

Parser exception [Should be evaluable ''a2''[7:31]] line 7:31 

what i got from websites is =\= is for numeric values, i wasn’t able to get answer for comparing string values.. can anyone help me..

and i wasn’t able to get gui for swi-prolog can u please help me with that too?
i need to use the call prolog from java program and the output has to be again processed in java, can anyone please help me..

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T17:22:32+00:00Added an answer on May 16, 2026 at 5:22 pm

    You are trying to compare atoms, not strings. Anyways, you need \=

     ?- aaa = aaa.
    true.
    
     ?- aaa \= aaa.
    false.
    
     ?- aaa \= aab.
    true.
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have been progressing through Learn Prolog Now! as self-study and am now learning
I have been learning how to create dynamic images and dynamic stylesheets using ASP.NET
I have been using Grails for last 3 weeks (learning and working). I have
I have been using Silverlight for quite a bit and am learning Windows Phone
I have been learning to develop websites using ASP.NET MVC 2 for work... and
I have been learning about the basics of C# but haven't come across a
I have been learning C++ for three months now and in that time created
I have been learning more and more javascript; it's a necessity at my job.
I have been learning to use Emacs for a little while now. So far
I have been learning C++ with some books from school that are from the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.