1. 'Unknown' and three-valued logic (was: Example where Euphoria ...)

Derek wrote:

> I use a programming language called 'Progress'. It has an explicit 'unknown'
> value that you can assign to any variable. It has been a very useful device.

I can imagine that very well. At work, I use a statistical programming
package that also has something like that, called 'Missing Value' there.
In research, it unfortunately is common, that one doesn't get all the
data one wants to get, and proper handling of the missing data is
important.

> The symbol for it in the language is '?'.
>
> So ...
>    if theDate = ? then
>     theDate = today - 1.
>
> reads...
>    if the date is not known, set it to yesterday's date.

<big snip>

At the moment Euphoria only has values that mean 'unknown' in a special
context, and have another meaning in another context. For instance
opening a non existing file for reading returns the 'handle' -1, which
means something like 'invalid handle' or 'handle unknown'.
Then, on the next line, -1 can be a normal number, with which I can
perform math operations. Not very elegant IMHO.
Or when I e.g. have written a function, that can return any number as a
valid result, it must return a sequence as flag for 'invalid' or
'unknown'. And what, if my function can return numbers and sequences as
valid results?
Introducing something like 'nil' to Euphoria would make many things more
elegant, more flexible, more powerful -- in one word: more Euphoria-like.
blink


Anyway ... Some time ago, I had the idea to write some functions for
three-valued logic -- now it has been waked up.  blink

Derek, maybe you, and of course anyone else interested, would like to
have a look at the following lines, especially at the truth table? I'm
not sure if it is correct -- and I also don't know what value to use for
'not unknown'.

Best regards,
   Juergen

------------------------------------------------------------------------

Three-Valued Logic  (JuLu, 24. November 2002)
=============================================

Truth Table
-----------

Abbreviations:
T = True
F = False
U = Unknown


A | B | not A | A and B | A or B | A xor B
--+---+-------+---------+--------+--------
T | T |   F   |    T    |   T    |    F
T | F |   F   |    F    |   T    |    T
T | U |   F   |    U    |   T    |    U
F | T |   T   |    F    |   T    |    T
F | F |   T   |    F    |   F    |    F
F | U |   T   |    F    |   U    |    U
U | T |       |    U    |   T    |    U
U | F |       |    F    |   U    |    U
U | U |       |    U    |   U    |    F



Euphoria code follows (untested!):

------------------------------------------------------------------------

global constant
   FALSE   =  0,
   TRUE    = not FALSE,
   UNKNOWN = -1


global type three_valued (object x)
   if integer(x) and (x = TRUE or x = FALSE or x = UNKNOWN) then
      return TRUE
   end if
   return FALSE
end type


global function tv_not (three_valued a)
   if a != UNKNOWN then
      return not a
   else
      -- return value also unknown by me smile
   end if
end function


global function tv_and (three_valued a, three_valued b)
   if a != UNKNOWN and b != UNKNOWN then
      return a and b
   elsif a = FALSE or b = FALSE then
      return FALSE
   else
      return UNKNOWN
   end if
end function


global function tv_or (three_valued a, three_valued b)
   if a != UNKNOWN and b != UNKNOWN then
      return a or b
   elsif a = TRUE or b = TRUE then
      return TRUE
   else
      return UNKNOWN
   end if
end function


global function tv_xor (three_valued a, three_valued b)
   if a != UNKNOWN and b != UNKNOWN then
      return a xor b
   elsif a = UNKNOWN and b = UNKNOWN then
      return FALSE
   else
      return UNKNOWN
   end if
end function

new topic     » topic index » view message » categorize

2. Re: 'Unknown' and three-valued logic (was: Example where Euphoria ...)

