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

  • Home
  • SEARCH
  • 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 3977574
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T04:56:23+00:00 2026-05-20T04:56:23+00:00

I know about that we can add facts dynamic at run time, mean fact1(+First,+Second).

  • 0

I know about that we can add facts dynamic at run time, mean

fact1(+First,+Second).

I can insert using asserta. But I want to ask can i add the functor at run time mean initially there is only a single fact like fact1(first,second). but user will insert some more facts at run time say

fact2(first,second).
fact3(first,second).

Here initially we don’t know how many facts are to be added. Say user will give input as 3 then we have to add fact1,fact2 and fact3. If user gives input as 4 then we have to add four fact i.e. fact1,fact2,fact3 and fact4.

Any suggestions in this direction are appreciated. Thanks.

  • 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-20T04:56:24+00:00Added an answer on May 20, 2026 at 4:56 am

    You can build the fact to assert using the predicates atom_concat/3 and =../2
    Here goes an example that uses these to assert a predicate as you need (a base name, a number and two arguments):

    assert_predicate(Name, N, Parm1, Parm2):-
      atom_concat(Name, N, FactName),
      Fact=..[FactName, Parm1, Parm2],
      asserta(Fact).
    

    and you would use it with something like:
    assert_predicate(fact, 1, first, second)

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

Sidebar

Related Questions

Do you know about a library that allows us to generate UI by just
I know about SortedSet , but in my case I need something that implements
Are there any open-source libraries that all programmers should know about? I'm thinking something
What are all the common undefined behaviours that a C++ programmer should know about?
I currently don't know any thing about web services, except that they are used
I know that Hpricot is still a standard but I remember hearing about a
I know that Sql Server has some handy built-in quarterly stuff, but what about
I know that in Unix (specifically, Mac OS X) the superblock stores information about
A recent question about string literals in .NET caught my eye. I know that
I need to have some information about the scoping in JavaScript. I know that

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.