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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T16:48:14+00:00 2026-06-17T16:48:14+00:00

elem([],0). elem([H|T],R):-atomic(H),elem(T,R1),R1 is R+1. elem([H|T],R):-elem(H,R1),elem(T,R2),R is R1+R2. This is my code and after I

  • 0
elem([],0).

elem([H|T],R):-atomic(H),elem(T,R1),R1 is R+1.

elem([H|T],R):-elem(H,R1),elem(T,R2),R is R1+R2.

This is my code and after I searched the answer to my problem on this site, I didn’t find a good one. The error is : ?- elem([1,[2],3,4],R).

ERROR: is/2: Arguments are not sufficiently instantiated.

but it should be R = 3.

  • 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-17T16:48:15+00:00Added an answer on June 17, 2026 at 4:48 pm

    On the second line, you should have

    R is R1 + 1
    

    instead of

    R1 is R + 1.
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Here is some code: var class = function(elem,div){ this.elem= elem; this.div = div; this.init
Given this code: Element elem = new Element.html(<p>This is a paragraph.</p>); document.body.append(elem); document.body.children.add(elem); document.body.nodes.add(elem);
this is my code: var myarray=[(lots of things)]; var elem=document.getElementById('subtitle'); window.setInterval(function(){ elem.innerHTML=myarray[Math.round((myarray.length-1)*Math.random())]; },30000); This
I was looking through the jQuery code and found this line: elem.runtimeStyle.left = elem.currentStyle.left;
Here's my code: '$(.hoverfront).mouseenter(function () {' var elem = $(this); elem.flip({ direction: 'lr', color:
I'm using the following code in CoffeeScript: if elem in my_array do_something() Which compiles
I'd like to set vendor styles with Javascript, something like this: elem.style.mozBorderRadius = '5px';
function genTask(elem){ elem.each(function(){ $this=$(this).parent('.cntTasks'); var pattern=/taskId-(.*)$/ var idTask=$this.attr('id').match(pattern); var data='id_task='+idTask[1]; if(typeof jsVar2 !='undefined') data+=jsVar2;
$(this) //this refer to the elem how to get the first child of 'this'?
Looking in the jQuery core I found the following code convention: nth: function(elem, i,

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.