| … | … | @@ -1,11 +1,19 @@ |
| 1 | 1 | ; |
| 2 | 2 | ; OpenCog Unified Rule Engine module |
| 3 | 3 | ; |
| 4 | (define-module (opencog ure)) | |
| 4 | (define-module (opencog ure) | |
| 5 | #:use-module (opencog) | |
| 6 | #:use-module (opencog ure-config) | |
| 7 | ) | |
| 5 | 8 | |
| 6 | (use-modules (opencog ure-config)) | |
| 7 | (use-modules (opencog logger)) | |
| 8 | (load-extension (string-append opencog-ext-path-ure "libure") "opencog_ure_init") | |
| 9 | (load-extension | |
| 10 | (string-append opencog-ext-path-ure-types "libure-types") | |
| 11 | "ure_types_init") | |
| 9 | 12 | |
| 13 | (load-extension | |
| 14 | (string-append opencog-ext-path-ure "libure") | |
| 15 | "opencog_ure_init") | |
| 16 | ||
| 17 | (include-from-path "opencog/ure/types/ure_types.scm") | |
| 10 | 18 | (load-from-path "opencog/ure/ure-utils.scm") |
| 11 | 19 | (export-ure-utils) |
| … | … | @@ -1,6 +1,8 @@ |
| 1 | 1 | # |
| 2 | 2 | # Rule engine lib build |
| 3 | 3 | # |
| 4 | ADD_SUBDIRECTORY(types) | |
| 5 | ||
| 4 | 6 | ADD_LIBRARY(ure |
| 5 | 7 | backwardchainer/BackwardChainer.cc |
| 6 | 8 | backwardchainer/TraceRecorder.cc |
| … | … | @@ -0,0 +1,40 @@ |
| 1 | ||
| 2 | OPENCOG_ADD_ATOM_TYPES(atom_types.script | |
| 3 | atom_types.h | |
| 4 | atom_types.definitions | |
| 5 | atom_types.inheritance | |
| 6 | ure_types.scm | |
| 7 | ure_types.pyx | |
| 8 | ) | |
| 9 | ADD_CUSTOM_TARGET(ure_atom_types DEPENDS atom_types.h) | |
| 10 | ||
| 11 | # The atom_types.h file is written to the build directory | |
| 12 | INCLUDE_DIRECTORIES(${CMAKE_BINARY_DIR}) | |
| 13 | ||
| 14 | ADD_LIBRARY (ure-types SHARED | |
| 15 | atom_types_init | |
| 16 | ) | |
| 17 | ||
| 18 | # Without this, parallel make will race and crap up the generated files. | |
| 19 | ADD_DEPENDENCIES(ure-types ure_atom_types) | |
| 20 | ||
| 21 | TARGET_LINK_LIBRARIES(ure-types | |
| 22 | ${ATOMSPACE_atomtypes_LIBRARY} | |
| 23 | ) | |
| 24 | ||
| 25 | INSTALL (TARGETS ure-types | |
| 26 | LIBRARY DESTINATION "lib${LIB_DIR_SUFFIX}/opencog" | |
| 27 | ) | |
| 28 | ||
| 29 | ADD_GUILE_EXTENSION(SCM_CONFIG ure-types "opencog-ext-path-ure-types") | |
| 30 | ||
| 31 | INSTALL (FILES | |
| 32 | ${CMAKE_CURRENT_BINARY_DIR}/atom_types.h | |
| 33 | ${CMAKE_CURRENT_BINARY_DIR}/atom_names.h | |
| 34 | DESTINATION "include/opencog/ure/types" | |
| 35 | ) | |
| 36 | ||
| 37 | INSTALL (FILES | |
| 38 | ${CMAKE_CURRENT_BINARY_DIR}/ure_types.scm | |
| 39 | DESTINATION "${GUILE_SITE_DIR}/opencog/ure/types" | |
| 40 | ) |
| … | … | @@ -0,0 +1,22 @@ |
| 1 | // | |
| 2 | // Assorted URE link types. These are specific to the theory of URE | |
| 3 | // and the rules it defines for knowledge representation and reasoning. | |
| 4 | // See the book on PLN by Goertzel etal. to understand what these are | |
| 5 | // all about. | |
| 6 | ||
| 7 | // ImplicationScopeLink is a synonym for RuleLink, as far as I can tell. | |
| 8 | // It is used by PLN to do more or less the same thing as RuleLink. | |
| 9 | // Except that BackwardChainerUTest hangs when it inherits from | |
| 10 | // RuleLink, because RuleLink::execute() does something that URE isn't | |
| 11 | // expecting. XXX FIXME. | |
| 12 | // IMPLICATION_SCOPE_LINK <- RULE_LINK | |
| 13 | // IMPLICATION_SCOPE_LINK <- SCOPE_LINK | |
| 14 | ||
| 15 | FU_LINK <- ORDERED_LINK | |
| 16 | ||
| 17 | // Mystery link used by URE in it's unit tests. It is not documented | |
| 18 | // anywhere that I know of. | |
| 19 | ATTRACTION_LINK <- ORDERED_LINK | |
| 20 | ||
| 21 | // Used in the URE unit tests. | |
| 22 | INTENSIONAL_INHERITANCE_LINK <- INHERITANCE_LINK |
| … | … | @@ -0,0 +1,28 @@ |
| 1 | /* | |
| 2 | * opencog/ure/types/atom_types_init.cc | |
| 3 | * | |
| 4 | * Copyright (C) 2014 Eddie Monroe | |
| 5 | * All Rights Reserved | |
| 6 | * | |
| 7 | * This program is free software; you can redistribute it and/or modify | |
| 8 | * it under the terms of the GNU Affero General Public License v3 as | |
| 9 | * published by the Free Software Foundation and including the exceptions | |
| 10 | * at http://opencog.org/wiki/Licenses | |
| 11 | * | |
| 12 | * This program is distributed in the hope that it will be useful, | |
| 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
| 15 | * GNU General Public License for more details. | |
| 16 | * | |
| 17 | * You should have received a copy of the GNU Affero General Public License | |
| 18 | * along with this program; if not, write to: | |
| 19 | * Free Software Foundation, Inc., | |
| 20 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. | |
| 21 | */ | |
| 22 | ||
| 23 | #include "opencog/ure/types/atom_types.definitions" | |
| 24 | ||
| 25 | #define INHERITANCE_FILE "opencog/ure/types/atom_types.inheritance" | |
| 26 | #define INITNAME ure_types_init | |
| 27 | ||
| 28 | #include <opencog/atoms/atom_types/atom_types.cc> |