Updated Init.clp in loop-region-merging to skip loopless functions

This is a simple optimization that will cause the loop-region-merging pass to
skip the current function if it turns out that there are no loops.

;------------------------------------------------------------------------------
;Copyright (c) 2012, Joshua Scoggins
;All rights reserved.
;
;Redistribution and use in source and binary forms, with or without
;modification, are permitted provided that the following conditions are met:
;    * Redistributions of source code must retain the above copyright
;      notice, this list of conditions and the following disclaimer.
;    * Redistributions in binary form must reproduce the above copyright
;      notice, this list of conditions and the following disclaimer in the
;      documentation and/or other materials provided with the distribution.
;    * Neither the name of Joshua Scoggins nor the
;      names of its contributors may be used to endorse or promote products
;      derived from this software without specific prior written permission.
;
;THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
;ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
;WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
;DISCLAIMED. IN NO EVENT SHALL Joshua Scoggins BE LIABLE FOR ANY
;DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
;(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
;LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
;ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
;(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
;SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
;------------------------------------------------------------------------------
; Init.clp - Contains the defmodules that make up the process of
; loop-region-merging.
;------------------------------------------------------------------------------
(defmodule loop-region-merging-flatlist-build
			  (import core ?ALL)
			  (import llvm ?ALL)
			  (import types ?ALL)
			  (import rampancy ?ALL)
			  (import indirect ?ALL)
			  (import pipeline ?ALL)
			  (import MAIN ?ALL))
;------------------------------------------------------------------------------
(defmodule loop-region-merging-flatlist-expand
			  (import core ?ALL)
			  (import llvm ?ALL)
			  (import types ?ALL)
			  (import rampancy ?ALL)
			  (import indirect ?ALL)
			  (import pipeline ?ALL)
			  (import MAIN ?ALL))
;------------------------------------------------------------------------------
(defmodule loop-region-merging-flatlist-claim
			  (import core ?ALL)
			  (import llvm ?ALL)
			  (import types ?ALL)
			  (import rampancy ?ALL)
			  (import indirect ?ALL)
			  (import pipeline ?ALL)
			  (import MAIN ?ALL))
;------------------------------------------------------------------------------
(defmodule loop-region-merging-flatlist-arbitrate
			  (import core ?ALL)
			  (import llvm ?ALL)
			  (import types ?ALL)
			  (import rampancy ?ALL)
			  (import indirect ?ALL)
			  (import pipeline ?ALL)
			  (import MAIN ?ALL))
;------------------------------------------------------------------------------
(defmodule loop-region-merging-flatlist-resolve
			  (import core ?ALL)
			  (import llvm ?ALL)
			  (import types ?ALL)
			  (import rampancy ?ALL)
			  (import indirect ?ALL)
			  (import pipeline ?ALL)
			  (import MAIN ?ALL))
;------------------------------------------------------------------------------
(defmodule loop-region-merging-determinant-construction
			  (import core ?ALL)
			  (import llvm ?ALL)
			  (import types ?ALL)
			  (import rampancy ?ALL)
			  (import indirect ?ALL)
			  (import pipeline ?ALL)
			  (import MAIN ?ALL))
;------------------------------------------------------------------------------
(defmodule loop-region-merging-determinant-population
			  (import core ?ALL)
			  (import llvm ?ALL)
			  (import types ?ALL)
			  (import rampancy ?ALL)
			  (import indirect ?ALL)
			  (import pipeline ?ALL)
			  (import MAIN ?ALL))
;------------------------------------------------------------------------------
(defmodule loop-region-merging-determinant-resolution
			  (import core ?ALL)
			  (import llvm ?ALL)
			  (import types ?ALL)
			  (import rampancy ?ALL)
			  (import indirect ?ALL)
			  (import pipeline ?ALL)
			  (import MAIN ?ALL))
;------------------------------------------------------------------------------
(defmodule loop-region-merging-determinant-indirect-resolution
			  (import core ?ALL)
			  (import llvm ?ALL)
			  (import types ?ALL)
			  (import rampancy ?ALL)
			  (import indirect ?ALL)
			  (import pipeline ?ALL)
			  (import MAIN ?ALL))
;------------------------------------------------------------------------------
(defmodule loop-region-merging-fixup
			  (import core ?ALL)
			  (import llvm ?ALL)
			  (import types ?ALL)
			  (import rampancy ?ALL)
			  (import indirect ?ALL)
			  (import pipeline ?ALL)
			  (import MAIN ?ALL))
;------------------------------------------------------------------------------
(defmodule loop-region-merging-fixup-update
			  (import core ?ALL)
			  (import llvm ?ALL)
			  (import types ?ALL)
			  (import rampancy ?ALL)
			  (import indirect ?ALL)
			  (import pipeline ?ALL)
			  (import MAIN ?ALL))
;------------------------------------------------------------------------------
(defmodule loop-region-merging-fixup-rename
			  (import core ?ALL)
			  (import llvm ?ALL)
			  (import types ?ALL)
			  (import rampancy ?ALL)
			  (import indirect ?ALL)
			  (import pipeline ?ALL)
			  (import MAIN ?ALL))
;------------------------------------------------------------------------------
(defmodule loop-region-merging-cleanup-merger
			  (import core ?ALL)
			  (import llvm ?ALL)
			  (import types ?ALL)
			  (import rampancy ?ALL)
			  (import indirect ?ALL)
			  (import pipeline ?ALL)
			  (import MAIN ?ALL))
;------------------------------------------------------------------------------
(defrule loop-region-merging::modify-pass-description
			"Modifies the target pass description to load the target subpasses.
			This will only happen if the current function has loops"
			?fct <- (message (to loop-region-merging) (action initial-fact))
			(exists (object (is-a Loop)))
			?obj <- (object (is-a pass-description) (passes $?passes))
			=>
			(retract ?fct)
			(modify-instance ?obj
								  (passes
									 loop-region-merging-flatlist-build
									 loop-region-merging-flatlist-expand
									 loop-region-merging-flatlist-claim
									 loop-region-merging-flatlist-arbitrate
									 loop-region-merging-flatlist-resolve
									 loop-region-merging-determinant-construction
									 loop-region-merging-determinant-population
									 loop-region-merging-determinant-resolution
									 loop-region-merging-determinant-indirect-resolution
									 loop-region-merging-fixup
									 loop-region-merging-fixup-update
									 loop-region-merging-fixup-rename
									 loop-region-merging-cleanup-merger
									 $?passes)))
;------------------------------------------------------------------------------
(defrule loop-region-merging::skip-pass
			"This rule fires if the given function does not have any defined loops!"
			?fct <- (message (to loop-region-merging) (action initial-fact))
			(not (exists (object (is-a Loop))))
			=>
			(retract ?fct))
;------------------------------------------------------------------------------

;------------------------------------------------------------------------------
;Copyright (c) 2012, Joshua Scoggins
;All rights reserved.
;
;Redistribution and use in source and binary forms, with or without
;modification, are permitted provided that the following conditions are met:
;    * Redistributions of source code must retain the above copyright
;      notice, this list of conditions and the following disclaimer.
;    * Redistributions in binary form must reproduce the above copyright
;      notice, this list of conditions and the following disclaimer in the
;      documentation and/or other materials provided with the distribution.
;    * Neither the name of Joshua Scoggins nor the
;      names of its contributors may be used to endorse or promote products
;      derived from this software without specific prior written permission.
;
;THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
;ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
;WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
;DISCLAIMED. IN NO EVENT SHALL Joshua Scoggins BE LIABLE FOR ANY
;DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
;(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
;LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
;ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
;(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
;SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
;------------------------------------------------------------------------------
; Init.clp - Contains the defmodules that make up the process of
; loop-region-merging.
;------------------------------------------------------------------------------
(defmodule loop-region-merging-flatlist-build
			  (import core ?ALL)
			  (import llvm ?ALL)
			  (import types ?ALL)
			  (import rampancy ?ALL)
			  (import indirect ?ALL)
			  (import pipeline ?ALL)
			  (import MAIN ?ALL))
;------------------------------------------------------------------------------
(defmodule loop-region-merging-flatlist-expand
			  (import core ?ALL)
			  (import llvm ?ALL)
			  (import types ?ALL)
			  (import rampancy ?ALL)
			  (import indirect ?ALL)
			  (import pipeline ?ALL)
			  (import MAIN ?ALL))
;------------------------------------------------------------------------------
(defmodule loop-region-merging-flatlist-claim
			  (import core ?ALL)
			  (import llvm ?ALL)
			  (import types ?ALL)
			  (import rampancy ?ALL)
			  (import indirect ?ALL)
			  (import pipeline ?ALL)
			  (import MAIN ?ALL))
;------------------------------------------------------------------------------
(defmodule loop-region-merging-flatlist-arbitrate
			  (import core ?ALL)
			  (import llvm ?ALL)
			  (import types ?ALL)
			  (import rampancy ?ALL)
			  (import indirect ?ALL)
			  (import pipeline ?ALL)
			  (import MAIN ?ALL))
;------------------------------------------------------------------------------
(defmodule loop-region-merging-flatlist-resolve
			  (import core ?ALL)
			  (import llvm ?ALL)
			  (import types ?ALL)
			  (import rampancy ?ALL)
			  (import indirect ?ALL)
			  (import pipeline ?ALL)
			  (import MAIN ?ALL))
;------------------------------------------------------------------------------
(defmodule loop-region-merging-determinant-construction
			  (import core ?ALL)
			  (import llvm ?ALL)
			  (import types ?ALL)
			  (import rampancy ?ALL)
			  (import indirect ?ALL)
			  (import pipeline ?ALL)
			  (import MAIN ?ALL))
;------------------------------------------------------------------------------
(defmodule loop-region-merging-determinant-population
			  (import core ?ALL)
			  (import llvm ?ALL)
			  (import types ?ALL)
			  (import rampancy ?ALL)
			  (import indirect ?ALL)
			  (import pipeline ?ALL)
			  (import MAIN ?ALL))
;------------------------------------------------------------------------------
(defmodule loop-region-merging-determinant-resolution
			  (import core ?ALL)
			  (import llvm ?ALL)
			  (import types ?ALL)
			  (import rampancy ?ALL)
			  (import indirect ?ALL)
			  (import pipeline ?ALL)
			  (import MAIN ?ALL))
;------------------------------------------------------------------------------
(defmodule loop-region-merging-determinant-indirect-resolution
			  (import core ?ALL)
			  (import llvm ?ALL)
			  (import types ?ALL)
			  (import rampancy ?ALL)
			  (import indirect ?ALL)
			  (import pipeline ?ALL)
			  (import MAIN ?ALL))
;------------------------------------------------------------------------------
(defmodule loop-region-merging-fixup
			  (import core ?ALL)
			  (import llvm ?ALL)
			  (import types ?ALL)
			  (import rampancy ?ALL)
			  (import indirect ?ALL)
			  (import pipeline ?ALL)
			  (import MAIN ?ALL))
;------------------------------------------------------------------------------
(defmodule loop-region-merging-fixup-update
			  (import core ?ALL)
			  (import llvm ?ALL)
			  (import types ?ALL)
			  (import rampancy ?ALL)
			  (import indirect ?ALL)
			  (import pipeline ?ALL)
			  (import MAIN ?ALL))
;------------------------------------------------------------------------------
(defmodule loop-region-merging-fixup-rename
			  (import core ?ALL)
			  (import llvm ?ALL)
			  (import types ?ALL)
			  (import rampancy ?ALL)
			  (import indirect ?ALL)
			  (import pipeline ?ALL)
			  (import MAIN ?ALL))
;------------------------------------------------------------------------------
(defmodule loop-region-merging-cleanup-merger
			  (import core ?ALL)
			  (import llvm ?ALL)
			  (import types ?ALL)
			  (import rampancy ?ALL)
			  (import indirect ?ALL)
			  (import pipeline ?ALL)
			  (import MAIN ?ALL))
;------------------------------------------------------------------------------
(defrule loop-region-merging::modify-pass-description
			"Modifies the target pass description to load the target subpasses"
			?fct <- (message (to loop-region-merging) (action initial-fact))
			?obj <- (object (is-a pass-description) (passes $?passes))
			=>
			(retract ?fct)
			(modify-instance ?obj
								  (passes
									 loop-region-merging-flatlist-build
									 loop-region-merging-flatlist-expand
									 loop-region-merging-flatlist-claim
									 loop-region-merging-flatlist-arbitrate
									 loop-region-merging-flatlist-resolve
									 loop-region-merging-determinant-construction
									 loop-region-merging-determinant-population
									 loop-region-merging-determinant-resolution
									 loop-region-merging-determinant-indirect-resolution
									 loop-region-merging-fixup
									 loop-region-merging-fixup-update
									 loop-region-merging-fixup-rename
									 loop-region-merging-cleanup-merger
									 $?passes)))
;------------------------------------------------------------------------------


cortex/parsing/SymbolDeclarationFunctions.clp: Fixed defsymbol-lexer

;------------------------------------------------------------------------------
;Copyright (c) 2013, Joshua Scoggins
;All rights reserved.
;
;Redistribution and use in source and binary forms, with or without
;modification, are permitted provided that the following conditions are met:
;    * Redistributions of source code must retain the above copyright
;      notice, this list of conditions and the following disclaimer.
;    * Redistributions in binary form must reproduce the above copyright
;      notice, this list of conditions and the following disclaimer in the
;      documentation and/or other materials provided with the distribution.
;    * Neither the name of Joshua Scoggins nor the
;      names of its contributors may be used to endorse or promote products
;      derived from this software without specific prior written permission.
;
;THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
;ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
;WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
;DISCLAIMED. IN NO EVENT SHALL Joshua Scoggins BE LIABLE FOR ANY
;DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
;(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
;LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
;ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
;(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
;SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
;------------------------------------------------------------------------------
(deffunction cortex::blank-on-empty-string(?str)
 "Returns a blank multifield if the given input string is empty"
             (if (> (str-length ?str) 0) then ?str else (create$)))
;------------------------------------------------------------------------------
(deffunction cortex::split-on-symbol (?sp ?i)
             (bind ?str (if (stringp ?i) then ?i else (str-cat ?i)))
             (bind ?ind (str-index ?sp ?str))
             (bind ?p0 (sub-string 1 (- ?ind 1) ?str))
             (bind ?p1 (sub-string (+ ?ind 1) (str-length ?str) ?str))
             (create$ (blank-on-empty-string ?p0) ?sp
                      (blank-on-empty-string ?p1)))
;------------------------------------------------------------------------------
(deffunction cortex::input-is-target-symbol (?sp ?input)
             (bind ?str (str-cat ?input))
             (and (neq 0 (str-compare ?str ?sp))
                  (str-index ?sp ?str)))
;------------------------------------------------------------------------------
(deffunction cortex::defsymbol-lexer
 "Builds a rule for parsing a given input string for the given symbol"
             (?module-name ?symbol ?name ?docString)
             (build (format nil "(defrule %s::%s
                                          \"%s\"
                                          ?fct <- (object (is-a file-line)
                                                          (contents $?b ?s $?a))
                                          (test (input-is-target-symbol \"%s\" ?s))
                                          =>
                                          (modify-instance ?fct
                                                           (contents $?b
                                                                     (split-on-symbol \"%s\" ?s)
                                                                     $?a)))"
                     ?module-name ?name ?docString ?symbol ?symbol)))
;------------------------------------------------------------------------------

;------------------------------------------------------------------------------
;Copyright (c) 2013, Joshua Scoggins
;All rights reserved.
;
;Redistribution and use in source and binary forms, with or without
;modification, are permitted provided that the following conditions are met:
;    * Redistributions of source code must retain the above copyright
;      notice, this list of conditions and the following disclaimer.
;    * Redistributions in binary form must reproduce the above copyright
;      notice, this list of conditions and the following disclaimer in the
;      documentation and/or other materials provided with the distribution.
;    * Neither the name of Joshua Scoggins nor the
;      names of its contributors may be used to endorse or promote products
;      derived from this software without specific prior written permission.
;
;THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
;ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
;WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
;DISCLAIMED. IN NO EVENT SHALL Joshua Scoggins BE LIABLE FOR ANY
;DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
;(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
;LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
;ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
;(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
;SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
;------------------------------------------------------------------------------
(deffunction cortex::blank-on-empty-string(?str)
 "Returns a blank multifield if the given input string is empty"
             (if (> (str-length ?str) 0) then ?str else (create$)))
;------------------------------------------------------------------------------
(deffunction cortex::split-on-symbol (?sp ?i)
             (bind ?str (if (stringp ?i) then ?i else (str-cat ?i)))
             (bind ?ind (str-index ?sp ?str))
             (bind ?p0 (sub-string 1 (- ?ind 1) ?str))
             (bind ?p1 (sub-string (+ ?ind 1) (str-length ?str) ?str))
             (create$ (blank-on-empty-string ?p0) ?sp
                      (blank-on-empty-string ?p1)))
;------------------------------------------------------------------------------
(deffunction cortex::input-is-target-symbol (?sp ?input)
             (bind ?str (str-cat ?input))
             (and (neq 0 (str-compare ?str ?sp))
                  (str-index ?sp ?str)))
;------------------------------------------------------------------------------
(deffunction cortex::defsymbol
 "Builds a rule for parsing a given input string for the given symbol"
             (?module-name ?symbol ?name ?docString)
             (build (format nil "(defrule %s::%s
                                          \"%s\"
                                          ?fct <- (object (is-a file-line)
                                                          (contents $?b ?s $?a))
                                          (test (input-is-not-split-symbol \"%s\" ?s))
                                          =>
                                          (modify-instance ?fct
                                                           (contents $?b
                                                                     (break-apart \"%s\" ?s)
                                                                     $?a)))"
                     ?module-name ?name ?docString ?symbol ?symbol)))
;------------------------------------------------------------------------------


Fix minor typo

Fix minor typo

(defrule boston-tea-party
	; they dumped the tea into the sea!
	?ship <- (ship ?name boston)
	?route <- (route london boston)
	(cargo ?name tea)
	=>
	(retract ?ship ?route)
	(assert (route hong-kong boston))
)

(defrule set-sail
	?anchor <- (ship ?name ?location)
	?command <- (sail ?name ?destination)
	(route ?location ?destination)
	=>
	(retract ?anchor ?command)
	(assert (ship ?name ?destination))
)

(defrule unload-cargo
	(ship ?name ?location)
	(cargo ?name ?type)
	=>
	(assert (stock ?location ?type))
)

(defrule load-cargo
	(ship ?name ?location)
	(stock ?location ?type)
	=>
	(assert (cargo ?name ?type))
)

(defrule opium-war
	; because East India Company was evil
	(stock hong-kong opium)
	?route <- (route hong-kong ?)
	=>
	(retract ?route)
)

(deffacts  initial-facts
	(ship flying-cloud london)
	(ship hornet london)
	(ship sea-witch hong-kong)
	(route boston hong-kong)
	(route boston london)
	(route london boston)
	(route london hong-kong)
	(route hong-kong london)
	(stock hong-kong tea)
	(stock london opium)
	(stock boston cotton)
)

(defrule boston-tea-party
	; they dumped the tea into the sea!
	?ship <- (ship ?name boston)
	?route <- (route london boston)
	(cargo ?name tea)
	=>
	(retract ?ship ?route)
	(assert (route hong-kong boston))
)

(defrule set-sail
	?anchor <- (ship ?name ?location)
	?command <- (sail ?name ?destenation)
	(route ?location ?destenation)
	=>
	(retract ?anchor ?command)
	(assert (ship ?name ?destenation))
)

(defrule unload-cargo
	(ship ?name ?location)
	(cargo ?name ?type)
	=>
	(assert (stock ?location ?type))
)

(defrule load-cargo
	(ship ?name ?location)
	(stock ?location ?type)
	=>
	(assert (cargo ?name ?type))
)

(defrule opium-war
	; because East India Company was evil
	(stock hong-kong opium)
	?route <- (route hong-kong ?)
	=>
	(retract ?route)
)

(deffacts  initial-facts
	(ship flying-cloud london)
	(ship hornet london)
	(ship sea-witch hong-kong)
	(route boston hong-kong)
	(route boston london)
	(route london boston)
	(route london hong-kong)
	(route hong-kong london)
	(stock hong-kong tea)
	(stock london opium)
	(stock boston cotton)
)


Exposed the List class in the module definition

;------------------------------------------------------------------------------
;Copyright (c) 2012, Joshua Scoggins
;All rights reserved.
;
;Redistribution and use in source and binary forms, with or without
;modification, are permitted provided that the following conditions are met:
;    * Redistributions of source code must retain the above copyright
;      notice, this list of conditions and the following disclaimer.
;    * Redistributions in binary form must reproduce the above copyright
;      notice, this list of conditions and the following disclaimer in the
;      documentation and/or other materials provided with the distribution.
;    * Neither the name of Joshua Scoggins nor the
;      names of its contributors may be used to endorse or promote products
;      derived from this software without specific prior written permission.
;
;THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
;ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
;WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
;DISCLAIMED. IN NO EVENT SHALL Joshua Scoggins BE LIABLE FOR ANY
;DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
;(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
;LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
;ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
;(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
;SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
;------------------------------------------------------------------------------
; ModuleHeader.clp - Contains the entry point into the core module.
;------------------------------------------------------------------------------
; In CLIPS, modules are defined BEFORE their corresponding contents are defined
; so this file doubles as a loader as well. Absolute paths must be used because
; CLIPS does not understand the concept of partial paths.
;
; If you want to change the layout of this module then you must update these
; paths. Failure to do so will cause the optimization to not work correctly.
;------------------------------------------------------------------------------

(defmodule core
 ; Modify this export to add more classes
 ; Just remember that these three classes are pretty critical to the rest of
 ; the optimization
 (export defclass Object InteropObject Hint List)
 ; Modify this export to add more functions to be exposed
 ; I would advise against removing these functions
 (export deffunction superset equal$ has-common-element disjoint)

(load* "modules/core/Object.clp")
(load* "modules/core/InteropObject.clp")
(load* "modules/core/Hint.clp")
(load* "modules/core/List.clp")
; Add more defclasses here
; The programmer is responsible for ordering the load statements so that
; class dependencies are met
(load* "modules/core/SetExtensions.clp")
; Add more deffunctions here
; The programmer is responsible for ordering the load statements so that
; function dependencies are met

;------------------------------------------------------------------------------
;Copyright (c) 2012, Joshua Scoggins
;All rights reserved.
;
;Redistribution and use in source and binary forms, with or without
;modification, are permitted provided that the following conditions are met:
;    * Redistributions of source code must retain the above copyright
;      notice, this list of conditions and the following disclaimer.
;    * Redistributions in binary form must reproduce the above copyright
;      notice, this list of conditions and the following disclaimer in the
;      documentation and/or other materials provided with the distribution.
;    * Neither the name of Joshua Scoggins nor the
;      names of its contributors may be used to endorse or promote products
;      derived from this software without specific prior written permission.
;
;THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
;ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
;WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
;DISCLAIMED. IN NO EVENT SHALL Joshua Scoggins BE LIABLE FOR ANY
;DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
;(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
;LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
;ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
;(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
;SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
;------------------------------------------------------------------------------
; ModuleHeader.clp - Contains the entry point into the core module.
;------------------------------------------------------------------------------
; In CLIPS, modules are defined BEFORE their corresponding contents are defined
; so this file doubles as a loader as well. Absolute paths must be used because
; CLIPS does not understand the concept of partial paths.
;
; If you want to change the layout of this module then you must update these
; paths. Failure to do so will cause the optimization to not work correctly.
;------------------------------------------------------------------------------

(defmodule core
 ; Modify this export to add more classes
 ; Just remember that these three classes are pretty critical to the rest of
 ; the optimization
 (export defclass Object InteropObject Hint)
 ; Modify this export to add more functions to be exposed
 ; I would advise against removing these functions
 (export deffunction superset equal$ has-common-element disjoint)

(load* "modules/core/Object.clp")
(load* "modules/core/InteropObject.clp")
(load* "modules/core/Hint.clp")
; Add more defclasses here
; The programmer is responsible for ordering the load statements so that
; class dependencies are met
(load* "modules/core/SetExtensions.clp")
; Add more deffunctions here
; The programmer is responsible for ordering the load statements so that
; function dependencies are met