> Derek, maybe you, and of course anyone else interested, would like to
> have a look at the following lines, especially at the truth table? I'm
> not sure if it is correct -- and I also don't know what value to use for
> 'not unknown'.
>
> Best regards,
>    Juergen
>
> ------------------------------------------------------------------------
>
> Three-Valued Logic  (JuLu, 24. November 2002)
> =============================================
>
> Truth Table
> -----------
>
> Abbreviations:
> T = True
> F = False
> U = Unknown
>
>
> A | B | not A | A and B | A or B | A xor B
> --+---+-------+---------+--------+--------
> T | T |   F   |    T    |   T    |    F
> T | F |   F   |    F    |   T    |    T
> T | U |   F   |    U    |   T    |    U
> F | T |   T   |    F    |   T    |    T
> F | F |   T   |    F    |   F    |    F
> F | U |   T   |    F    |   U    |    U
> U | T |       |    U    |   T    |    U
> U | F |       |    F    |   U    |    U
> U | U |       |    U    |   U    |    F
>

Looks fine to me, except that 'not U' should be 'U', paradoxically. Because
if A is unknown then 'not A' means that we know what A is, however we don't.

Non boolean operations will always produce an unknown value though when at
least one of the operands is unknown.

 A | B | A + B | A  -  B | A *  B | A = B
 --+---+-------+---------+--------+--------
 1 | 1 |   2   |    0    |   1    |    1
 1 | U |   U   |    U    |   U    |    U
 U | 1 |   U   |    U    |   U    |    U
 U | U |   U   |    U    |   U    |    U



----------------
cheers,
Derek Parnell

new topic     » goto parent     » topic index » view message » categorize

3. Re: 'Unknown' and three-valued logic (was: Example where Euphoria ...)

On Sun, 24 Nov 2002 11:32:15 +0100, Juergen Luethje <jluethje at gmx.de>
wrote:

I spotted one glitch:
If either a or b is unknown then a xor b is unknown.
Unknown xor Unknown can be True or False

Pete

new topic     » goto parent     » topic index » view message » categorize

4. Re: 'Unknown' and three-valued logic (was: Example where Euphoria ...)

|Unknown xor Unknown can be True or False

Hence, Unknown, since we are not sure which. :P

new topic     » goto parent     » topic index » view message » categorize

5. Re: 'Unknown' and three-valued logic (was: Example where Euphoria ...)

From: "Juergen Luethje" <jluethje at gmx.de>

> Rom, it isn't necessary to convince me of the usefulness of =
three-valued
> logic in general.=20

Thank you, nice

> Again: Three-valued logic and uninstanciated variables are different=20
> topics, which shouldn't be mixed up.

I have started to think about that.... my gut feeling says that =
maybe.... could it be then same thing....

An invalid file name, a pointer that is 0 (actually called a nil =
pointer), a string that is empty, uninstanciated vars, an object that is =
not yet created (obviously nil .... including whatever boolean values =
there may be in the object which cannot be anything else that True or =
False according to some people).

When I said than Euphoria don't handle uninstanciated vars right then =
the respons was  (David Cuny).... "you will get an error message if an =
variable is not instanciated" ... which is right most of the time.=20
But that is something interesting.... a lot of the compilers error =
detection job is about putting the program together so that nil elements =
in the program are solved.

Does that mean that runtime errror detection is very much about catching =
nil elements?=20

I am wondering ....if nil is a legal var state, then runtime error =
detection job will be different.... 3/0 does not have to cause a runtime =
error, but rather a nil value, and that nil value will causes other =
values also to be nil (3 * nil -> nil)..... so the program will start to =
utput nil values...?

I have absolute no conclusion here for the time being.

In case of AND/OR and the truth tables here, it it all very obvious.=20
Why should not these truth-table also apply to the compiler .... when =
dealing with uninstanciated variables and nil objects?

Regard=20
Rom

new topic     » goto parent     » topic index » view message » categorize

6. Re: 'Unknown' and three-valued logic (was: Example where Euphoria ...)

It is all C's fault.

