OverviewFilesCommitsIssuesDocsReleasesPeers

opencog-ure commits / 0ede7b2

Move URE types from atomspace to URE
0ede7b20866176e30bab7b332637fd359f97a3bc
by Linas Vepštas <linasvepstas@gmail.com> · 2024-04-02T05:48:20.000Z

Changed files (5) +104 -4

opencog/scm/opencog/ure.scm +12 -4
……@@ -1,11 +1,19 @@
11;
22; OpenCog Unified Rule Engine module
33;
4(define-module (opencog ure))
4(define-module (opencog ure)
5 #:use-module (opencog)
6 #:use-module (opencog ure-config)
7)
58
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")
912
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")
1018(load-from-path "opencog/ure/ure-utils.scm")
1119(export-ure-utils)
opencog/ure/CMakeLists.txt +2 -0
……@@ -1,6 +1,8 @@
11#
22# Rule engine lib build
33#
4ADD_SUBDIRECTORY(types)
5
46ADD_LIBRARY(ure
57 backwardchainer/BackwardChainer.cc
68 backwardchainer/TraceRecorder.cc
opencog/ure/types/CMakeLists.txt +40 -0
……@@ -0,0 +1,40 @@
1
2OPENCOG_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)
9ADD_CUSTOM_TARGET(ure_atom_types DEPENDS atom_types.h)
10
11# The atom_types.h file is written to the build directory
12INCLUDE_DIRECTORIES(${CMAKE_BINARY_DIR})
13
14ADD_LIBRARY (ure-types SHARED
15 atom_types_init
16)
17
18# Without this, parallel make will race and crap up the generated files.
19ADD_DEPENDENCIES(ure-types ure_atom_types)
20
21TARGET_LINK_LIBRARIES(ure-types
22 ${ATOMSPACE_atomtypes_LIBRARY}
23)
24
25INSTALL (TARGETS ure-types
26 LIBRARY DESTINATION "lib${LIB_DIR_SUFFIX}/opencog"
27)
28
29ADD_GUILE_EXTENSION(SCM_CONFIG ure-types "opencog-ext-path-ure-types")
30
31INSTALL (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
37INSTALL (FILES
38 ${CMAKE_CURRENT_BINARY_DIR}/ure_types.scm
39 DESTINATION "${GUILE_SITE_DIR}/opencog/ure/types"
40)
opencog/ure/types/atom_types.script +22 -0
……@@ -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
15FU_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.
19ATTRACTION_LINK <- ORDERED_LINK
20
21// Used in the URE unit tests.
22INTENSIONAL_INHERITANCE_LINK <- INHERITANCE_LINK
opencog/ure/types/atom_types_init.cc +28 -0
……@@ -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>