01: /*
02: * Copyright (C) 1999-2004 <A href="http://www-ist.massey.ac.nz/JBDietrich" target="_top">Jens Dietrich</a>
03: *
04: * This library is free software; you can redistribute it and/or
05: * modify it under the terms of the GNU Lesser General Public
06: * License as published by the Free Software Foundation; either
07: * version 2 of the License, or (at your option) any later version.
08: *
09: * This library is distributed in the hope that it will be useful,
10: * but WITHOUT ANY WARRANTY; without even the implied warranty of
11: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12: * Lesser General Public License for more details.
13: *
14: * You should have received a copy of the GNU Lesser General Public
15: * License along with this library; if not, write to the Free Software
16: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17: */
18: package org.mandarax.kernel;
19:
20: /**
21: * Interface for objects that may support semantic evaluation.
22: * E.g., a term 'plus(2,3)' with the plus function from the mandarax integer
23: * lib and the two constant terms wrapping the Integer instances 2 and 3
24: * can be evaluated (performed) using the semantics of the respective java operator
25: * or method, the evaluation will yield 5 (or more precisely, a constant
26: * term wrapping the Integer instance 5).
27: * <br>
28: * In a similar manner, a fact such as 4<plus(2,3) can be evaluated, the result is
29: * a boolean (true in this case). On the other hand, a term like plus(2,x) or a term
30: * like 4<plus(2,x) (with x being a variable term) cannot be evaluated, besides the class
31: * AutoFacts class provides a certain generalization for this case.
32: * <br>
33: * The kind of semantic used depends on the object. Since we use java as a platform,
34: * at the end it is always the meaning objects have through the implementation of
35: * their classes. Somethimes, the actual computation might be deligated to other systems,
36: * like to the relational model in case of functions integrating SQL databases,
37: * or to C++ objects in case of functions and predicates using CORBA.
38: * @see org.mandarax.util.AutoFacts
39: * @see org.mandarax.sql.SQLFunction
40: * @see org.mandarax.sql.SQLPredicate
41: * @see org.mandarax.kernel.meta.JFunction
42: * @see org.mandarax.kernel.meta.JPredicate
43: * @author <A href="http://www-ist.massey.ac.nz/JBDietrich" target="_top">Jens Dietrich</A>
44: * @version 3.4 <7 March 05>
45: * @since 1.6
46: */
47: public interface SemanticsSupport {
48:
49: /**
50: * Indicates whether the object (usually a term or a clause set) can be performed
51: * using the java semantics.
52: * @return a boolean
53: */
54: public boolean isExecutable();
55: }
|