I remember my first Toolswork C-compiler. It was absolutely a =
disasterous experience for someone who's only experience was with Basic =
interpreters. First the syntax errors.... then, if the program was not =
right, looose pointers and that kind of things, causeing the program to =
go beserk and easily crashed whole computer.

I am wondering how much C has shaped other programming languages, too? =
When other languages are created using C, then the "*" operator are most =
likely to be a C call? And the same goes for the relational operators (  =
=3D,>...) so that the other languages created with C are likely to =
inherit the same weaknesses as C? And C does not reserve any flag for a =
variable being instanciated or not, it just uses whatever it find at =
that memory address, there is no checking about the variable has been =
set or not (that is very speedy ... which the designers of C wanted it =
to be).

So basicly, it the program is not right, then output will be rubbish =
values... not nil values. When you tell a C program to multiply to =
variables that are not set, then the result is rubbish... and there is =
no obvious way to test if the values are rubbish or not.

When C evaluates a conditional statements upon a boolean value .... that =
is not set ... then C branches in the wrong direction ...(and there is =
no obvious way to test if current branch is caused by rubbish =
branchin)... instead of branching in the direction it should have gone =
when branching is unsolved.

It could all have been different... if there had been a nil flag for all =
variables .. then all the compilers created with C would also have been =
different ... because if C had been different, then the other compilers =
would have inherited a lot of that behavior ... the best of it, =
hopefully?

It is all C's fault, behaving like an idiot.

Regards
Rom

new topic     » goto parent     » topic index » view message » categorize

7. Re: 'Unknown' and three-valued logic (was: Example where Euphoria ...)

From: <rforno at tutopia.com>

> Being an Assembly substitute, it has no place for nil data, the same =
as Assembly.=20

C intially chose to represent a int by 16 bits, with first bit as =
sign-bit. They could have reserved one bit as nil-bit (nil-flag), =
meaning a int would have been in the range +/- 16384.

> Machines work according to Boolean logic, which neither has place
> for nil, only for True or False, or what is the same, 1 or 0.

C could very well have implemented basic conditional statement as
        if (a > 1) {  ... }
        ifnot { ......}
        ifnil { .....}
Then if there was a nil on a flag on "a" then ifnil block would have =
been executed.
ASM support this construction too ... just a matter of how to use ASM.

When is comes to pointers ... 0 is maybe nil-flag good enough.=20
Performing pointer checking all the way is maybe costly (thought ASM =
checks eq 0 in a single instruction). Some basic changes here and we =
would have OnError branching from the very start (I have never seen the =
C-code that Euphoria  produces ..... so I cannot say for sure that C's =
weaknesses will  be embedded in compiled Euphoria too?).


> So, the only solution I see to the problem is designing a package for =
it.

Ok, a global functions pNOT, pXOR, pAND, pOR can be defined in a couple =
of hours:

        eboolean a, b, c, decision

        desicion =3D pAND( { a , b, c})      =20

But constructs like

    pAnd(  a =3D False,  b > 20 )

will not work ....there will be inconsistence between 3-valued boolean =
and 2-valued boolean.

    eboolean A, B, C, D, decision    --- 3-valued boolean
    decision =3D affirm(  A and B and (C or D) )  =20

could maybe have been implemented in core ... maintaining full =
backward.compatibily.=20
It cannot just be implemented as a library function.


> But as I said in a previous post, usual programming tasks do not need=20
> this facility, and moreover, it is a pain in the neck to deal with =
tri-valued=20
> logic, as some data bases allow.

I accept that the tools you have used may have been  bad.=20

I will post an example that tells something else.

The meaning of "do not need this facility" depends a lot upon conception =
here. I tend to see OnError as related to 3-valued logic (3-valued logic =
is about dealing with nil values).
I haven't seen if ... ifnot ... ifnil ....logic implemented anyhere. Any =
reference?

Regards
Rom

new topic     » goto parent     » topic index » view message » categorize

8. Re: 'Unknown' and three-valued logic (was: Example where Euphoria ...)

