;;; -*- Mode: LISP; Package: GTRE-EXAMPLE; Syntax: Common-lisp; -*-
;;;
;;; *******************************************************
;;;
;;; PORTABLE AI LAB - EPFL
;;;
;;; *******************************************************
;;;
;;; Filename:   go-outdoors-ex.cl
;;; Short Desc: Very simple example for JTMS module.
;;; Version:    1.0
;;; Status:     experimental
;;; Last Mod:   25.04.91 - Fatma FEKIH-AHMED
;;; Author:    Fatma FEKIH-AHMED
;;;
;;; Copyright (c) 1992 Istituto Dalle Molle (IDSIA), University of
;;; Zurich, Swiss Federal Institute of Technology Lausanne.
;;;
;;; Permission is granted to any individual or institution to use, copy,
;;; modify, and distribute this software, provided that this complete
;;; copyright and permission notice is maintained, intact, in all
;;; copies and supporting documentation.
;;;
;;; IDSIA provides this software "as is" without express or implied
;;; warranty.  
;;;

;;; -*- Mode: LISP; Package: GTRE-EXAMPLE; Syntax: Common-lisp; -*-
;;;
;;; *******************************************************
;;;
;;; PORTABLE AI LAB - EPFL
;;;
;;; *******************************************************
;;;
;;; Filename:   new-example.cl
;;; Short Desc: Template for new TMS examples
;;; Version:    1.0
;;; Status:     template
;;; Last Mod:   15.9.92
;;; Authors:    FFA and DTA
;;;
;;;


;;; =======================================================================
;;; PACKAGE DECLARATIONS
;;; =======================================================================

(in-package :gtre-example)

(import '(pail-lib::tre-example
	  gtre::rule
	  gtre::assert!
	  gtre::rassert!
	  gtre::retract!
	  gtre::rretract!
	  gtre::contradiction
	  gtre::GOD
	  gtre::USER
	  ))

;;; =======================================================================
;;; TMS Example
;;; =======================================================================

(let ((go-outdoors (make-instance 'tre-example


		      ;;rules in JTRE syntax
		      :rule-set '((rule ((:in (blue sky) :var ?v1) 
					 (:in (holiday)  :var ?v2)) 
					(rassert! (go outdoors) 
						  (just ?v1 ?v2)))
				  (rule ((:in (week-end) :var ?v3) 
					 (:in (weather nice)  :var ?v4)) 
				   (rassert! (go outdoors) (just ?v3 ?v4))))

		      ;; assertions in JTRE syntax
		      :assertions '((assert! '(blue sky))
				    (assert! '(holiday))
				    (assert! '(weather nice))
				    (assert! '(raining))
				    (assert! '(week-end)))

		      :contradiction '())))
  
  (pail-lib::put-pool pail-lib:*pail-pool* go-outdoors :name "GO OUTDOORS?"))



;;; =======================================================================
;;; END OF FILE
;;; =======================================================================

