LogtalkDotOrg / LogtalkDotOrg/logtalk3

B-Prolog 8.1 sub_atom/5 bug

Open
#9 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

backend prolog compiler bug
Dominant language
Logtalk
Stars
496
Forks
34
PR merge metrics
No merged PRs in 30d

Description

The B-Prolog 8.1 implementation of the standard sub_atom/5 predicate can return an integer instead a (sub-)atom. For example:

| ?- sub_atom('foo#0', 4, _, 0, Atom).     
Atom = 0
yes
| ?- sub_atom('foo#0', 4, _, 0, Atom), atom(Atom).
no

This bug is exposed by Logtalk in some of the unit tests for the built-in logtalk object and in errors when converting internal entity prefixes back to entity names.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The report names B-Prolog 8.1's sub_atom/5 predicate and Logtalk's built-in logtalk unit tests, but no repository file. Start by locating those tests and the entity-prefix conversion path; done means sub_atom/5 yields an atom for 'foo#0' and the affected tests and conversions no longer fail.

Written by the indexing model from the issue text.

Assessment

Domain
compilers
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.