|C intially chose to represent a int by 16 bits, with first bit as
|sign-bit. They could have reserved one bit as nil-bit (nil-flag),
|meaning a int would have been in the range +/- 16384.

And Programmers, like me, would not be very happy with our range oin
each data type been halved for a flag that we would RARELY use. I have
no problem with values not been initialised, as it is part of
programming. A little care saves a lot of debug time, and the times
that your nil, would be vital would be rare, considering the software
available so far today. Implementing a 3-state software architechure
on a 2 state system is the most effiecent idea.

I'm not saying 3-state logic would be useless, far from it. Just
wonder how the pro's and con's weight up in natively supporting it on
a 2-state machine....

Creating a package would be the best way to go, like the c++ code you
got from me Rom, when using it, you basically use it like it was a
native type.

Oh, btw, you can't call 3-state logic "boolean" 2 <=> 3... :P:P

new topic     » goto parent     » topic index » view message » categorize

9. Re: 'Unknown' and three-valued logic (was: Example where Euphoria ...)

From: <dm31 at uow.edu.au>


|C intially chose to represent a int by 16 bits, with first bit as
|sign-bit. They could have reserved one bit as nil-bit (nil-flag),
|meaning a int would have been in the range +/- 16384.

>And Programmers, like me, would not be very happy with our=20
> range oin each data type been halved for a flag that we would RARELY =
use.=20

Argument does not count because now we have 32-bits.

Do you have any "simple" solution for handling something as simple as an =
(A and B and C) rule? (what people normally would regard as a rule)=20
(post Sent: Saturday, November 23, 2002 10:50 PM Subject: Unknown as a =
legal var state?)

Rom



Example case: Simplified rules for unemployments benefits. How to =
program such rules?

To qualify for unemployment benefits....
1) you must be a national citizen (N)
2) you must be unemployed (U)
3) you must have earned more than $10000 previous year (I)
4) all facts must be documented

new topic     » goto parent     » topic index » view message » categorize

10. Re: 'Unknown' and three-valued logic (was: Example where Euphoria ...)

On  0, Rom <kjehas at frisurf.no> wrote:
> 
> > So, the only solution I see to the problem is designing a package for it.
> 
> Ok, a global functions pNOT, pXOR, pAND, pOR can be defined in a couple of
> hours:
> 
>         eboolean a, b, c, decision
> 
>         desicion = pAND( { a , b, c})       
> 
> But constructs like
> 
>     pAnd(  a = False,  b > 20 )
> 
> will not work ....there will be inconsistence between 3-valued boolean and
> 2-valued boolean.

but also define global funcs pEQ, pNE, pGT, pLT, pGE, and pLE, then do
this:

	pAnd ( pEQ(a, False), pGT(b, 20) )

Its clumsy, I agree, but it works.

> 
>     eboolean A, B, C, D, decision    --- 3-valued boolean
>     decision = affirm(  A and B and (C or D) )   
> 
> could maybe have been implemented in core ... maintaining full
> backward.compatibily.
> It cannot just be implemented as a library function.
> 

you could always do this:

	decision = affirm( sprint(A) & " and " & sprint(B) & " and (" &
		sprint(C) & " or " & sprint(D) & " )" )

if you were willing to recode the func as a math eval/expr interpreter.
But
then again, its a bad idea to do it this way, cuz its slow and
unnecessary.
The above method is much better.

> Regards
> Rom
> 

sleepily,
jbrown


--

new topic     » goto parent     » topic index » view message » categorize

11. Re: 'Unknown' and three-valued logic (was: Example where Euphoria ...)

From: <jbrown105 at speedymail.org>

> but also define global funcs pEQ, pNE, pGT, pLT, pGE, and pLE, then do
> this:
>=20
> pAnd ( pEQ(a, False), pGT(b, 20) )


I am trying like this:

    global  constant TRUE =3D 1, FALSE =3D -1, NIL =3D 0

   global type eboolean( integer x)
      return (x =3D TRUE) or (x =3D FALSE) or (x =3D NIL)
   end type

   global function pEQ( integer a, integer b)        =20
         if a =3D b then return TRUE
         else return FALSE
        -- it never returns NIL????
         end if
   end function


      eboolean decision
      integer a     =20
      a =3D 5

      decision =3D pEQ( a, 5)


I run into problems because a cannot test if an integer is instanciated =
(they are all intanciated in Euphoria anyhow).

When I define an eboolean type .... unstanciated state is represented by =
NIL..... no problem.
    eboolean A
    A =3D NIL
But I cannot put that information into an integer?
I will need a quite a new type for integer that behaves like an integer =
but also has a nil flag.
Don't know how to do that...

Thank you for your keen interest smile

Regards
Rom

new topic     » goto parent     » topic index » view message » categorize

12. Re: 'Unknown' and three-valued logic (was: Example where Euphoria ...)

On  0, Rom <kjehas at frisurf.no> wrote:
> 
> From: <jbrown105 at speedymail.org>
> 
> > but also define global funcs pEQ, pNE, pGT, pLT, pGE, and pLE, then do
> > this:
> > 
> > pAnd ( pEQ(a, False), pGT(b, 20) )
> 
> 
> I am trying like this:
> 
>     global  constant TRUE = 1, FALSE = -1, NIL = 0

No this (use C false rather than BASIC false):

     global  constant TRUE = 1, FALSE = 0, NIL =
     {1632324,0,45,75243343,547642}
	--yes NIL is a sequence, its set to a sequence unlikely to ever be used
	--by the program as an actual value - its a kludge, but in general
	--its a working kludge. (and those are the best kludges of all. ;)

> 
>    global type eboolean( integer x)
>       return (x = TRUE) or (x = FALSE) or (x = NIL)
>    end type

Oops ... better do it this way:

    global type eboolean( object x)
	if sequence(x) and equal(x,NIL) then return TRUE end if
	if not integer(x) then return 0 end if
       return (x = TRUE) or (x = FALSE)
    end type

> 
>    global function pEQ( integer a, integer b)         
>          if a = b then return TRUE
>          else return FALSE
>         -- it never returns NIL????
>          end if
>    end function

Gotta fix this too. First add a new "integer" type.

global type einteger(object x)
	if sequence(x) then return equal(x, NIL) end if
	return integer(x)
end type

Might also wanna make an "eatom" type too. (Sequences should be just
fine, however.) Now, on to the real function ...

 
    global function pEQ( einteger a, einteger b)
	if equal(a,NIL) or equal(b,NIL) then return NIL end if
         -- it returns NIL here, above.
          if a = b then return TRUE
          else return FALSE
          end if
    end function

> 

Now this should work.

> 
>       eboolean decision
>       integer a      
>       a = 5
> 
>       decision = pEQ( a, 5)
> 
> 
> I run into problems because a cannot test if an integer is instanciated (they
> are all intanciated in Euphoria anyhow).

Thats seperate from NIL type however. Its a different issue. Don't
confuse the
two, please.

> 
> When I define an eboolean type .... unstanciated state is represented by
> NIL..... no problem.
>     eboolean A
>     A = NIL
> But I cannot put that information into an integer?

