Possible bug?

From: Larry D. Lee jr. <llee_at_jhsph.edu>
Date: Sat, 23 Nov 2013 15:17:24 -0500

There appears to be a bug in Kics2 (version 0.2.4, but probably higher
as well).
The bug appears to be in the way that Kics2 shares non-deterministic values.
The scenario that produced this bug is presented below.

I have a non-deterministic function named db, which is defined as follows:
'db "is raining" = [0.9]'
'db "is cloudy" = [0.7]'

and another non-deterministic function named conjunction. Originally
defined as follows:
'conjunction db p q = union (db p) (db q)'

When I evaluated 'conjunction db "is raining" "is raining"', I received
the correct result: '[0.9]'.
When I evaluated 'conjunction db "is raining" "is cloudy"', I received
'no more results', which is clearly wrong.
The correct answer is '[0.9, 0.7]'.
When I evaluated 'union (db "is raining") (db "is cloudy")' I received
the correct answer.

Interestingly when I redefined conjunction as:
'conjunction db0 db1 p q = union (db0 p) (db1 q)'

and then defined the helper function:
'p /\ q = conjunction db db p q'

I received the correct answers.

The problem appears to be in the way Kics2 shares non-deterministic values.
But the precise error is unclear to me.

Thanks for this great implementation of Curry!
- Lee

_______________________________________________
curry mailing list
curry_at_lists.RWTH-Aachen.DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/curry
Received on Mo Nov 25 2013 - 17:40:33 CET

This archive was generated by hypermail 2.3.0 : Do Jun 20 2024 - 07:15:12 CEST