mthom / scryer-prolog

A modern Prolog implementation written mostly in Rust.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Unexpected failure

triska opened this issue · comments

With the following program:

bit_char(0, '0').
bit_char(1, '1').

I get:

?-        H is 0 >> 0, bit_char(H, A).
   false, unexpected.

Yet the following more specific query succeeds as expected:

?- H = 0, H is 0 >> 0, bit_char(H, A).
   H = 0, A = '0'. % expected

I updated the original example with a shorter program.

The arithmetic function (<<)/2 exhibits the same issue:

?-        H is 0 << 0, bit_char(H, A).
   false, unexpected.

Thank you a lot!