Cuz I use a sequence for NIL, its really those that are tricky. Also, if
a function uses a real integer, rather than an einteger (or atom rather
than eatom) than you can also have troubles with type-check errors. :(

> I will need a quite a new type for integer that behaves like an integer but
> also has a nil flag.
> Don't know how to do that...
> 
> Thank you for your keen interest smile
> 
> Regards
> Rom
> 

No problem. blink

Hope my example helps you out.

jbrown

> ==^^===============================================================
> This email was sent to: jbrown105 at speedymail.org
> 
> 
> 

--

new topic     » goto parent     » topic index » view message » categorize

13. Re: 'Unknown' and three-valued logic (was: Example where Euphoria ...)

----- Original Message -----=20
From: <rforno at tutopia.com>

> The problem is not with the tools, but with the tri-valued logic =
itself.

I need all arguments against 3-valued logic. Please help me

1. Programmers needed 16 bits integers (no space left), not 15 bits =
integers
2. Because of thant 16/32 bits integer has become common standard. it =
cannot be changed...
3. There is no need for such things (thing are either true or false) - =
(examples would be appreciated)
4. It would be a terrible thing to handle=20
5. You don't find it in aother languages either ...  proves by itself =
there is no need for it..

Anything I have missed here?

Rom

new topic     » goto parent     » topic index » view message » categorize

14. Re: 'Unknown' and three-valued logic (was: Example where Euphoria ...)

Rom,
it is not so much that there is or is not 3-valued logic. It is more that 
we either know what a varaible holds or we don't, and if we do then we can 
know if its either True or False.

On Tue, 26 Nov 2002 05:18:10 +0100, Rom <kjehas at frisurf.no> wrote:

>
> ----- Original Message ----- From: <rforno at tutopia.com>
>
>> The problem is not with the tools, but with the tri-valued logic itself.
>
> I need all arguments against 3-valued logic. Please help me



-- 

cheers,
Derek Parnell

new topic     » goto parent     » topic index » view message » categorize

15. Re: 'Unknown' and three-valued logic (was: Example where Euphoria ...)

|I need all arguments against 3-valued logic. Please help me
|
|1. Programmers needed 16 bits integers (no space left), not 15 bits
integers

Rephrase to: Programmers 'prefer' not to have unneeded overheads. Even
if it was a 128 int type. I would prefer not to have a bit wasted that
could of been put to more effective use.

|2. Because of thant 16/32 bits integer has become common standard. 

Yes, standards are very important. change is good, but so is the
knowledge that you product will be able compatible with other
programmers. Could you imagine the success of a printer that couldn't
print from any existing word-processing packages because it wanted to
add a feature that would let it print directly on a cd?? (for example
purposes only :P)

|3. There is no need for such things (thing are either true or false)
- (examples would be appreciated)

More like, the computer itself is BASED on binary, and the tasked that
it was intended for can all be handled easily by binary. The uses for
3-state logic, over the hassle to implement it, keep it compatible,
the storage waste(VERY hard to prefectly fit base3 numbers sqaurely
into a base-2 X 8 system), over its benefits is VERY questionable.

|4. It would be a terrible thing to handle 

Some times it can be hard enough sorting the logic of a complex
program out that only requires binary. Imagine the pain of having to
write those problems with 3-state logic, and tracking down the bugs???
(was that a nil getting thought there??)

|5. You don't find it in aother languages either ...  proves by itself
there is no need for it..

It doesn't PROVE that there is no need for it, just SHOWS that atm, it
is a feature that would have only have a use in RARE circumstances.

new topic     » goto parent     » topic index » view message » categorize

16. Re: 'Unknown' and three-valued logic (was: Example where Euphoria ...)

How does CLIPS 6.0 handles three-valued logic? =20
(CLIPS was created by NASA for use in space research and space =
equipment)

(from user guide)
"As you can se, CLIPS has inserted the DEFAULT value of the null string =
"", for the name field since that is the defualt for a STRING. Likewise, =
the asserts (=3Dassigning something to a var) and the age defaults were =
also inserted by CLIPS. Different types have different symbols such as =
the null string "" for STRING, the integer 0 for integer, the float 0.0 =
for FLOAT, a.s.o. The ?DERIVE keyword selects the appropriate type of =
const for that slot, e.g. the null string. for a slot of tpe STRING.=3D

(strange how many times the author had to repeat that null string =3D "" =
)

.....is this how CLIPS handles nil values?????

Since CLIPS is programmed i C and created to work with C programs .... I =
can very well understand why they represent an uninstanciated integers =
by 0... (it was an easy solution?). Okey, they call it default...(so the =
don't have any other way to know if integer is unassign except testing =
i=3D 0?)=20

How does CLIPS 6.0 handle three-valued logic? =20
CLIPS has a mechanism that they uses all the time when faced with  =
unknowns. That is wildcards ( =3D '?').

Wildcards is used in rules like:

     Find all names:  ? Carlson

and also constructs like:

     Find   ? lives in New York
              ? is a laywer

This should be something familiar to most of us. Prolog is working in =
much the same way (this is all related to nil valued (=3D> logic for =
dealing with nil values).

I can see a  difference here between three-valued logic and wildcard =
logic also. What three-valued logic answers is:
   =20
        if A then .....
        b :=3D A + 10
         if A and B and C then ....

what will conclusion be if A (and other vars) is unknown?

What wildcards matching is stating is:

     if ? and B and C then ....

That isn't the same same answer .... maybe not even the same =
question....

Rom

new topic     » goto parent     » topic index » view message » categorize

17. Re: 'Unknown' and three-valued logic (was: Example where Euphoria ...)

I don't see anything in there that leads me to believe that CLIPS is
using 3-state logic....

null string is what we c/c++ programmers initialise strings to. ie, a
string with no charactors. It just seems to be doing what basic
already did long ago, initialising the vars with default values for
you.

Using wildcards for seaching is also not 3-state logic. Its just a
searching algo, that lets you find data that matches a pattern.

Maybe I missed something, or maybe you forgot to include some details,
but I see no evidence that CIPS is working with 3-state logic

|How does CLIPS 6.0 handles three-valued logic?  
|(CLIPS was created by NASA for use in space research and space
equipment)
|
|(from user guide)
|"As you can se, CLIPS has inserted the DEFAULT value of the null
string "", for the name field since that is the defualt for a STRING.
Likewise, the asserts (=assigning something to a var) and the age
defaults were also inserted by CLIPS. Different types have different
symbols such as the null string "" for STRING, the integer 0 for
integer, the float 0.0 for FLOAT, a.s.o. The ?DERIVE keyword selects
the appropriate type of const for that slot, e.g. the null string. for
a slot of tpe STRING.=
|
|(strange how many times the author had to repeat that null string =
"" )
|
|.....is this how CLIPS handles nil values?????
|
|Since CLIPS is programmed i C and created to work with C programs
.... I can very well understand why they represent an uninstanciated
integers by 0... (it was an easy solution?). Okey, they call it
default...(so the don't have any other way to know if integer is
unassign except testing i= 0?) 
|
|How does CLIPS 6.0 handle three-valued logic?  
|CLIPS has a mechanism that they uses all the time when faced with 
unknowns. That is wildcards ( = '?').
|
|Wildcards is used in rules like:
|
|     Find all names:  ? Carlson
|
|and also constructs like:
|
|     Find   ? lives in New York
|              ? is a laywer

new topic     » goto parent     » topic index » view message » categorize

18. Re: 'Unknown' and three-valued logic (was: Example where Euphoria ...)

"db31"
> I don't see anything in there that leads me to believe that CLIPS is =
using 3-state logic....

Yes and no. They are are trying to deal with unknown values in a very =
strange way.. not defining any truth-tables when nil is a legal value

> Using wildcards for seaching is also not 3-state logic.=20

It is boolean logic ... then they introduce "?" for what the don't know =
....

"db31"
> Maybe I missed something, or maybe you forgot to include some details,
> but I see no evidence that CIPS is working with 3-state logic

If we accept that CLIPS cannot handle three-valued logic ... not my =
suggestion (that the university standard expert system programming tool =
cannot handle unknowns .. (almost an insult).... then where is =
three-valued logic implemented?

And if no one can give a reference here (no one here know?) ... then how =
can I know what you know about three-valued logic is? What do you think =
the difference between boolean logic and three-valued logic is?

Rom

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu