(clear)                          
(check-syntax)                           
(check-syntax "cat" "dog")                 
(check-syntax 7.8)                        
(check-syntax 900)                        
(check-syntax [abc])                      
(check-syntax (create$ a x y))            
(check-syntax cat)                       
(check-syntax "dog")                    
(check-syntax "7")                     
(check-syntax "893.34")                 
(check-syntax "[ab]")               
(check-syntax "?x")                
(check-syntax "?*x*")      
(check-syntax "(facts)")                   
(check-syntax "(+ 3 4)")                
(check-syntax "(mv-append a b c)")         
(check-syntax "(+ 3 (* 4 5))")   
(check-syntax "(+ a b)")
(check-syntax "(+ 3 4")
(check-syntax "(assert (x y z))")
(check-syntax "(+ 3 4) x")
(check-syntax "(defrule foo =>) x")
(deffacts a1 (x y z))
(deftemplate a2 (slot r) (multislot s))
(defrule a3 (x y z) =>)
(defglobal ?*a4* = 9)
(defmodule MAIN (export ?ALL))
(defmodule a5 (import MAIN ?ALL))
(set-current-module MAIN)
(deffunction a6 (?x) (* 2 ?x))
(defgeneric a7)
(defmethod a8 ((?x INTEGER)) (* 7 ?x))

(defclass a9 (is-a USER) 
   (role concrete)
   (slot q (create-accessor read-write)))
(definstances a10 (a10i of a9 (q 54)))
(defmessage-handler a9 a11 (?u) (* ?self:q 3))
(bsave "Temp//chksyntx.bin")
(check-syntax "(deffacts a1 (foo))")
(check-syntax "(deftemplate a2 (slot g))")
(check-syntax "(defrule a3 =>)")
(check-syntax "(defglobal ?*a4* = 10)")
(check-syntax "(defmodule a5)")
(check-syntax "(deffunction a6 (?x) (* 6 ?x))")
(check-syntax "(defgeneric a7)")
(check-syntax "(defmethod a8 ((?x INTEGER)) (* 9 ?x))")
(check-syntax " (defclass a9 (is-a USER) 
   (role concrete)
   (slot w (create-accessor read-write)))")
(check-syntax "(definstances a10 (b10i of a9 (q 54)))")
(check-syntax "(defmessage-handler a9 a11 (?u) (* ?self:q 10))")
(reset)
(facts)
(agenda)
(assert (a2 (r 2) (s 1 3)))
(instances)
?*a4*
(list-deftemplates a5)
(a6 2)
(a8 3)
(send [a10i] a11 3)
(check-syntax "(deffacts b1 (foo))")
(check-syntax "(deftemplate b2 (slot g))")
(check-syntax "(defrule b3 =>)")
(check-syntax "(defglobal ?*b4* = 10)")
(check-syntax "(defmodule b5)")
(check-syntax "(deffunction b6 (?x) (* 6 ?x))")
(check-syntax "(defgeneric b7)")
(check-syntax "(defmethod b8 ((?x INTEGER)) (* 9 ?x))")

(check-syntax " (defclass b9 (is-a USER) 
   (role concrete)
   (slot w (create-accessor read-write)))")
(check-syntax "(definstances b10 (c10i of a9 (q 54)))")
(check-syntax "(defmessage-handler a9 b11 (?u) (* ?self:q 10))")

(check-syntax "(deffacts c1 foo))")
(check-syntax "(deftemplate c2 slot g))")
(check-syntax "(defrule c3)")
(check-syntax "(defglobal ?*c4* 10)")
(check-syntax "(defmodule c5 (x))")
(check-syntax "(deffunction c6 (?x (* 6 ?x))")
(check-syntax "(defgeneric c7 (y))")
(check-syntax "(defmethod c8 (?x INTEGER)) (* 9 ?x))")

(check-syntax " (defclass c9 (is-a USER) 
   (role bogus)
   (slot w (create-accessor read-write)))")
(check-syntax "(definstances c10 c10i of a9 (q 54)))")
(check-syntax "(defmessage-handler a9 c11 ?u) (* ?self:q 10))")
(list-deffacts)
(list-deftemplates)
(list-defrules)
(list-defglobals)
(list-defmodules)
(list-deffunctions)
(list-defgenerics)
(list-defmethods)
(list-defclasses)
(list-definstances)
(list-defmessage-handlers)
(clear)
(bload "Temp//chksyntx.bin")
(check-syntax "(deffacts a1 (foo))")
(check-syntax "(deftemplate a2 (slot g))")
(check-syntax "(defrule a3 =>)")
(check-syntax "(defglobal ?*a4* = 10)")
(check-syntax "(defmodule a5)")
(check-syntax "(deffunction a6 (?x) (* 6 ?x))")
(check-syntax "(defgeneric a7)")
(check-syntax "(defmethod a8 ((?x INTEGER)) (* 9 ?x))")
(check-syntax " (defclass a9 (is-a USER) 
   (role concrete)
   (slot w (create-accessor read-write)))")
(check-syntax "(definstances a10 (b10i of a9 (q 54)))")
(check-syntax "(defmessage-handler a9 a11 (?u) (* ?self:q 10))")
(reset)
(facts)
(agenda)
(assert (a2 (r 2) (s 1 3)))
(instances)
?*a4*
(list-deftemplates a5)
(a6 2)
(a8 3)
(send [a10i] a11 3)
(check-syntax "(deffacts b1 (foo))")
(check-syntax "(deftemplate b2 (slot g))")
(check-syntax "(defrule b3 =>)")
(check-syntax "(defglobal ?*b4* = 10)")
(check-syntax "(defmodule b5)")
(check-syntax "(deffunction b6 (?x) (* 6 ?x))")
(check-syntax "(defgeneric b7)")
(check-syntax "(defmethod b8 ((?x INTEGER)) (* 9 ?x))")

(check-syntax " (defclass b9 (is-a USER) 
   (role concrete)
   (slot w (create-accessor read-write)))")
(check-syntax "(definstances b10 (c10i of a9 (q 54)))")
(check-syntax "(defmessage-handler a9 b11 (?u) (* ?self:q 10))")

(check-syntax "(deffacts c1 foo))")
(check-syntax "(deftemplate c2 slot g))")
(check-syntax "(defrule c3)")
(check-syntax "(defglobal ?*c4* 10)")
(check-syntax "(defmodule c5 (x))")
(check-syntax "(deffunction c6 (?x (* 6 ?x))")
(check-syntax "(defgeneric c7 (y))")
(check-syntax "(defmethod c8 (?x INTEGER)) (* 9 ?x))")

(check-syntax " (defclass c9 (is-a USER) 
   (role bogus)
   (slot w (create-accessor read-write)))")
(check-syntax "(definstances c10 c10i of a9 (q 54)))")
(check-syntax "(defmessage-handler a9 c11 ?u) (* ?self:q 10))")
(list-deffacts)
(list-deftemplates)
(list-defrules)
(list-defglobals)
(list-defmodules)
(list-deffunctions)
(list-defgenerics)
(list-defmethods)
(list-defclasses)
(list-definstances)
(list-defmessage-handlers)
(clear)
