Advertisement
Guest User

Untitled

a guest
Oct 21st, 2019
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.37 KB | None | 0 0
  1. /**
  2. * Testing new min choose.
  3. *
  4. * Warranty & Liability
  5. * To the extent permitted by applicable law and unless explicitly
  6. * otherwise agreed upon, XLOG Technologies GmbH makes no warranties
  7. * regarding the provided information. XLOG Technologies GmbH assumes
  8. * no liability that any problems might be solved with the information
  9. * provided by XLOG Technologies GmbH.
  10. *
  11. * Rights & License
  12. * All industrial property rights regarding the information - copyright
  13. * and patent rights in particular - are the sole property of XLOG
  14. * Technologies GmbH. If the company was not the originator of some
  15. * excerpts, XLOG Technologies GmbH has at least obtained the right to
  16. * reproduce, change and translate the information.
  17. *
  18. * Reproduction is restricted to the whole unaltered document. Reproduction
  19. * of the information is only allowed for non-commercial uses. Selling,
  20. * giving away or letting of the execution of the library is prohibited.
  21. * The library can be distributed as part of your applications and libraries
  22. * for execution provided this comment remains unchanged.
  23. *
  24. * Restrictions
  25. * Only to be distributed with programs that add significant and primary
  26. * functionality to the library. Not to be distributed with additional
  27. * software intended to replace any components of the library.
  28. *
  29. * Trademarks
  30. * Jekejeke is a registered trademark of XLOG Technologies GmbH.
  31. */
  32.  
  33. % :- reexport(../compiler/asp3).
  34. :- reexport(library(minimal/asp)).
  35.  
  36. :- forward foo/2.
  37.  
  38. min_choose(1,[foo(1),foo(2),foo(3),foo(4)]) <= posted(init14).
  39.  
  40. min_choose(2,[foo(1),foo(2),foo(3),foo(4)]) <= posted(init24).
  41.  
  42. min_choose(3,[foo(1),foo(2),foo(3),foo(4)]) <= posted(init34).
  43.  
  44. min_choose(4,[foo(1),foo(2),foo(3),foo(4)]) <= posted(init44).
  45.  
  46. random_min_choose(1,[foo(1),foo(2),foo(3),foo(4)]) <= posted(rinit14).
  47.  
  48. random_min_choose(2,[foo(1),foo(2),foo(3),foo(4)]) <= posted(rinit24).
  49.  
  50. random_min_choose(3,[foo(1),foo(2),foo(3),foo(4)]) <= posted(rinit34).
  51.  
  52. random_min_choose(4,[foo(1),foo(2),foo(3),foo(4)]) <= posted(rinit44).
  53.  
  54. % ?- post(init34), (foo(X), write(foo(X)), write('. '), fail; true).
  55. % foo(1). foo(2). foo(3). Yes ;
  56. % foo(1). foo(2). foo(4). Yes ;
  57. % foo(1). foo(3). foo(4). Yes ;
  58. % foo(2). foo(3). foo(4). Yes
  59.  
  60. % ?- post(rinit34), (foo(X), write(foo(X)), write('. '), fail; true).
  61. % foo(4). foo(3). foo(2). Yes ;
  62. % foo(4). foo(3). foo(1). Yes ;
  63. % foo(4). foo(2). foo(1). Yes ;
  64. % foo(3). foo(2). foo(1). Yes
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement