/*** This module provides some choice operators for answer set* programming via forward chaining. Since we use the (:-)/2* operator already for backward chaining rules, the operator* (<=)/2 form the module "delta" needs to be used to write* answer set programming rules. Take this example:** Example:* :- p, q, r.* {p,r}.* {q} :- p.* {r} :- p.** This would need to be written as follows. For answer set* programming constraints a forward chaining rule with a fail* action is suggested. Further answer set programming ordinary* facts and disjunctive facts need a start condition such as "init",* which can then be used to produce an anwser set:** Example:* fail <= posted(p), posted(q), posted(r).* choose([p,r]) <= posted(init).* choose([q]) <= posted(p).* choose([r]) <= posted(p).* ?- post(init).** Our approach to answer set programming allows explicit mixing of* forward chaining and backward chaining in that a forward chaining* rule allows backward chaining goals in its condition part. The* only predicate that this module currently provides is a choose/1* operator that allows satisfiability search.** Warranty & Liability* To the extent permitted by applicable law and unless explicitly* otherwise agreed upon, XLOG Technologies GmbH makes no warranties* regarding the provided information. XLOG Technologies GmbH assumes* no liability that any problems might be solved with the information* provided by XLOG Technologies GmbH.** Rights & License* All industrial property rights regarding the information - copyright* and patent rights in particular - are the sole property of XLOG* Technologies GmbH. If the company was not the originator of some* excerpts, XLOG Technologies GmbH has at least obtained the right to* reproduce, change and translate the information.** Reproduction is restricted to the whole unaltered document. Reproduction* of the information is only allowed for non-commercial uses. Selling,* giving away or letting of the execution of the library is prohibited.* The library can be distributed as part of your applications and libraries* for execution provided this comment remains unchanged.** Restrictions* Only to be distributed with programs that add significant and primary* functionality to the library. Not to be distributed with additional* software intended to replace any components of the library.** Trademarks* Jekejeke is a registered trademark of XLOG Technologies GmbH.*//**************************************************************//* Primitive Choice *//**************************************************************/* choose(L):* choose(L, G):* If a positive literal from L is already satisfied, the construct* does nothing before further solving. Otherwise, the construct posts* each positive literal from L in input order before further solving.*/% choose(+List)* random_choose(L):* random_choose(L, G):* If a positive literal from L is already satisfied, the construct* does nothing before further solving. Otherwise, the construct posts* each positive literal from L in random order before further solving.*/% random_choose(+List)* sys_least(L):* The predicate succeeds when at least one positive literal* from L already exists in the forward store.*/% sys_least(+List)/**************************************************************//* Minimum Choice *//**************************************************************/* min_choose(N, L):* min_choose(N, L, G):* If N positive literals from L are already satisfied, the construct* does nothing before further solving. Otherwise, the construct posts* N positive literals from L in input order before further solving.*/% min_choose(+Integer, +List)* random_min_choose(N, L):* random_min_choose(N, L, G):* If N positive literal from L are already satisfied, the construct* does nothing before further solving. Otherwise, the construct posts* N positive literals from L in random order before further solving.*/% random_min_choose(+Integer, +List)% https://stackoverflow.com/q/10388109/502187* sys_filter(N, L, M, R):* The predicate succeeds in M and R after filtering maximally* N positive literals from the list L.*/