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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T09:08:45+00:00 2026-06-12T09:08:45+00:00

I am learning Prolog using SWI-Prolog. Here is my practice code in file fact.pl

  • 0

I am learning Prolog using SWI-Prolog.
Here is my practice code in file fact.pl:

factorial(N,F) :- N is 0, F is 1;
              N > 0, M is N - 1, factorial(M,G), F is N*G.

While I was trying to load this file by using [fact.pl], the interpreter gives me the following error:

?- [fact.pl].
ERROR: Syntax error: Operator expected
ERROR: [fact
ERROR: ** here **
ERROR: .pl] .

I am not sure how this happens, and I am pretty sure what I have done is the standard program loading command.

Anyone has ever seen this please help, 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-06-12T09:08:46+00:00Added an answer on June 12, 2026 at 9:08 am

    either ?- [fact]. or ?- ['fact.pl']. should work

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

Sidebar

Related Questions

While learning Prolog, I'm trying to solve the following problem, using accumulators: Write a
I am learning Prolog ideas and here is what I want to practice: I
Learning some VBA. So far, I've constructed this piece of code which should allow
learning html/css here. I can't seem to understand how to tweak this drop down
i'm starting up learning prolog (i use SWI-prolog) and i did a simple exercise
I am learning Prolog and am trying to find the depth of a binary
I'm using swipl 5.10.2. I started today learning Prolog for my AI course. I've
I'm in the process of learning Prolog. I have this recursive predicate: add(0,Y,Y). add(succ(X),Y,succ(Z))
learning html/css here. I'm trying to add a border-bottom to my .menu ul li
I have been learning prolog.. I'm using a editor named prol1.1.1 I need to

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.