| 1 | /* This file is part of the FaCT++ DL reasoner |
| 2 | Copyright (C) 2011-2015 Dmitry Tsarkov and The University of Manchester |
| 3 | Copyright (C) 2015-2017 Dmitry Tsarkov |
| 4 | |
| 5 | This library is free software; you can redistribute it and/or |
| 6 | modify it under the terms of the GNU Lesser General Public |
| 7 | License as published by the Free Software Foundation; either |
| 8 | version 2.1 version 2.1 of the License, or (at your option) any later version. |
| 9 | |
| 10 | This library is distributed in the hope that it will be useful, |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU GNU |
| 13 | Lesser General Public License for more details. |
| 14 | |
| 15 | You should have received a copy of the GNU Lesser General Public |
| 16 | License along with this library; if not, write to the Free Software |
| 17 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
| 18 | */ |
| 19 | |
| 20 | #ifndef FACT_H |
| 21 | #define FACT_H |
| 22 | |
| 23 | // export specification |
| 24 | #if defined(_WIN32) |
| 25 | # if defined(FPP_BUILD_SHARED) /* build DLL */ |
| 26 | # define FPP_EXPORT __declspec(dllexport) |
| 27 | # else /* use DLL */ |
| 28 | # define FPP_EXPORT __declspec(dllimport) |
| 29 | # endif |
| 30 | #else |
| 31 | # define FPP_EXPORT |
| 32 | #endif |
| 33 | |
| 34 | |
| 35 | #ifdef __cplusplus |
| 36 | extern "C" { |
| 37 | #endif |
| 38 | |
| 39 | /* type declarations */ |
| 40 | |
| 41 | #define DECLARE_STRUCT(name) typedef struct name ## _st name |
| 42 | /* FaCT++ kernel */ |
| 43 | DECLARE_STRUCT(fact_reasoning_kernel); |
| 44 | /* progress monitor */ |
| 45 | DECLARE_STRUCT(fact_progress_monitor); |
| 46 | /* axiom */ |
| 47 | DECLARE_STRUCT(fact_axiom); |
| 48 | /* expression */ |
| 49 | DECLARE_STRUCT(fact_expression); |
| 50 | /* concept expression */ |
| 51 | DECLARE_STRUCT(fact_concept_expression); |
| 52 | /* data- or object-role expression */ |
| 53 | DECLARE_STRUCT(fact_role_expression); |
| 54 | /* object role expression */ |
| 55 | DECLARE_STRUCT(fact_o_role_expression); |
| 56 | /* complex object role expression */ |
| 57 | DECLARE_STRUCT(fact_o_role_complex_expression); |
| 58 | /* data role expression */ |
| 59 | DECLARE_STRUCT(fact_d_role_expression); |
| 60 | /* individual expression */ |
| 61 | DECLARE_STRUCT(fact_individual_expression); |
| 62 | /* general data expression */ |
| 63 | DECLARE_STRUCT(fact_data_expression); |
| 64 | /* data type expression */ |
| 65 | DECLARE_STRUCT(fact_data_type_expression); |
| 66 | /* data value expression */ |
| 67 | DECLARE_STRUCT(fact_data_value_expression); |
| 68 | /* facet expression */ |
| 69 | DECLARE_STRUCT(fact_facet_expression); |
| 70 | /* actor to traverse taxonomy */ |
| 71 | DECLARE_STRUCT(fact_actor); |
| 72 | |
| 73 | #undef DECLARE_STRUCT |
| 74 | |
| 75 | FPP_EXPORT const char *fact_get_version (); |
| 76 | |
| 77 | FPP_EXPORT fact_reasoning_kernel *fact_reasoning_kernel_new (void); |
| 78 | FPP_EXPORT void fact_reasoning_kernel_free (fact_reasoning_kernel *); |
| 79 | |
| 80 | /* |
| 81 | ifOptionSet* getOptions ( ); |
| 82 | const ifOptionSet* getOptions ( ); |
| 83 | */ |
| 84 | |
| 85 | FPP_EXPORT int fact_is_kb_preprocessed (fact_reasoning_kernel *); |
| 86 | FPP_EXPORT int fact_is_kb_classified (fact_reasoning_kernel *); |
| 87 | FPP_EXPORT int fact_is_kb_realised (fact_reasoning_kernel *); |
| 88 | FPP_EXPORT void fact_set_progress_monitor (fact_reasoning_kernel *, fact_progress_monitor *); |
| 89 | |
| 90 | FPP_EXPORT void fact_set_verbose_output (fact_reasoning_kernel *, int value); |
| 91 | |
| 92 | FPP_EXPORT void fact_set_top_bottom_role_names (fact_reasoning_kernel *, |
| 93 | const char *top_b_role_name, |
| 94 | const char *bot_b_role_name, |
| 95 | const char *top_d_role_name, |
| 96 | const char *bot_d_role_name); |
| 97 | |
| 98 | FPP_EXPORT void fact_set_operation_timeout (fact_reasoning_kernel *, |
| 99 | unsigned long timeout); |
| 100 | |
| 101 | FPP_EXPORT int fact_new_kb (fact_reasoning_kernel *); |
| 102 | FPP_EXPORT int fact_release_kb (fact_reasoning_kernel *); |
| 103 | FPP_EXPORT int fact_clear_kb (fact_reasoning_kernel *); |
| 104 | |
| 105 | FPP_EXPORT fact_axiom *fact_declare (fact_reasoning_kernel *, fact_expression *c); |
| 106 | FPP_EXPORT fact_axiom *fact_implies_concepts (fact_reasoning_kernel *, |
| 107 | fact_concept_expression *c, |
| 108 | fact_concept_expression *d); |
| 109 | FPP_EXPORT fact_axiom *fact_equal_concepts (fact_reasoning_kernel *); |
| 110 | FPP_EXPORT fact_axiom *fact_disjoint_concepts (fact_reasoning_kernel *); |
| 111 | FPP_EXPORT fact_axiom *fact_disjoint_union (fact_reasoning_kernel *, |
| 112 | fact_concept_expression *c); |
| 113 | |
| 114 | |
| 115 | FPP_EXPORT fact_axiom *fact_set_inverse_roles (fact_reasoning_kernel *, |
| 116 | fact_o_role_expression *r, |
| 117 | fact_o_role_expression *s); |
| 118 | FPP_EXPORT fact_axiom *fact_implies_o_roles (fact_reasoning_kernel *, |
| 119 | fact_o_role_complex_expression *r, |
| 120 | fact_o_role_expression *s); |
| 121 | FPP_EXPORT fact_axiom *fact_implies_d_roles (fact_reasoning_kernel *, |
| 122 | fact_d_role_expression *r, |
| 123 | fact_d_role_expression *s); |
| 124 | FPP_EXPORT fact_axiom *fact_equal_o_roles (fact_reasoning_kernel *); |
| 125 | FPP_EXPORT fact_axiom *fact_equal_d_roles (fact_reasoning_kernel *); |
| 126 | FPP_EXPORT fact_axiom *fact_disjoint_o_roles (fact_reasoning_kernel *); |
| 127 | FPP_EXPORT fact_axiom *fact_disjoint_d_roles (fact_reasoning_kernel *); |
| 128 | |
| 129 | FPP_EXPORT fact_axiom* fact_set_o_domain (fact_reasoning_kernel *, |
| 130 | fact_o_role_expression *r, |
| 131 | fact_concept_expression *c); |
| 132 | FPP_EXPORT fact_axiom *fact_set_d_domain (fact_reasoning_kernel *, |
| 133 | fact_d_role_expression *r, |
| 134 | fact_concept_expression *c); |
| 135 | FPP_EXPORT fact_axiom *fact_set_o_range (fact_reasoning_kernel *, |
| 136 | fact_o_role_expression *r, |
| 137 | fact_concept_expression *c); |
| 138 | FPP_EXPORT fact_axiom *fact_set_d_range (fact_reasoning_kernel *, |
| 139 | fact_d_role_expression *r, |
| 140 | fact_data_expression *e); |
| 141 | |
| 142 | FPP_EXPORT fact_axiom *fact_set_transitive (fact_reasoning_kernel *, |
| 143 | fact_o_role_expression *r); |
| 144 | FPP_EXPORT fact_axiom *fact_set_reflexive (fact_reasoning_kernel *, |
| 145 | fact_o_role_expression *r); |
| 146 | FPP_EXPORT fact_axiom *fact_set_irreflexive (fact_reasoning_kernel *, |
| 147 | fact_o_role_expression *r); |
| 148 | FPP_EXPORT fact_axiom *fact_set_symmetric (fact_reasoning_kernel *, |
| 149 | fact_o_role_expression *r); |
| 150 | FPP_EXPORT fact_axiom *fact_set_asymmetric (fact_reasoning_kernel *, |
| 151 | fact_o_role_expression *r); |
| 152 | FPP_EXPORT fact_axiom *fact_set_o_functional (fact_reasoning_kernel *, |
| 153 | fact_o_role_expression *r); |
| 154 | FPP_EXPORT fact_axiom *fact_set_d_functional (fact_reasoning_kernel *, |
| 155 | fact_d_role_expression *r); |
| 156 | FPP_EXPORT fact_axiom *fact_set_inverse_functional (fact_reasoning_kernel *, |
| 157 | fact_o_role_expression *r); |
| 158 | |
| 159 | FPP_EXPORT fact_axiom *fact_instance_of (fact_reasoning_kernel *, |
| 160 | fact_individual_expression *i, |
| 161 | fact_concept_expression *c); |
| 162 | FPP_EXPORT fact_axiom *fact_related_to (fact_reasoning_kernel *, |
| 163 | fact_individual_expression *i, |
| 164 | fact_o_role_expression *r, |
| 165 | fact_individual_expression *j); |
| 166 | FPP_EXPORT fact_axiom *fact_related_to_not (fact_reasoning_kernel *, |
| 167 | fact_individual_expression *i, |
| 168 | fact_o_role_expression *r, |
| 169 | fact_individual_expression *j); |
| 170 | FPP_EXPORT fact_axiom *fact_value_of (fact_reasoning_kernel *, |
| 171 | fact_individual_expression *i, |
| 172 | fact_d_role_expression *a, |
| 173 | fact_data_value_expression *v); |
| 174 | FPP_EXPORT fact_axiom *fact_value_of_not (fact_reasoning_kernel *, |
| 175 | fact_individual_expression *i, |
| 176 | fact_d_role_expression *a, |
| 177 | fact_data_value_expression *v); |
| 178 | FPP_EXPORT fact_axiom *fact_process_same (fact_reasoning_kernel *); |
| 179 | FPP_EXPORT fact_axiom *fact_process_different (fact_reasoning_kernel *); |
| 180 | FPP_EXPORT fact_axiom *fact_set_fairness_constraint (fact_reasoning_kernel *); |
| 181 | |
| 182 | FPP_EXPORT void fact_retract (fact_reasoning_kernel *, fact_axiom *axiom); |
| 183 | |
| 184 | FPP_EXPORT int fact_is_kb_consistent (fact_reasoning_kernel *); |
| 185 | FPP_EXPORT void fact_preprocess_kb (fact_reasoning_kernel *); |
| 186 | FPP_EXPORT void fact_classify_kb (fact_reasoning_kernel *); |
| 187 | FPP_EXPORT void fact_realise_kb (fact_reasoning_kernel *); |
| 188 | |
| 189 | FPP_EXPORT int fact_is_o_functional (fact_reasoning_kernel *, fact_o_role_expression *r); |
| 190 | FPP_EXPORT int fact_is_d_functional (fact_reasoning_kernel *, |
| 191 | fact_d_role_expression *r); |
| 192 | FPP_EXPORT int fact_is_inverse_functional (fact_reasoning_kernel *, |
| 193 | fact_o_role_expression *r); |
| 194 | FPP_EXPORT int fact_is_transitive (fact_reasoning_kernel *, fact_o_role_expression *r); |
| 195 | FPP_EXPORT int fact_is_symmetric (fact_reasoning_kernel *, fact_o_role_expression *r); |
| 196 | FPP_EXPORT int fact_is_asymmetric (fact_reasoning_kernel *, fact_o_role_expression *r); |
| 197 | FPP_EXPORT int fact_is_reflexive (fact_reasoning_kernel *, fact_o_role_expression *r); |
| 198 | FPP_EXPORT int fact_is_irreflexive (fact_reasoning_kernel *, fact_o_role_expression *r); |
| 199 | FPP_EXPORT int fact_is_sub_o_roles (fact_reasoning_kernel *, fact_o_role_expression *r, |
| 200 | fact_o_role_expression *s); |
| 201 | FPP_EXPORT int fact_is_sub_d_roles (fact_reasoning_kernel *, fact_d_role_expression *r, |
| 202 | fact_d_role_expression *s); |
| 203 | FPP_EXPORT int fact_is_disjoint_o_roles (fact_reasoning_kernel *, |
| 204 | fact_o_role_expression *r, |
| 205 | fact_o_role_expression *s); |
| 206 | FPP_EXPORT int fact_is_disjoint_d_roles (fact_reasoning_kernel *, |
| 207 | fact_d_role_expression *r, |
| 208 | fact_d_role_expression *s); |
| 209 | FPP_EXPORT int fact_is_disjoint_roles (fact_reasoning_kernel *); |
| 210 | FPP_EXPORT int fact_is_sub_chain (fact_reasoning_kernel *, fact_o_role_expression *r); |
| 211 | |
| 212 | FPP_EXPORT int fact_is_satisfiable (fact_reasoning_kernel *, fact_concept_expression *c); |
| 213 | FPP_EXPORT int fact_is_subsumed_by (fact_reasoning_kernel *, fact_concept_expression *c, |
| 214 | fact_concept_expression *d); |
| 215 | FPP_EXPORT int fact_is_disjoint (fact_reasoning_kernel *, fact_concept_expression *c, |
| 216 | fact_concept_expression *d); |
| 217 | FPP_EXPORT int fact_is_equivalent (fact_reasoning_kernel *, fact_concept_expression *c, |
| 218 | fact_concept_expression *d); |
| 219 | |
| 220 | FPP_EXPORT void fact_get_sup_concepts (fact_reasoning_kernel *, fact_concept_expression *c, |
| 221 | int direct, fact_actor **actor); |
| 222 | FPP_EXPORT void fact_get_sub_concepts (fact_reasoning_kernel *, fact_concept_expression *c, |
| 223 | int direct, fact_actor **actor); |
| 224 | FPP_EXPORT void fact_get_equivalent_concepts (fact_reasoning_kernel *, |
| 225 | fact_concept_expression *c, |
| 226 | fact_actor **actor); |
| 227 | FPP_EXPORT void fact_get_disjoint_concepts (fact_reasoning_kernel *, |
| 228 | fact_concept_expression *c, |
| 229 | fact_actor **actor); |
| 230 | |
| 231 | FPP_EXPORT void fact_get_sup_roles (fact_reasoning_kernel *, fact_role_expression *r, |
| 232 | int direct, fact_actor **actor); |
| 233 | FPP_EXPORT void fact_get_sub_roles (fact_reasoning_kernel *, fact_role_expression *r, |
| 234 | int direct, fact_actor **actor); |
| 235 | FPP_EXPORT void fact_get_equivalent_roles (fact_reasoning_kernel *, fact_role_expression *r, |
| 236 | fact_actor **actor); |
| 237 | FPP_EXPORT void fact_get_o_role_domain (fact_reasoning_kernel *, fact_o_role_expression *r, |
| 238 | int direct, fact_actor **actor); |
| 239 | FPP_EXPORT void fact_get_d_role_domain (fact_reasoning_kernel *, fact_d_role_expression *r, |
| 240 | int direct, fact_actor **actor); |
| 241 | FPP_EXPORT void fact_get_role_range (fact_reasoning_kernel *, fact_o_role_expression *r, |
| 242 | int direct, fact_actor **actor); |
| 243 | FPP_EXPORT void fact_get_direct_instances (fact_reasoning_kernel *, |
| 244 | fact_concept_expression *c, fact_actor **actor); |
| 245 | FPP_EXPORT void fact_get_instances (fact_reasoning_kernel *, fact_concept_expression *c, |
| 246 | fact_actor **actor); |
| 247 | FPP_EXPORT void fact_get_types (fact_reasoning_kernel *, fact_individual_expression *i, |
| 248 | int direct, fact_actor **actor); |
| 249 | FPP_EXPORT void fact_get_same_as (fact_reasoning_kernel *, |
| 250 | fact_individual_expression *i, fact_actor **actor); |
| 251 | |
| 252 | FPP_EXPORT int fact_is_same_individuals (fact_reasoning_kernel *, |
| 253 | fact_individual_expression *i, |
| 254 | fact_individual_expression *j); |
| 255 | FPP_EXPORT int fact_is_instance (fact_reasoning_kernel *, |
| 256 | fact_individual_expression *i, |
| 257 | fact_concept_expression *c); |
| 258 | /* |
| 259 | void fact_get_related_roles (fact_reasoning_kernel *, |
| 260 | fact_individual_expression *i, |
| 261 | int data, int needI, |
| 262 | fact_names_vector **result); |
| 263 | */ |
| 264 | FPP_EXPORT const char **fact_get_role_fillers (fact_reasoning_kernel *, |
| 265 | fact_individual_expression *i, |
| 266 | fact_o_role_expression *r); |
| 267 | FPP_EXPORT int fact_is_related (fact_reasoning_kernel *, |
| 268 | fact_individual_expression *i, |
| 269 | fact_o_role_expression *r, |
| 270 | fact_individual_expression *j); |
| 271 | |
| 272 | FPP_EXPORT fact_actor* fact_concept_actor_new(); |
| 273 | FPP_EXPORT fact_actor* fact_individual_actor_new(); |
| 274 | FPP_EXPORT fact_actor* fact_o_role_actor_new(); |
| 275 | FPP_EXPORT fact_actor* fact_d_role_actor_new(); |
| 276 | FPP_EXPORT void fact_actor_free(fact_actor*); |
| 277 | /* get 1-d NULL-terminated array of synonyms of the 1st entry(necessary for Equivalents, for example) */ |
| 278 | FPP_EXPORT const char** fact_get_synonyms ( fact_actor* ); |
| 279 | /* get NULL-terminated 2D array of all required elements of the taxonomy */ |
| 280 | FPP_EXPORT const char*** fact_get_elements_2d ( fact_actor* ); |
| 281 | /* get NULL-terminated 1D array of all required elements of the taxonomy */ |
| 282 | FPP_EXPORT const char** fact_get_elements_1d ( fact_actor* ); |
| 283 | |
| 284 | /* opens new argument list */ |
| 285 | FPP_EXPORT void fact_new_arg_list ( fact_reasoning_kernel *k ); |
| 286 | /* add argument _a_rG to the current argument list */ |
| 287 | FPP_EXPORT void fact_add_arg ( fact_reasoning_kernel *k,fact_expression* e ); |
| 288 | |
| 289 | /* create expressions methods */ |
| 290 | |
| 291 | /* concepts */ |
| 292 | |
| 293 | /* get _t_o_p concept */ |
| 294 | FPP_EXPORT fact_concept_expression* fact_top ( fact_reasoning_kernel *k ); |
| 295 | /* get _b_o_t_t_o_m concept */ |
| 296 | FPP_EXPORT fact_concept_expression* fact_bottom ( fact_reasoning_kernel *k ); |
| 297 | /* get named concept */ |
| 298 | FPP_EXPORT fact_concept_expression* fact_concept ( fact_reasoning_kernel *k,const char* name ); |
| 299 | /* get negation of a concept c */ |
| 300 | FPP_EXPORT fact_concept_expression* fact_not ( fact_reasoning_kernel *k,fact_concept_expression* c ); |
| 301 | /* get an n-ary conjunction expression; take the arguments from the last argument list */ |
| 302 | FPP_EXPORT fact_concept_expression* fact_and ( fact_reasoning_kernel *k ); |
| 303 | /* get an n-ary disjunction expression; take the arguments from the last argument list */ |
| 304 | FPP_EXPORT fact_concept_expression* fact_or ( fact_reasoning_kernel *k ); |
| 305 | /* get an n-ary one-of expression; take the arguments from the last argument list */ |
| 306 | FPP_EXPORT fact_concept_expression* fact_one_of ( fact_reasoning_kernel *k ); |
| 307 | |
| 308 | /* get self-reference restriction of an object role r */ |
| 309 | FPP_EXPORT fact_concept_expression* fact_self_reference ( fact_reasoning_kernel *k,fact_o_role_expression* r ); |
| 310 | /* get value restriction wrt an object role r and an individual i */ |
| 311 | FPP_EXPORT fact_concept_expression* fact_o_value ( fact_reasoning_kernel *k,fact_o_role_expression* r, fact_individual_expression* i ); |
| 312 | /* get existential restriction wrt an object role r and a concept c */ |
| 313 | FPP_EXPORT fact_concept_expression* fact_o_exists ( fact_reasoning_kernel *k,fact_o_role_expression* r, fact_concept_expression* c ); |
| 314 | /* get universal restriction wrt an object role r and a concept c */ |
| 315 | FPP_EXPORT fact_concept_expression* fact_o_forall ( fact_reasoning_kernel *k,fact_o_role_expression* r, fact_concept_expression* c ); |
| 316 | /* get min cardinality restriction wrt number _n, an object role r and a concept c */ |
| 317 | FPP_EXPORT fact_concept_expression* fact_o_min_cardinality ( fact_reasoning_kernel *k,unsigned int n, fact_o_role_expression* r, fact_concept_expression* c ); |
| 318 | /* get max cardinality restriction wrt number _n, an object role r and a concept c */ |
| 319 | FPP_EXPORT fact_concept_expression* fact_o_max_cardinality ( fact_reasoning_kernel *k,unsigned int n, fact_o_role_expression* r, fact_concept_expression* c ); |
| 320 | /* get exact cardinality restriction wrt number _n, an object role r and a concept c */ |
| 321 | FPP_EXPORT fact_concept_expression* fact_o_cardinality ( fact_reasoning_kernel *k,unsigned int n, fact_o_role_expression* r, fact_concept_expression* c ); |
| 322 | |
| 323 | /* get value restriction wrt a data role r and a data value v */ |
| 324 | FPP_EXPORT fact_concept_expression* fact_d_value ( fact_reasoning_kernel *k,fact_d_role_expression* r, fact_data_value_expression* v ); |
| 325 | /* get existential restriction wrt a data role r and a data expression e */ |
| 326 | FPP_EXPORT fact_concept_expression* fact_d_exists ( fact_reasoning_kernel *k,fact_d_role_expression* r, fact_data_expression* e ); |
| 327 | /* get universal restriction wrt a data role r and a data expression e */ |
| 328 | FPP_EXPORT fact_concept_expression* fact_d_forall ( fact_reasoning_kernel *k,fact_d_role_expression* r, fact_data_expression* e ); |
| 329 | /* get min cardinality restriction wrt number _n, a data role r and a data expression e */ |
| 330 | FPP_EXPORT fact_concept_expression* fact_d_min_cardinality ( fact_reasoning_kernel *k,unsigned int n, fact_d_role_expression* r, fact_data_expression* e ); |
| 331 | /* get max cardinality restriction wrt number _n, a data role r and a data expression e */ |
| 332 | FPP_EXPORT fact_concept_expression* fact_d_max_cardinality ( fact_reasoning_kernel *k,unsigned int n, fact_d_role_expression* r, fact_data_expression* e ); |
| 333 | /* get exact cardinality restriction wrt number _n, a data role r and a data expression e */ |
| 334 | FPP_EXPORT fact_concept_expression* fact_d_cardinality ( fact_reasoning_kernel *k,unsigned int n, fact_d_role_expression* r, fact_data_expression* e ); |
| 335 | |
| 336 | /* individuals */ |
| 337 | |
| 338 | /* get named individual */ |
| 339 | FPP_EXPORT fact_individual_expression* fact_individual ( fact_reasoning_kernel *k,const char* name ); |
| 340 | |
| 341 | /* object roles */ |
| 342 | |
| 343 | /* get _t_o_p object role */ |
| 344 | FPP_EXPORT fact_o_role_expression* fact_object_role_top ( fact_reasoning_kernel *k ); |
| 345 | /* get _b_o_t_t_o_m object role */ |
| 346 | FPP_EXPORT fact_o_role_expression* fact_object_role_bottom ( fact_reasoning_kernel *k ); |
| 347 | /* get named object role */ |
| 348 | FPP_EXPORT fact_o_role_expression* fact_object_role ( fact_reasoning_kernel *k,const char* name ); |
| 349 | /* get an inverse of a given object role expression r */ |
| 350 | FPP_EXPORT fact_o_role_expression* fact_inverse ( fact_reasoning_kernel *k,fact_o_role_expression* r ); |
| 351 | /* get a role chain corresponding to _r1 o ... o _rn; take the arguments from the last argument list */ |
| 352 | FPP_EXPORT fact_o_role_complex_expression* fact_compose ( fact_reasoning_kernel *k ); |
| 353 | /* get a expression corresponding to r projected from c */ |
| 354 | FPP_EXPORT fact_o_role_complex_expression* fact_project_from ( fact_reasoning_kernel *k,fact_o_role_expression* r, fact_concept_expression* c ); |
| 355 | /* get a expression corresponding to r projected into c */ |
| 356 | FPP_EXPORT fact_o_role_complex_expression* fact_project_into ( fact_reasoning_kernel *k,fact_o_role_expression* r, fact_concept_expression* c ); |
| 357 | |
| 358 | /* data roles */ |
| 359 | |
| 360 | /* get _t_o_p data role */ |
| 361 | FPP_EXPORT fact_d_role_expression* fact_data_role_top ( fact_reasoning_kernel *k ); |
| 362 | /* get _b_o_t_t_o_m data role */ |
| 363 | FPP_EXPORT fact_d_role_expression* fact_data_role_bottom ( fact_reasoning_kernel *k ); |
| 364 | /* get named data role */ |
| 365 | FPP_EXPORT fact_d_role_expression* fact_data_role ( fact_reasoning_kernel *k,const char* name ); |
| 366 | |
| 367 | /* data expressions */ |
| 368 | |
| 369 | /* get _t_o_p data element */ |
| 370 | FPP_EXPORT fact_data_expression* fact_data_top ( fact_reasoning_kernel *k ); |
| 371 | /* get _b_o_t_t_o_m data element */ |
| 372 | FPP_EXPORT fact_data_expression* fact_data_bottom ( fact_reasoning_kernel *k ); |
| 373 | |
| 374 | /* get named data type */ |
| 375 | FPP_EXPORT fact_data_type_expression* fact_data_type ( fact_reasoning_kernel *k,const char* name ); |
| 376 | /* get basic string data type */ |
| 377 | FPP_EXPORT fact_data_type_expression* fact_get_str_data_type ( fact_reasoning_kernel *k ); |
| 378 | /* get basic integer data type */ |
| 379 | FPP_EXPORT fact_data_type_expression* fact_get_int_data_type ( fact_reasoning_kernel *k ); |
| 380 | /* get basic floating point data type */ |
| 381 | FPP_EXPORT fact_data_type_expression* fact_get_real_data_type ( fact_reasoning_kernel *k ); |
| 382 | /* get basic boolean data type */ |
| 383 | FPP_EXPORT fact_data_type_expression* fact_get_bool_data_type ( fact_reasoning_kernel *k ); |
| 384 | /* get basic date-time data type */ |
| 385 | FPP_EXPORT fact_data_type_expression* fact_get_time_data_type ( fact_reasoning_kernel *k ); |
| 386 | |
| 387 | /* get basic boolean data type */ |
| 388 | FPP_EXPORT fact_data_type_expression* fact_restricted_type ( fact_reasoning_kernel *k,fact_data_type_expression* type, fact_facet_expression* facet ); |
| 389 | |
| 390 | /* get data value with given _v_a_lU_e and _tY_p_e; */ |
| 391 | /* _f_iX_m_e!! now change the type to the basic type of the given one */ |
| 392 | /* _that is, value of a type positive_integer will be of a type _integer */ |
| 393 | FPP_EXPORT fact_data_value_expression* fact_data_value ( fact_reasoning_kernel *k,const char* value, fact_data_type_expression* type ); |
| 394 | /* get negation of a data expression e */ |
| 395 | FPP_EXPORT fact_data_expression* fact_data_not ( fact_reasoning_kernel *k,fact_data_expression* e ); |
| 396 | /* get an n-ary data conjunction expression; take the arguments from the last argument list */ |
| 397 | FPP_EXPORT fact_data_expression* fact_data_and ( fact_reasoning_kernel *k ); |
| 398 | /* get an n-ary data disjunction expression; take the arguments from the last argument list */ |
| 399 | FPP_EXPORT fact_data_expression* fact_data_or ( fact_reasoning_kernel *k ); |
| 400 | /* get an n-ary data one-of expression; take the arguments from the last argument list */ |
| 401 | FPP_EXPORT fact_data_expression* fact_data_one_of ( fact_reasoning_kernel *k ); |
| 402 | |
| 403 | /* get min_inclusive facet with a given _v */ |
| 404 | FPP_EXPORT fact_facet_expression* fact_facet_min_inclusive ( fact_reasoning_kernel *k,fact_data_value_expression* v ); |
| 405 | /* get min_exclusive facet with a given _v */ |
| 406 | FPP_EXPORT fact_facet_expression* fact_facet_min_exclusive ( fact_reasoning_kernel *k,fact_data_value_expression* v ); |
| 407 | /* get max_inclusive facet with a given _v */ |
| 408 | FPP_EXPORT fact_facet_expression* fact_facet_max_inclusive ( fact_reasoning_kernel *k,fact_data_value_expression* v ); |
| 409 | /* get max_exclusive facet with a given _v */ |
| 410 | FPP_EXPORT fact_facet_expression* fact_facet_max_exclusive ( fact_reasoning_kernel *k,fact_data_value_expression* v ); |
| 411 | |
| 412 | void fact_kb_set_tracing(fact_reasoning_kernel *k); |
| 413 | void fact_kb_set_dump(fact_reasoning_kernel *k); |
| 414 | |
| 415 | #ifdef __cplusplus |
| 416 | } |
| 417 | #endif |
| 418 | |
| 419 | #endif |