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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T03:21:24+00:00 2026-05-27T03:21:24+00:00

?-dynamic(setup/5). setup :- seeing(S), see(‘people.txt’), read_data, write(‘data read’), nl, seen, see(S). read_data :- read(A),

  • 0
?-dynamic(setup/5).
setup :-
    seeing(S),
    see('people.txt'),
    read_data,
    write('data read'),
    nl,
    seen,
    see(S).
read_data :-
    read(A),
    process(A).
process(A) :- A == end_of_file.
process(A) :-
    A \== end_of_file,
    write('1'),
    read(B),
    read(C),
    read(D),
    read(E),
    assertz(person(A,B,C,D,E)),
    read_data.

and the text are

john.will.30.london.doctor.
martha.will.33.portsea.doctor.
henry.smith.26.manchester.doctor.

the result is coming out

?- setup.

* Syntax Error

* Syntax Error

* Syntax Error

* Syntax Error

* Syntax Error
data read
yes

What happens? What did I do wrong?

  • 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-27T03:21:25+00:00Added an answer on May 27, 2026 at 3:21 am

    You are reading with read/1 which expects valid Prolog text as input. However, your data is

    john.will.30.london.doctor.
    

    which is invalid. Write something like

    person(john,will,30,london,doctor).
    

    instead. Most often, people do not read in such data manually. Instead, they load the file with ['datafile.pl'] or other commands.

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

Sidebar

Related Questions

I setup custom CSS class for array of dynamic TextBoxes (inputs as HTML) so...
When trying to run an Eclipse Dynamic Web Project under a Tomcat setup using
Dynamic Data question: I have 2 fields of type Nullable<DateTime> on my model When
Setup: IIS7 serving ASP classic VB script code which generates a dynamic VSC page/file
Hello I have a Dynamic DataTable Created at runtime. The Setup is like so
I have a setup lets say like follows: <div id=nav> <div id=innernav> //With dynamic
My current setup loads a dynamic list at which point I create a click
We currently have one dynamic web project (our main web application) already setup on
I am trying to setup a data-driven subscription and it works fine except when
Basically its a 2 column setup, with a dynamic width content column, and a

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.