POV-Ray : Newsgroups : povray.off-topic : Logic programming : Re: Logic Box v2 release #1 Server Time
29 Jul 2024 10:29:22 EDT (-0400)
  Re: Logic Box v2 release #1  
From: Invisible
Date: 31 May 2012 09:57:01
Message: <4fc778ad@news.povray.org>
On 31/05/2012 02:32 PM, Invisible wrote:

> Actually, there is /already/ an SEqual{} predicate, which is solved if
> two lists are "set-equal". That is, X is a subset of Y and Y is a subset
> of X. More simply, every element of X is also an element of Y and vice
> versa.

Ha! Yes, SEqual{} is already defined. It also doesn't /work/. o_O

The mistake is simple. SEqual{} calls SSubset{}, and SSubset{} has a 
bug. Its definition is

SSubset{sub, super}:
   (sub = End[]) | (~item ((SMember{item, sub}) & (SMember{item, super})))
;

In other words,

   "S is a subset of T if S is the empty set OR _there exists_ an X 
which is a member of S and a member of T."

What it /should/ of course say is

   "S is a subset of T if S is the empty set OR _for all_ X which is a 
member of S, X is a member of T."

In short, I've mixed up "exists" and "for all". Kind of an important 
distinction, that one.

Logic Box of course doesn't /have/ an explicit for-all construct. At 
this point I am uncertain whether I can work around that...


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.