Skip to content

Prolog compiler bug #34

@Ryan-pelo

Description

@Ryan-pelo

The prolog compiler has a bug that sometimes makes queries incorrect based on what comes before it. Here is a simple replication:

male(richard).
married(richard, christy).
male(robby).

main :-
    (male(robby) -> write('Debug: robby is male'), nl ; write('Debug: robby is NOT male'), nl),
    halt.

:- initialization(main).

removing only line 1 - bug does not occur
removing only line 2 - bug does not occur
switching line 1 and 2 - bug does not occur
switching line 1 and 3 - bug does not occur
changing line 1 to "female(richard)" - bug does not occur

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions