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 7492023
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T16:12:52+00:00 2026-05-29T16:12:52+00:00

This is my arithmetic inequality expression in prolog: 2*X + 3*Y > 4*Z I

  • 0

This is my arithmetic inequality expression in prolog:

2*X + 3*Y > 4*Z

I used the unity term manipulator like this:

Expr =.. [Op, Lhs, Rhs]

And now I have Lhs = 2*X + 3*Y, Rhs as 4*Z and Op as >
Everything fine till now.

What I want is to construct a delayed goal using the IC library in Eclipse Prolog for this expression.
Example, I want a newly created variable to assigned like this:

Eq = (Lhs #Op Rhs)  %meaning, Eq = (2*X + 3*Y #> 4*Z)

Now, since the required inequality (in this case >), is stored in Op, though I use Eq = (Lhs #Op Rhs), eclipse is returning error.

How do i create this delayed constraint, when my operator is to be taken from the variable Op?
Thank You.

  • 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-29T16:12:53+00:00Added an answer on May 29, 2026 at 4:12 pm

    You could use facts to define the relations:

    cstr(=,#=).
    

    Or use concat_atom/2:

    concat_atom([#,Op],CstrOp),
    

    E.g.:

    ?- Eq = (X = 1),
       Eq =.. [Op, L, R],
       concat_atom([#, Op], CstrOp),
       Cstr =.. [CstrOp, L, R],
       call(Cstr).
    Eq = 1 = 1
    X = 1
    Op = =
    L = 1
    R = 1
    CstrOp = #=
    Cstr = 1 #= 1
    Yes (0.00s cpu)
    

    Note that this only works for the basic equality/inequality operators. You cannot add # to just any operator and expect it to work as a constraint!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

How to evaluate arithmetic expression passed as argument in awk? I have this in
I have a class that dynamically overloads basic arithmetic operators like so... import operator
I have a program that segfaults from pointer arithmetic sometimes. I know this happens,
I have a number of NSStrings like this: NSString *eightlabel = @The process is
Can someone please help me out with a JavaScript/jQuery solution for this arithmetic problem:
This might seem like a stupid question I admit. But I'm in a small
I wrote this code to do the IEEE 754 floating point arithmetic on a
Is there any difference between Arithmetic + and bitwise OR. In what way this
What type do arithmetic operators (+ - / *) have in PHP? I have
I have designed a quick and basic vector arithmetic library in C++. I call

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.