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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T05:42:51+00:00 2026-06-04T05:42:51+00:00

The test should returns true: if the first part is true, and the second

  • 0

The test should returns true: if the first part is true, and the second part is false.

Tried to do something like that:

f_test  :- f(x), % 1st part
           f(y) is false. % 2nd part

But it gives me an error:

ERROR: is/2: Arithmetic: `false/0' is not a function.

Please tell me, how to do it correctly?

  • 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-06-04T05:42:53+00:00Added an answer on June 4, 2026 at 5:42 am

    (is)/2 is a predicate intended to perform arithmetic. Even if your test was about arithmetic, the use of (=:=)/2 would be preferred (because (is)/2 is used to instantiate a variable. When you use it to check a variable value, you misuse it. OTOH, (=:=)/2 is used to compare numbers).

    But here your test isn’t about arithmetic, it’s about knowing if something is true or not. There is an operator for that, which checks if a given term is provable or not, it’s (\+)/1, use is:

    f_test :-
        f(x),
        \+ f(y).
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I understand that in my unit test I should do BOOST_TEST_MESSAGE(message); instead of std::cout
http://jsperf.com/testing-foreach-vs-for-loop It was my understanding that Test Case 2 should run more slowly than
I want that my unit tests to cover my POCO's. How should I test
I'm using ruby 1.9 and I'm trying to do BDD. My first test 'should
I have a unit tests that test if the first name of a baby
I have the following code require 'test_helper' class ApplicationControllerTest < ActionController::TestCase test should display
I have following code: os.chdir(os.path.dirname(os.path.realpath(__file__)) + /../test) path.append(os.getcwd()) os.chdir(os.path.dirname(os.path.realpath(__file__))) Which should add /../test to
What should I write in my .vimrc file to test whether I am running
I have been suggested to use should:rise in my test case to test for
I have following spec to test controller method: context #create do it should redirect

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.