Some little logic tests

1. Suppose you look at a Logo text screen and see on it:
pr or and :masc? :dat? :sing?
FALSE 
pr or :masc? and :dat? :sing?
TRUE 
pr and :masc? or :dat? :sing? 
FALSE 
pr and or :masc? :dat? :sing?   
FALSE 
It is clearly the case that :masc?, :dat? and :sing? individually output "true or "false. (I.e. "masc?, "dat? and "sing? are the names of variables which are acting as flags.) On the basis of Logo's responses to the four instructions, what are the current values of these three variables?

(Answer to Test 1)

2. Now try the same with:

pr or and :masc? :dat? :sing?
TRUE 
pr or :masc? and :dat? :sing?
FALSE 
pr and :masc? or :dat? :sing? 
FALSE 
pr and or :masc? :dat? :sing?  
FALSE 

(Answer to Test 2)

3. And with this:

pr or and :masc? :dat? :sing?
TRUE 
pr or :masc? and :dat? :sing?
TRUE 
pr and :masc? or :dat? :sing? 
FALSE 
pr and or :masc? :dat? :sing?   
TRUE 
(Answer to Test 3)

4. Do any sets of values for the three variables give the same results for the four instructions?

(Answer to Test 4)

5. Finally, suppose this time that the variables are set up as follows:

MAKE "MASC? "false
MAKE "DAT? "false
MAKE "SING? "true
What would be displayed if you typed in the following instructions:
pr and not :masc? or :dat? :sing?

pr and not :masc? and not :dat? :sing?

pr or :masc? and :dat? not :sing?
Remember that not expects only one input.

(Answer to Test 5)


Back to main text

Ron Brasington
Department of Linguistic Science
The University of Reading
Reading
UK

E-mail: ron.brasington@rdg.ac.uk