Failed

logicmoo.base.examples.fol.SANITY_ATLEAST_01.logicmoo.base.examples.fol.SANITY_ATLEAST_01@Test_0002_Line_0000__tHeart_1_in_t123: t123:tHeart(Heart1) (from logicmoo.base.examples.fol.logicmoo.base.examples.fol.SANITY_ATLEAST_01)

Failing for the past 1 build (Since #9 )
Took 0 ms.
Failed with 0 retries

Run 1:

Error Message

failure = "failure=info((why_was_true(t123:(\\+tHeart(_907694))),nop(ftrace(t123:tHeart(_907694)))))\nno_proof_for(\\+tHeart(Heart1)).\n\nno_proof_for(\\+tHeart(Heart1)).\n\nno_proof_for(\\+tHeart(Heart1)).\n\n". failure = []. 

Standard Error

name=Test_0002_Line_0000__tHeart_1_in_t123
JUNIT_CLASSNAME='logicmoo.base.examples.fol.SANITY_ATLEAST_01'.
JUNIT_CMD='timeout --foreground --preserve-status -s SIGKILL -k 10s 10s swipl -x /var/lib/jenkins/workspace/logicmoo_workspace/bin/lmoo-clif -t "[\'sanity_atleast_01.pfc.pl\']"'.
 (cd /var/lib/jenkins/workspace/logicmoo_workspace/packs_sys/logicmoo_base/t/examples/fol ; timeout --foreground --preserve-status -s SIGKILL -k 10s 10s swipl -x /var/lib/jenkins/workspace/logicmoo_workspace/bin/lmoo-clif -t "['sanity_atleast_01.pfc.pl']")

```
%~ init_phase(after_load)
%~ init_phase(restore_state)
%
%~ init_why(after_boot,program)
%~ after_boot.
%~ Dont forget to ?- logicmoo_i_cyc_xform.
running('/var/lib/jenkins/workspace/logicmoo_workspace/packs_sys/logicmoo_base/t/examples/fol/sanity_atleast_01.pfc.pl'),
%~ this_test_might_need( :-( use_module( library(logicmoo_plarkc))))
%~ /var/lib/jenkins/.local/share/swi-prolog/pack/logicmoo_utils/prolog/logicmoo_test_header.pl:98
%~ message_hook(
%~    error( permission_error(redefine,module,logicmoo_test),
%~      context(module/2,'Already loaded from /root/.local/share/swi-prolog/pack/logicmoo_utils/prolog/logicmoo_test.pl')),
%~    error,
%~    [ '~q/~w: '-[module,2],
%~      'No permission to ~w ~w `~p\''-[redefine,module,logicmoo_test],
%~      ' (~w)'-['Already loaded from /root/.local/share/swi-prolog/pack/logicmoo_utils/prolog/logicmoo_test.pl']])
%~ source_location('/var/lib/jenkins/.local/share/swi-prolog/pack/logicmoo_utils/prolog/logicmoo_test_header.pl',98)
module/2: No permission to redefine module `logicmoo_test' (Already loaded from /root/.local/share/swi-prolog/pack/logicmoo_utils/prolog/logicmoo_test.pl)
ERROR: /var/lib/jenkins/.local/share/swi-prolog/pack/logicmoo_utils/prolog/logicmoo_test_header.pl:98:
ERROR:    module/2: No permission to redefine module `logicmoo_test' (Already loaded from /root/.local/share/swi-prolog/pack/logicmoo_utils/prolog/logicmoo_test.pl)
%~ message_hook(
%~    error( permission_error(redefine,module,logicmoo_clif),
%~      context(
%~         prolog_stack( [ frame( 61,
%~                           call( system : '$declare_module'/6),
%~                           '$declare_module'( logicmoo_clif,
%~                             user,
%~                              user, '/var/lib/jenkins/workspace/logicmoo_workspace/packs_sys/logicmoo_base/prolog/logicmoo_clif.pl', 1, false)),
%~                         frame( 60,
%~                           clause(<gt;clause>(0x55c43cd6cc00),61),
%~                           '$start_module'( logicmoo_clif,
%~                             [],
%~                             state( true,
%~                               logicmoo_clif, true,false,
%~                                '/var/lib/jenkins/workspace/logicmoo_workspace/packs_sys/logicmoo_base/prolog/logicmoo_clif.pl', -),
%~                             [ if(not_loaded),
%~                               true])),
%~                         frame( 59,
%~                           clause(<gt;clause>(0x55c43cb59000),65),
%~                           '$first_term'(
%~                              :-( module(logicmoo_clif,[])),
%~                              _23326,
%~                              '/var/lib/jenkins/workspace/logicmoo_workspace/packs_sys/logicmoo_base/prolog/logicmoo_clif.pl',
%~                              state( true,
%~                                logicmoo_clif, true,false,
%~                                 '/var/lib/jenkins/workspace/logicmoo_workspace/packs_sys/logicmoo_base/prolog/logicmoo_clif.pl', -),
%~                              [ if(not_loaded),
%~                                true])),
%~                         frame( 58,
%~                           clause(<gt;clause>(0x55c43cb59400),60),
%~                           '$load_file'( '/var/lib/jenkins/workspace/logicmoo_workspace/packs_sys/logicmoo_base/prolog/logicmoo_clif.pl',
%~                             '/var/lib/jenkins/workspace/logicmoo_workspace/packs_sys/logicmoo_base/prolog/logicmoo_clif.pl',
%~                             Var_c47_lib_c47_jenkins_c47_workspace_c47_logicmoo_workspace_c47_packs_sys_c47_logicmoo_base_c47_prolog_c47_logicmoo_clif_c46_pl,
%~                             [ if(not_loaded),
%~                               true])),
%~                         frame( 57,
%~                           clause(<gt;clause>(0x55c43cdaf980),5),
%~                           setup_call_catcher_cleanup(
%~                              system : '$start_consult'('/var/lib/jenkins/workspace/logicmoo_workspace/packs_sys/logicmoo_base/prolog/logicmoo_clif.pl',1632432905.770371),
%~                              system : '$load_file'( '/var/lib/jenkins/workspace/logicmoo_workspace/packs_sys/logicmoo_base/prolog/logicmoo_clif.pl',
%~                                         '/var/lib/jenkins/workspace/logicmoo_workspace/packs_sys/logicmoo_base/prolog/logicmoo_clif.pl',
%~                                         Var_c47_lib_c47_jenkins_c47_workspace_c47_logicmoo_workspace_c47_packs_sys_c47_logicmoo_base_c47_prolog_c47_logicmoo_clif_c46_pl1,
%~                                         [ if(not_loaded),
%~                                           true]),
%~                              Kw,
%~                              system : '$end_consult'( '/var/lib/jenkins/workspace/logicmoo_workspace/packs_sys/logicmoo_base/prolog/logicmoo_clif.pl',
%~                                         lexstate(202,pfc),
%~                                         t123))),
%~                         frame( 53,
%~                           clause(<gt;clause>(0x55c43cfac000),221),
%~                           '$do_load_file_2'( library(logicmoo_clif),
%~                             '/var/lib/jenkins/workspace/logicmoo_workspace/packs_sys/logicmoo_base/prolog/logicmoo_clif.pl', t123,compiled,
%~                             [ if(not_loaded),
%~                               true])),
%~                         frame( 50,
%~                           clause(<gt;clause>(0x55c43cd82840),10),
%~                           '$qdo_load_file'( library(logicmoo_clif),
%~                             '/var/lib/jenkins/workspace/logicmoo_workspace/packs_sys/logicmoo_base/prolog/logicmoo_clif.pl', t123,[if(not_loaded),true])),
%~                         frame( 48,
%~                           clause(<gt;clause>(0x55c43cdaf980),5),
%~                           setup_call_catcher_cleanup(
%~                              system : with_mutex( '$load_file',
%~                                         '$mt_start_load'( '/var/lib/jenkins/workspace/logicmoo_workspace/packs_sys/logicmoo_base/prolog/logicmoo_clif.pl',
%~                                           <gt;clause>(0x55c43e42a580),
%~                                           [ if(not_loaded),
%~                                             true])),
%~                              system : '$mt_do_load'( <gt;clause>(0x55c43e42a580),
%~                                         library(logicmoo_clif),
%~                                         '/var/lib/jenkins/workspace/logicmoo_workspace/packs_sys/logicmoo_base/prolog/logicmoo_clif.pl', t123,[if(not_loaded),true]),
%~                              Kw3,
%~                              system : '$mt_end_load'(<gt;clause>(0x55c43e42a580)))),
%~                         frame(46,meta_call,0),
%~                         frame( 45,
%~                           foreign( system : '$sig_atomic'/1),
%~                           $sig_atomic( setup_call_cleanup(
%~                                           with_mutex( '$load_file',
%~                                             '$mt_start_load'( '/var/lib/jenkins/workspace/logicmoo_workspace/packs_sys/logicmoo_base/prolog/logicmoo_clif.pl',
%~                                               <gt;clause>(0x55c43e42a580),
%~                                               [ if(not_loaded),
%~                                                 true])),
%~                                           '$mt_do_load'( <gt;clause>(0x55c43e42a580),
%~                                             library(logicmoo_clif),
%~                                             '/var/lib/jenkins/workspace/logicmoo_workspace/packs_sys/logicmoo_base/prolog/logicmoo_clif.pl', t123,[if(not_loaded),true]),
%~                                           '$mt_end_load'(<gt;clause>(0x55c43e42a580))))),
%~                         frame( 42,
%~                           clause(<gt;clause>(0x55c43cd88c80),12),
%~                           '$load_file'(library(logicmoo_clif),t123,[if(not_loaded),true])),
%~                         frame( 37,
%~                           clause(<gt;clause>(0x55c450ae8c80),31),
%~                           clif_dialect : clif_expects_dialect(clif,'/var/lib/jenkins/workspace/logicmoo_workspace/packs_sys/logicmoo_base/t/examples/fol/sanity_atleast_01.pfc.pl',pfc,t123)),
%~                         frame(36,clause(<gt;clause>(0x55c450b03b00),49),clif_dialect:clif_expects_dialect(clif)),
%~                         frame(34,clause(<gt;clause>(0x55c44effa480),60),prolog_dialect:attach_dialect(clif)),
%~                         frame(33,clause(<gt;clause>(0x55c44efe9200),20),prolog_dialect:expects_dialect(clif)),
%~                         frame( 32,
%~                           clause(<gt;clause>(0x55c43cd7f380),2),
%~                           catch(
%~                              t123 : expects_dialect(clif),
%~                              error(Error,Error18),
%~                              system : $exception_in_directive( error(Error5,Error19)))),
%~                         frame(31,clause(<gt;clause>(0x55c43cd4c580),55),'$execute_directive_3'(expects_dialect(clif))),
%~                         frame( 26,
%~                           clause(<gt;clause>(0x55c43cb59400),77),
%~                           '$load_file'( '/var/lib/jenkins/workspace/logicmoo_workspace/packs_sys/logicmoo_base/t/examples/fol/sanity_atleast_01.pfc.pl',
%~                             '/var/lib/jenkins/workspace/logicmoo_workspace/packs_sys/logicmoo_base/t/examples/fol/sanity_atleast_01.pfc.pl',
%~                             Var_c47_lib_c47_jenkins_c47_workspace_c47_logicmoo_workspace_c47_packs_sys_c47_logicmoo_base_c47_t_c47_examples_c47_fol_c47_sanity_atleast_01_c46_pfc_c46_pl,
%~                             [ expand(false),
%~                               expand(true)])),
%~                         frame( 25,
%~                           clause(<gt;clause>(0x55c43cdaf980),5),
%~                           setup_call_catcher_cleanup(
%~                              system : '$start_consult'('/var/lib/jenkins/workspace/logicmoo_workspace/packs_sys/logicmoo_base/t/examples/fol/sanity_atleast_01.pfc.pl',1632225669.0391827),
%~                              system : '$load_file'( '/var/lib/jenkins/workspace/logicmoo_workspace/packs_sys/logicmoo_base/t/examples/fol/sanity_atleast_01.pfc.pl',
%~                                         '/var/lib/jenkins/workspace/logicmoo_workspace/packs_sys/logicmoo_base/t/examples/fol/sanity_atleast_01.pfc.pl',
%~                                         Var_c47_lib_c47_jenkins_c47_workspace_c47_logicmoo_workspace_c47_packs_sys_c47_logicmoo_base_c47_t_c47_examples_c47_fol_c47_sanity_atleast_01_c46_pfc_c46_pl7,
%~                                         [ expand(false),
%~                                           expand(true)]),
%~                              Kw8,
%~                              system : '$end_consult'( '/var/lib/jenkins/workspace/logicmoo_workspace/packs_sys/logicmoo_base/t/examples/fol/sanity_atleast_01.pfc.pl',
%~                                         lexstate(202,swi),
%~                                         user))),
%~                         frame( 21,
%~                           clause(<gt;clause>(0x55c43cfac000),221),
%~                           '$do_load_file_2'( 'sanity_atleast_01.pfc.pl',
%~                             '/var/lib/jenkins/workspace/logicmoo_workspace/packs_sys/logicmoo_base/t/examples/fol/sanity_atleast_01.pfc.pl', user,compiled,
%~                             [ expand(false),
%~                               expand(true)])),
%~                         frame( 18,
%~                           clause(<gt;clause>(0x55c43cd82840),10),
%~                           '$qdo_load_file'( 'sanity_atleast_01.pfc.pl',
%~                             '/var/lib/jenkins/workspace/logicmoo_workspace/packs_sys/logicmoo_base/t/examples/fol/sanity_atleast_01.pfc.pl', user,[expand(false),expand(true)])),
%~                         frame( 16,
%~                           clause(<gt;clause>(0x55c43cdaf980),5),
%~                           setup_call_catcher_cleanup(
%~                              system : with_mutex( '$load_file',
%~                                         '$mt_start_load'( '/var/lib/jenkins/workspace/logicmoo_workspace/packs_sys/logicmoo_base/t/examples/fol/sanity_atleast_01.pfc.pl',
%~                                           <gt;clause>(0x55c43e42aa80),
%~                                           [ expand(false),
%~                                             expand(true)])),
%~                              system : '$mt_do_load'( <gt;clause>(0x55c43e42aa80),
%~                                         'sanity_atleast_01.pfc.pl',
%~                                         '/var/lib/jenkins/workspace/logicmoo_workspace/packs_sys/logicmoo_base/t/examples/fol/sanity_atleast_01.pfc.pl',
%~                                         user,
%~                                         [ expand(false),
%~                                           expand(true)]),
%~                              Kw9,
%~                              system : '$mt_end_load'(<gt;clause>(0x55c43e42aa80)))),
%~                         frame(14,meta_call,0),
%~                         frame( 13,
%~                           foreign( system : '$sig_atomic'/1),
%~                           $sig_atomic( setup_call_cleanup(
%~                                           with_mutex( '$load_file',
%~                                             '$mt_start_load'( '/var/lib/jenkins/workspace/logicmoo_workspace/packs_sys/logicmoo_base/t/examples/fol/sanity_atleast_01.pfc.pl',
%~                                               <gt;clause>(0x55c43e42aa80),
%~                                               [ expand(false),
%~                                                 expand(true)])),
%~                                           '$mt_do_load'( <gt;clause>(0x55c43e42aa80),
%~                                             'sanity_atleast_01.pfc.pl',
%~                                             '/var/lib/jenkins/workspace/logicmoo_workspace/packs_sys/logicmoo_base/t/examples/fol/sanity_atleast_01.pfc.pl', user,[expand(false),expand(true)]),
%~                                           '$mt_end_load'(<gt;clause>(0x55c43e42aa80))))),
%~                         frame(10,clause(<gt;clause>(0x55c43cd88c80),12),'$load_file'('sanity_atleast_01.pfc.pl',user,'<gt;garbage_collected>'))]),
%~         'Already loaded from /root/.local/share/swi-prolog/pack/logicmoo_base/prolog/logicmoo_clif.pl')),
%~    error,
%~    [ 'No permission to ~w ~w `~p\''-[redefine,module,logicmoo_clif],
%~      ' (~w)'-['Already loaded from /root/.local/share/swi-prolog/pack/logicmoo_base/prolog/logicmoo_clif.pl'], nl,...(_10498)])
%~ source_location('/var/lib/jenkins/workspace/logicmoo_workspace/packs_sys/logicmoo_base/t/examples/fol/test_header.pl',5)
No permission to redefine module `logicmoo_clif' (Already loaded from /root/.local/share/swi-prolog/pack/logicmoo_base/prolog/logicmoo_clif.pl)
In:
  [61] $declare_module(logicmoo_clif,user,user,'/var/lib/jenkins/workspace/logicmoo_workspace/packs_sys/logicmoo_base/prolog/logicmoo_clif.pl',1,false)
  [60] $start_module(logicmoo_clif,[],state(true,logicmoo_clif,true,false,'/var/lib/jenkins/workspace/logicmoo_workspace/packs_sys/logicmoo_base/prolog/logicmoo_clif.pl',-),[if(not_loaded),must_be_module(true)]) at /var/lib/jenkins/workspace/logicmoo_workspace/lib/swipl/boot/init.pl:3166
  [59] $first_term((:-module(logicmoo_clif,[])),_706,'/var/lib/jenkins/workspace/logicmoo_workspace/packs_sys/logicmoo_base/prolog/logicmoo_clif.pl',state(true,logicmoo_clif,true,false,'/var/lib/jenkins/workspace/logicmoo_workspace/packs_sys/logicmoo_base/prolog/logicmoo_clif.pl',-),[if(not_loaded),must_be_module(true)]) at /var/lib/jenkins/workspace/logicmoo_workspace/lib/swipl/boot/init.pl:3055
  [58] $load_file('/var/lib/jenkins/workspace/logicmoo_workspace/packs_sys/logicmoo_base/prolog/logicmoo_clif.pl','/var/lib/jenkins/workspace/logicmoo_workspace/packs_sys/logicmoo_base/prolog/logicmoo_clif.pl',_784,[if(not_loaded),must_be_module(true)]) at /var/lib/jenkins/workspace/logicmoo_workspace/lib/swipl/boot/init.pl:3007
  [57] setup_call_catcher_cleanup(system: $start_consult('/var/lib/jenkins/workspace/logicmoo_workspace/packs_sys/logicmoo_base/prolog/logicmoo_clif.pl',1632432905.770371),system: $load_file('/var/lib/jenkins/workspace/logicmoo_workspace/packs_sys/logicmoo_base/prolog/logicmoo_clif.pl','/var/lib/jenkins/workspace/logicmoo_workspace/packs_sys/logicmoo_base/prolog/logicmoo_clif.pl',_862,[if(not_loaded),must_be_module(true)]),_834,system: $end_consult('/var/lib/jenkins/workspace/logicmoo_workspace/packs_sys/logicmoo_base/prolog/logicmoo_clif.pl',lexstate(202,pfc),t123)) at /var/lib/jenkins/workspace/logicmoo_workspace/lib/swipl/boot/init.pl:646
  [53] $do_load_file_2(library(logicmoo_clif),'/var/lib/jenkins/workspace/logicmoo_workspace/packs_sys/logicmoo_base/prolog/logicmoo_clif.pl',t123,compiled,[if(not_loaded),must_be_module(true)]) at /var/lib/jenkins/workspace/logicmoo_workspace/lib/swipl/boot/init.pl:2592
  [50] $qdo_load_file(library(logicmoo_clif),'/var/lib/jenkins/workspace/logicmoo_workspace/packs_sys/logicmoo_base/prolog/logicmoo_clif.pl',t123,[if(not_loaded),must_be_module(true)]) at /var/lib/jenkins/workspace/logicmoo_workspace/lib/swipl/boot/init.pl:2547
  [48] setup_call_catcher_cleanup(system:with_mutex($load_file,$mt_start_load('/var/lib/jenkins/workspace/logicmoo_workspace/packs_sys/logicmoo_base/prolog/logicmoo_clif.pl',<gt;clause>(0x55c43e42a580),[if(not_loaded),must_be_module(true)])),system: $mt_do_load(<gt;clause>(0x55c43e42a580),library(logicmoo_clif),'/var/lib/jenkins/workspace/logicmoo_workspace/packs_sys/logicmoo_base/prolog/logicmoo_clif.pl',t123,[if(not_loaded),must_be_module(true)]),_1042,system: $mt_end_load(<gt;clause>(0x55c43e42a580))) at /var/lib/jenkins/workspace/logicmoo_workspace/lib/swipl/boot/init.pl:646
  [46] <gt;meta call>
  [45] $sig_atomic(setup_call_cleanup(with_mutex($load_file,$mt_start_load('/var/lib/jenkins/workspace/logicmoo_workspace/packs_sys/logicmoo_base/prolog/logicmoo_clif.pl',<gt;clause>(0x55c43e42a580),[if(not_loaded),must_be_module(true)])),$mt_do_load(<gt;clause>(0x55c43e42a580),library(logicmoo_clif),'/var/lib/jenkins/workspace/logicmoo_workspace/packs_sys/logicmoo_base/prolog/logicmoo_clif.pl',t123,[if(not_loaded),must_be_module(true)]),$mt_end_load(<gt;clause>(0x55c43e42a580)))) <gt;foreign>
  [42] $load_file(library(logicmoo_clif),t123,[if(not_loaded),must_be_module(true)]) at /var/lib/jenkins/workspace/logicmoo_workspace/lib/swipl/boot/init.pl:2355
  [37] clif_dialect:clif_expects_dialect(clif,'/var/lib/jenkins/workspace/logicmoo_workspace/packs_sys/logicmoo_base/t/examples/fol/sanity_atleast_01.pfc.pl',pfc,t123) at /var/lib/jenkins/workspace/logicmoo_workspace/packs_sys/logicmoo_base/prolog/dialect/clif.pl:283
  [36] clif_dialect:clif_expects_dialect(clif) at /var/lib/jenkins/workspace/logicmoo_workspace/packs_sys/logicmoo_base/prolog/dialect/clif.pl:122
  [34] prolog_dialect:attach_dialect(clif) at /var/lib/jenkins/workspace/logicmoo_workspace/lib/swipl/library/dialect.pl:87
  [33] prolog_dialect:expects_dialect(clif) at /var/lib/jenkins/workspace/logicmoo_workspace/lib/swipl/library/dialect.pl:73
  [32] catch(t123:expects_dialect(clif),error(_1486,_1488),system: $exception_in_directive(error(_1502,_1504))) at /var/lib/jenkins/workspace/logicmoo_workspace/lib/swipl/boot/init.pl:546
  [31] $execute_directive_3(expects_dialect(clif)) at /var/lib/jenkins/workspace/logicmoo_workspace/lib/swipl/boot/init.pl:3574
  [26] $load_file('/var/lib/jenkins/workspace/logicmoo_workspace/packs_sys/logicmoo_base/t/examples/fol/sanity_atleast_01.pfc.pl','/var/lib/jenkins/workspace/logicmoo_workspace/packs_sys/logicmoo_base/t/examples/fol/sanity_atleast_01.pfc.pl',_1560,[expand(false),expand(true)]) at /var/lib/jenkins/workspace/logicmoo_workspace/lib/swipl/boot/init.pl:3007
  [25] setup_call_catcher_cleanup(system: $start_consult('/var/lib/jenkins/workspace/logicmoo_workspace/packs_sys/logicmoo_base/t/examples/fol/sanity_atleast_01.pfc.pl',1632225669.0391827),system: $load_file('/var/lib/jenkins/workspace/logicmoo_workspace/packs_sys/logicmoo_base/t/examples/fol/sanity_atleast_01.pfc.pl','/var/lib/jenkins/workspace/logicmoo_workspace/packs_sys/logicmoo_base/t/examples/fol/sanity_atleast_01.pfc.pl',_1638,[expand(false),expand(true)]),_1610,system: $end_consult('/var/lib/jenkins/workspace/logicmoo_workspace/packs_sys/logicmoo_base/t/examples/fol/sanity_atleast_01.pfc.pl',lexstate(202,swi),user)) at /var/lib/jenkins/workspace/logicmoo_workspace/lib/swipl/boot/init.pl:646
  [21] $do_load_file_2('sanity_atleast_01.pfc.pl','/var/lib/jenkins/workspace/logicmoo_workspace/packs_sys/logicmoo_base/t/examples/fol/sanity_atleast_01.pfc.pl',user,compiled,[expand(false),expand(true)]) at /var/lib/jenkins/workspace/logicmoo_workspace/lib/swipl/boot/init.pl:2592
  [18] $qdo_load_file('sanity_atleast_01.pfc.pl','/var/lib/jenkins/workspace/logicmoo_workspace/packs_sys/logicmoo_base/t/examples/fol/sanity_atleast_01.pfc.pl',user,[expand(false),expand(true)]) at /var/lib/jenkins/workspace/logicmoo_workspace/lib/swipl/boot/init.pl:2547
  [16] setup_call_catcher_cleanup(system:with_mutex($load_file,$mt_start_load('/var/lib/jenkins/workspace/logicmoo_workspace/packs_sys/logicmoo_base/t/examples/fol/sanity_atleast_01.pfc.pl',<gt;clause>(0x55c43e42aa80),[expand(false),expand(true)])),system: $mt_do_load(<gt;clause>(0x55c43e42aa80),'sanity_atleast_01.pfc.pl','/var/lib/jenkins/workspace/logicmoo_workspace/packs_sys/logicmoo_base/t/examples/fol/sanity_atleast_01.pfc.pl',user,[expand(false),expand(true)]),_1810,system: $mt_end_load(<gt;clause>(0x55c43e42aa80))) at /var/lib/jenkins/workspace/logicmoo_workspace/lib/swipl/boot/init.pl:646
  [14] <gt;meta call>
  [13] $sig_atomic(setup_call_cleanup(with_mutex($load_file,$mt_start_load('/var/lib/jenkins/workspace/logicmoo_workspace/packs_sys/logicmoo_base/t/examples/fol/sanity_atleast_01.pfc.pl',<gt;clause>(0x55c43e42aa80),[expand(false),expand(true)])),$mt_do_load(<gt;clause>(0x55c43e42aa80),'sanity_atleast_01.pfc.pl','/var/lib/jenkins/workspace/logicmoo_workspace/packs_sys/logicmoo_base/t/examples/fol/sanity_atleast_01.pfc.pl',user,[expand(false),expand(true)]),$mt_end_load(<gt;clause>(0x55c43e42aa80)))) <gt;foreign>
  [10] $load_file('sanity_atleast_01.pfc.pl',user,<gt;garbage_collected>) at /var/lib/jenkins/workspace/logicmoo_workspace/lib/swipl/boot/init.pl:2355

Note: some frames are missing due to last-call optimization.
Re-run your program in debug mode (:- debug.) to get more detail.
ERROR: /var/lib/jenkins/workspace/logicmoo_workspace/packs_sys/logicmoo_base/t/examples/fol/test_header.pl:5:
ERROR:    No permission to redefine module `logicmoo_clif' (Already loaded from /root/.local/share/swi-prolog/pack/logicmoo_base/prolog/logicmoo_clif.pl)
ERROR:    In:
ERROR:      [61] $declare_module(logicmoo_clif,user,user,'/var/lib/jenkins/workspace/logicmoo_workspace/packs_sys/logicmoo_base/prolog/logicmoo_clif.pl',1,false)
ERROR:      [60] $start_module(logicmoo_clif,[],state(true,logicmoo_clif,true,false,'/var/lib/jenkins/workspace/logicmoo_workspace/packs_sys/logicmoo_base/prolog/logicmoo_clif.pl',-),[if(not_loaded),must_be_module(true)]) at /var/lib/jenkins/workspace/logicmoo_workspace/lib/swipl/boot/init.pl:3166
ERROR:      [59] $first_term((:-module(logicmoo_clif,[])),_706,'/var/lib/jenkins/workspace/logicmoo_workspace/packs_sys/logicmoo_base/prolog/logicmoo_clif.pl',state(true,logicmoo_clif,true,false,'/var/lib/jenkins/workspace/logicmoo_workspace/packs_sys/logicmoo_base/prolog/logicmoo_clif.pl',-),[if(not_loaded),must_be_module(true)]) at /var/lib/jenkins/workspace/logicmoo_workspace/lib/swipl/boot/init.pl:3055
ERROR:      [58] $load_file('/var/lib/jenkins/workspace/logicmoo_workspace/packs_sys/logicmoo_base/prolog/logicmoo_clif.pl','/var/lib/jenkins/workspace/logicmoo_workspace/packs_sys/logicmoo_base/prolog/logicmoo_clif.pl',_784,[if(not_loaded),must_be_module(true)]) at /var/lib/jenkins/workspace/logicmoo_workspace/lib/swipl/boot/init.pl:3007
ERROR:      [57] setup_call_catcher_cleanup(system: $start_consult('/var/lib/jenkins/workspace/logicmoo_workspace/packs_sys/logicmoo_base/prolog/logicmoo_clif.pl',1632432905.770371),system: $load_file('/var/lib/jenkins/workspace/logicmoo_workspace/packs_sys/logicmoo_base/prolog/logicmoo_clif.pl','/var/lib/jenkins/workspace/logicmoo_workspace/packs_sys/logicmoo_base/prolog/logicmoo_clif.pl',_862,[if(not_loaded),must_be_module(true)]),_834,system: $end_consult('/var/lib/jenkins/workspace/logicmoo_workspace/packs_sys/logicmoo_base/prolog/logicmoo_clif.pl',lexstate(202,pfc),t123)) at /var/lib/jenkins/workspace/logicmoo_workspace/lib/swipl/boot/init.pl:646
ERROR:      [53] $do_load_file_2(library(logicmoo_clif),'/var/lib/jenkins/workspace/logicmoo_workspace/packs_sys/logicmoo_base/prolog/logicmoo_clif.pl',t123,compiled,[if(not_loaded),must_be_module(true)]) at /var/lib/jenkins/workspace/logicmoo_workspace/lib/swipl/boot/init.pl:2592
ERROR:      [50] $qdo_load_file(library(logicmoo_clif),'/var/lib/jenkins/workspace/logicmoo_workspace/packs_sys/logicmoo_base/prolog/logicmoo_clif.pl',t123,[if(not_loaded),must_be_module(true)]) at /var/lib/jenkins/workspace/logicmoo_workspace/lib/swipl/boot/init.pl:2547
ERROR:      [48] setup_call_catcher_cleanup(system:with_mutex($load_file,$mt_start_load('/var/lib/jenkins/workspace/logicmoo_workspace/packs_sys/logicmoo_base/prolog/logicmoo_clif.pl',<gt;clause>(0x55c43e42a580),[if(not_loaded),must_be_module(true)])),system: $mt_do_load(<gt;clause>(0x55c43e42a580),library(logicmoo_clif),'/var/lib/jenkins/workspace/logicmoo_workspace/packs_sys/logicmoo_base/prolog/logicmoo_clif.pl',t123,[if(not_loaded),must_be_module(true)]),_1042,system: $mt_end_load(<gt;clause>(0x55c43e42a580))) at /var/lib/jenkins/workspace/logicmoo_workspace/lib/swipl/boot/init.pl:646
ERROR:      [46] <gt;meta call>
ERROR:      [45] $sig_atomic(setup_call_cleanup(with_mutex($load_file,$mt_start_load('/var/lib/jenkins/workspace/logicmoo_workspace/packs_sys/logicmoo_base/prolog/logicmoo_clif.pl',<gt;clause>(0x55c43e42a580),[if(not_loaded),must_be_module(true)])),$mt_do_load(<gt;clause>(0x55c43e42a580),library(logicmoo_clif),'/var/lib/jenkins/workspace/logicmoo_workspace/packs_sys/logicmoo_base/prolog/logicmoo_clif.pl',t123,[if(not_loaded),must_be_module(true)]),$mt_end_load(<gt;clause>(0x55c43e42a580)))) <gt;foreign>
ERROR:      [42] $load_file(library(logicmoo_clif),t123,[if(not_loaded),must_be_module(true)]) at /var/lib/jenkins/workspace/logicmoo_workspace/lib/swipl/boot/init.pl:2355
ERROR:      [37] clif_dialect:clif_expects_dialect(clif,'/var/lib/jenkins/workspace/logicmoo_workspace/packs_sys/logicmoo_base/t/examples/fol/sanity_atleast_01.pfc.pl',pfc,t123) at /var/lib/jenkins/workspace/logicmoo_workspace/packs_sys/logicmoo_base/prolog/dialect/clif.pl:283
ERROR:      [36] clif_dialect:clif_expects_dialect(clif) at /var/lib/jenkins/workspace/logicmoo_workspace/packs_sys/logicmoo_base/prolog/dialect/clif.pl:122
ERROR:      [34] prolog_dialect:attach_dialect(clif) at /var/lib/jenkins/workspace/logicmoo_workspace/lib/swipl/library/dialect.pl:87
ERROR:      [33] prolog_dialect:expects_dialect(clif) at /var/lib/jenkins/workspace/logicmoo_workspace/lib/swipl/library/dialect.pl:73
ERROR:      [32] catch(t123:expects_dialect(clif),error(_1486,_1488),system: $exception_in_directive(error(_1502,_1504))) at /var/lib/jenkins/workspace/logicmoo_workspace/lib/swipl/boot/init.pl:546
ERROR:      [31] $execute_directive_3(expects_dialect(clif)) at /var/lib/jenkins/workspace/logicmoo_workspace/lib/swipl/boot/init.pl:3574
ERROR:      [26] $load_file('/var/lib/jenkins/workspace/logicmoo_workspace/packs_sys/logicmoo_base/t/examples/fol/sanity_atleast_01.pfc.pl','/var/lib/jenkins/workspace/logicmoo_workspace/packs_sys/logicmoo_base/t/examples/fol/sanity_atleast_01.pfc.pl',_1560,[expand(false),expand(true)]) at /var/lib/jenkins/workspace/logicmoo_workspace/lib/swipl/boot/init.pl:3007
ERROR:      [25] setup_call_catcher_cleanup(system: $start_consult('/var/lib/jenkins/workspace/logicmoo_workspace/packs_sys/logicmoo_base/t/examples/fol/sanity_atleast_01.pfc.pl',1632225669.0391827),system: $load_file('/var/lib/jenkins/workspace/logicmoo_workspace/packs_sys/logicmoo_base/t/examples/fol/sanity_atleast_01.pfc.pl','/var/lib/jenkins/workspace/logicmoo_workspace/packs_sys/logicmoo_base/t/examples/fol/sanity_atleast_01.pfc.pl',_1638,[expand(false),expand(true)]),_1610,system: $end_consult('/var/lib/jenkins/workspace/logicmoo_workspace/packs_sys/logicmoo_base/t/examples/fol/sanity_atleast_01.pfc.pl',lexstate(202,swi),user)) at /var/lib/jenkins/workspace/logicmoo_workspace/lib/swipl/boot/init.pl:646
ERROR:      [21] $do_load_file_2('sanity_atleast_01.pfc.pl','/var/lib/jenkins/workspace/logicmoo_workspace/packs_sys/logicmoo_base/t/examples/fol/sanity_atleast_01.pfc.pl',user,compiled,[expand(false),expand(true)]) at /var/lib/jenkins/workspace/logicmoo_workspace/lib/swipl/boot/init.pl:2592
ERROR:      [18] $qdo_load_file('sanity_atleast_01.pfc.pl','/var/lib/jenkins/workspace/logicmoo_workspace/packs_sys/logicmoo_base/t/examples/fol/sanity_atleast_01.pfc.pl',user,[expand(false),expand(true)]) at /var/lib/jenkins/workspace/logicmoo_workspace/lib/swipl/boot/init.pl:2547
ERROR:      [16] setup_call_catcher_cleanup(system:with_mutex($load_file,$mt_start_load('/var/lib/jenkins/workspace/logicmoo_workspace/packs_sys/logicmoo_base/t/examples/fol/sanity_atleast_01.pfc.pl',<gt;clause>(0x55c43e42aa80),[expand(false),expand(true)])),system: $mt_do_load(<gt;clause>(0x55c43e42aa80),'sanity_atleast_01.pfc.pl','/var/lib/jenkins/workspace/logicmoo_workspace/packs_sys/logicmoo_base/t/examples/fol/sanity_atleast_01.pfc.pl',user,[expand(false),expand(true)]),_1810,system: $mt_end_load(<gt;clause>(0x55c43e42aa80))) at /var/lib/jenkins/workspace/logicmoo_workspace/lib/swipl/boot/init.pl:646
ERROR:      [14] <gt;meta call>
ERROR:      [13] $sig_atomic(setup_call_cleanup(with_mutex($load_file,$mt_start_load('/var/lib/jenkins/workspace/logicmoo_workspace/packs_sys/logicmoo_base/t/examples/fol/sanity_atleast_01.pfc.pl',<gt;clause>(0x55c43e42aa80),[expand(false),expand(true)])),$mt_do_load(<gt;clause>(0x55c43e42aa80),'sanity_atleast_01.pfc.pl','/var/lib/jenkins/workspace/logicmoo_workspace/packs_sys/logicmoo_base/t/examples/fol/sanity_atleast_01.pfc.pl',user,[expand(false),expand(true)]),$mt_end_load(<gt;clause>(0x55c43e42aa80)))) <gt;foreign>
ERROR:      [10] $load_file('sanity_atleast_01.pfc.pl',user,<gt;garbage_collected>) at /var/lib/jenkins/workspace/logicmoo_workspace/lib/swipl/boot/init.pl:2355
ERROR:   
ERROR:    Note: some frames are missing due to last-call optimization.
ERROR:    Re-run your program in debug mode (:- debug.) to get more detail.
%~ /var/lib/jenkins/workspace/logicmoo_workspace/packs_sys/logicmoo_base/t/examples/fol/test_header.pl:5
%~ message_hook(
%~    goal_failed(directive,t123:expects_dialect(clif)),
%~    warning,
%~    [ 'Goal (~w) failed: ~p' - [ directive,
%~                                 t123 : expects_dialect(clif)]])
%~ source_location('/var/lib/jenkins/workspace/logicmoo_workspace/packs_sys/logicmoo_base/t/examples/fol/test_header.pl',5)
Goal (directive) failed: t123:expects_dialect(clif)
Warning: /var/lib/jenkins/workspace/logicmoo_workspace/packs_sys/logicmoo_base/t/examples/fol/test_header.pl:5:
Warning:    Goal (directive) failed: t123:expects_dialect(clif)

:- module(t123).  
/*~
~*/
  
:- '$set_source_module'(t123).

% :- process_this_script.

/*~
~*/

% :- process_this_script.

:- statistics.


/*~
% Started at Mon Sep 27 03:40:07 2021
% 1.563 seconds cpu time for 6,677,837 inferences
% 942,532 atoms, 32,373 functors, 31,583 predicates, 751 modules, 15,991,424 VM-codes
%
%                     Limit   Allocated      In use
% Local  stack:           -      116 Kb    3,920  b
% Global stack:           -      512 Kb      149 Kb
% Trail  stack:           -      130 Kb      488  b
%        Total:    1,024 Mb      758 Kb      153 Kb
%
% 27 garbage collections gained 10,397,088 bytes in 0.005 seconds.
% 14 atom garbage collections gained 4,330 atoms in 0.191 seconds.
% 18 clause garbage collections gained 3,833 clauses in 0.001 seconds.
% Stack shifts: 2 local, 3 global, 2 trail in 0.001 seconds
% 3 threads, 0 finished threads used 0.000 seconds
~*/



subtest([subtest_assert(tAnimal(joe)),
        mpred_test(isa(_,tHeart))]).

/*~
%~ make_dynamic_here( t123,
%~   '$nt'(
%~      subtest( [ subtest_assert( tAnimal(joe)),
%~                 mpred_test( tHeart(Heart))]), Subtest,Nt))
~*/

subtest([subtest_assert(tAnimal(joe)),
        mpred_test(hasOrgan(joe,_))]).

/*~
~*/

subtest([subtest_assert(tHeart(_)),
        mpred_test(~hasOrgan(jack,_))]).


/*~
~*/



:- add_test(t121, (all([[Human,tAnimal]],atleast(1,[[Heart,tHeart]],hasOrgan(Human,Heart))))).
/*~

%~ '%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%'.

%~ test_boxlog(t121)

%~ '%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%'.

%~ correct_special_quantifiers :- all( Human,
%~                                  ( isa(Human,tAnimal) =>
%~                                    exists(Heart,hasOrgan(Human,Heart)&isa(Heart,tHeart)))).
%~ %~ correct_special_quantifiers:-all(Human,isa(Human,tAnimal)=>exists(Heart,hasOrgan(Human,Heart)&isa(Heart,tHeart)))
%~ /var/lib/jenkins/workspace/logicmoo_workspace/packs_sys/logicmoo_base/t/examples/fol/sanity_atleast_01.pfc.pl:26
%~ kifi = all(
%~           [ [Human,tAnimal]],
%~           atleast(1,[[Heart,tHeart]],hasOrgan(Human,Heart))).
%~ kifm = all( Human,
%~          nesc( ( isa(Human,tAnimal) =>
%~                  exists(Heart,hasOrgan(Human,Heart)&isa(Heart,tHeart))))).
%~ kif_to_boxlog_attvars2 = forall('$VAR'('Human'),necessary(=>(isa('$VAR'('Human'),tAnimal),exists('$VAR'('Heart'),and(hasOrgan('$VAR'('Human'),'$VAR'('Heart')),isa('$VAR'('Heart'),tHeart))))))
%~ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%~  Whenever:
%~    " ?Human hasOrgan ?Heart " is possibly false  and
%~    " ?Heart isa tHeart " is necessarily true
%~  It's Proof that:
%~    " ?Human isa tAnimal " is possibly false
%~
%~ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

( poss(~hasOrgan(Human,Heart))&nesc(isa(Heart,tHeart)) ==>
  poss( ~( isa(Human,tAnimal)))).

%  AND
%~ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%~  Whenever:
%~    (" ?Human hasOrgan ?Heart " is possibly false  and
%~    " ?Human isa tAnimal " is necessarily true ) and
%~     by default ?Heart nesc(hasOrgan(Human,Heart))&nesc(isa(Heart,tHeart))
%~  It's Proof that:
%~    " ?Heart isa tHeart " is possibly false
%~
%~ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

( ( poss( ~( hasOrgan(Human,Heart)))  &
    nesc( isa(Human,tAnimal)) &
    '$existential'( Heart,
      1,
      nesc(hasOrgan(Human,Heart))&nesc(isa(Heart,tHeart)))) ==>
  poss( ~( isa(Heart,tHeart)))).

%  AND
%~ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%~  Whenever:
%~     by default ?Heart nesc(hasOrgan(Human,Heart))&nesc(isa(Heart,tHeart))  and
%~    (" ?Human isa tAnimal " is necessarily true  and
%~    " ?Heart isa tHeart " is necessarily true )
%~  It's Proof that:
%~    " ?Human hasOrgan ?Heart " is necessarily true
%~
%~ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

( ( '$existential'(Heart,1,nesc(hasOrgan(Human,Heart))&nesc(isa(Heart,tHeart)))  &
    nesc( isa(Human,tAnimal)) &
    nesc( isa(Heart,tHeart))) ==>
  nesc( hasOrgan(Human,Heart))).

%  AND
%~ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%~  Whenever:
%~    " ?Human hasOrgan ?Heart " is necessarily true  and
%~    " ?Heart isa tHeart " is possibly false
%~  It's Proof that:
%~    " ?Human isa tAnimal " is possibly false
%~
%~ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

( nesc(hasOrgan(Human,Heart))&poss(~isa(Heart,tHeart)) ==>
  poss( ~( isa(Human,tAnimal)))).

%  AND
%~ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%~  Whenever:
%~     by default ?Heart nesc(hasOrgan(Human,Heart))&nesc(isa(Heart,tHeart))  and
%~    (" ?Human isa tAnimal " is necessarily true  and
%~    " ?Heart isa tHeart " is possibly false )
%~  It's Proof that:
%~    " ?Human hasOrgan ?Heart " is possibly false
%~
%~ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

( ( '$existential'(Heart,1,nesc(hasOrgan(Human,Heart))&nesc(isa(Heart,tHeart)))  &
    nesc( isa(Human,tAnimal)) &
    poss( ~( isa(Heart,tHeart)))) ==>
  poss( ~( hasOrgan(Human,Heart)))).

%  AND
%~ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%~  Whenever:
%~    (" ?Human hasOrgan ?Heart " is necessarily true  and
%~    " ?Human isa tAnimal " is necessarily true ) and
%~     by default ?Heart nesc(hasOrgan(Human,Heart))&nesc(isa(Heart,tHeart))
%~  It's Proof that:
%~    " ?Heart isa tHeart " is necessarily true
%~
%~ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

( ( nesc( hasOrgan(Human,Heart))  &
    nesc( isa(Human,tAnimal)) &
    '$existential'( Heart,
      1,
      nesc(hasOrgan(Human,Heart))&nesc(isa(Heart,tHeart)))) ==>
  nesc( isa(Heart,tHeart))).


%~ '%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%'.

%~ completed_test_boxlog(t121)

%~ '%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%'.

~*/

:- add_test(t121a, (atleast(1,[[Heart,tHeart]],all([[Human,tAnimal]],hasOrgan(Human,Heart))))).

/*~

%~ '%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%'.

%~ test_boxlog(t121a)

%~ '%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%'.

%~ correct_special_quantifiers :- exists( Heart,
%~                                  ( all(Human,isa(Human,tAnimal)=>hasOrgan(Human,Heart)) &
%~                                    isa(Heart,tHeart))).
%~ %~ correct_special_quantifiers:-exists(Heart,all(Human,isa(Human,tAnimal)=>hasOrgan(Human,Heart))&isa(Heart,tHeart))
%~ kifi = atleast( 1,
%~          [ [Heart,tHeart]],
%~          all([[Human,tAnimal]],hasOrgan(Human,Heart))).
%~ kifm = exists( Heart,
%~          nesc( ( all(Human,isa(Human,tAnimal)=>hasOrgan(Human,Heart)) &
%~                  isa(Heart,tHeart)))).
%~ kif_to_boxlog_attvars2 = exists('$VAR'('Heart'),necessary(and(forall('$VAR'('Human'),=>(isa('$VAR'('Human'),tAnimal),hasOrgan('$VAR'('Human'),'$VAR'('Heart')))),isa('$VAR'('Heart'),tHeart))))
%~ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%~  Whenever:
%~    (" ?Human hasOrgan ?Heart " is possibly false  and
%~    " ?Human isa tAnimal " is necessarily true ) and
%~     by default ?Heart all(Human,nesc(isa(Human,tAnimal))=>nesc(hasOrgan(Human,Heart)))&nesc(isa(Heart,tHeart))
%~  It's Proof that:
%~    " ?Heart isa tHeart " is possibly false
%~
%~ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

( ( poss( ~( hasOrgan(Human,Heart)))  &
    nesc( isa(Human,tAnimal)) &
    '$existential'( Heart,
      1,
      ( all(Human,nesc(isa(Human,tAnimal))=>nesc(hasOrgan(Human,Heart))) &
        nesc( isa(Heart,tHeart))))) ==>
  poss( ~( isa(Heart,tHeart)))).

%  AND
%~ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%~  Whenever:
%~    " ?Human hasOrgan ?Heart " is possibly false  and
%~    " ?Heart isa tHeart " is necessarily true
%~  It's Proof that:
%~    " ?Human isa tAnimal " is possibly false
%~
%~ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

( poss(~hasOrgan(Human,Heart))&nesc(isa(Heart,tHeart)) ==>
  poss( ~( isa(Human,tAnimal)))).

%  AND
%~ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%~  Whenever:
%~     by default ?Heart all(Human,nesc(isa(Human,tAnimal))=>nesc(hasOrgan(Human,Heart)))&nesc(isa(Heart,tHeart))  and
%~    (" ?Heart isa tHeart " is necessarily true  and
%~    " ?Human isa tAnimal " is necessarily true )
%~  It's Proof that:
%~    " ?Human hasOrgan ?Heart " is necessarily true
%~
%~ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

( ( '$existential'( Heart,
      1,
      ( all(Human,nesc(isa(Human,tAnimal))=>nesc(hasOrgan(Human,Heart))) &
        nesc( isa(Heart,tHeart))))  &
    nesc( isa(Heart,tHeart)) &
    nesc( isa(Human,tAnimal))) ==>
  nesc( hasOrgan(Human,Heart))).

%  AND
%~ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%~  Whenever:
%~    ((" ?Human hasOrgan ?Heart " is possibly false  and
%~    " ?Human isa tAnimal " is possibly false )is possible ) and
%~     by default ?Heart all(Human,nesc(isa(Human,tAnimal))=>nesc(hasOrgan(Human,Heart)))&nesc(isa(Heart,tHeart))
%~  It's Proof that:
%~    " ?Heart isa tHeart " is necessarily true
%~
%~ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

( ( poss( poss(~hasOrgan(Human,Heart))&poss(~isa(Human,tAnimal))) &
    '$existential'( Heart,
      1,
      ( all(Human,nesc(isa(Human,tAnimal))=>nesc(hasOrgan(Human,Heart))) &
        nesc( isa(Heart,tHeart))))) ==>
  nesc( isa(Heart,tHeart))).

%  AND
%~ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%~  Whenever:
%~    ( by default ?Heart all(Human,nesc(isa(Human,tAnimal))=>nesc(hasOrgan(Human,Heart)))&nesc(isa(Heart,tHeart))  and
%~    " ?Heart isa tHeart " is possibly false ) and
%~    " ?Human isa tAnimal " is possibly false
%~  It's Proof that:
%~    " ?Human hasOrgan ?Heart " is necessarily true
%~
%~ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

( ( '$existential'( Heart,
      1,
      ( all(Human,nesc(isa(Human,tAnimal))=>nesc(hasOrgan(Human,Heart))) &
        nesc( isa(Heart,tHeart))))  &
    poss( ~( isa(Heart,tHeart))) &
    poss( ~( isa(Human,tAnimal)))) ==>
  nesc( hasOrgan(Human,Heart))).

%  AND
%~ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%~  Whenever:
%~    " ?Human hasOrgan ?Heart " is possibly false  and
%~    ( by default ?Heart all(Human,nesc(isa(Human,tAnimal))=>nesc(hasOrgan(Human,Heart)))&nesc(isa(Heart,tHeart))  and
%~    " ?Heart isa tHeart " is possibly false )
%~  It's Proof that:
%~    " ?Human isa tAnimal " is necessarily true
%~
%~ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

( ( poss( ~( hasOrgan(Human,Heart)))  &
    '$existential'( Heart,
      1,
      ( all(Human,nesc(isa(Human,tAnimal))=>nesc(hasOrgan(Human,Heart))) &
        nesc( isa(Heart,tHeart)))) &
    poss( ~( isa(Heart,tHeart)))) ==>
  nesc( isa(Human,tAnimal))).

%  AND
%~ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%~  Whenever:
%~    ((" ?Human hasOrgan ?Heart " is necessarily true  and
%~    " ?Human isa tAnimal " is necessarily true )is possible ) and
%~     by default ?Heart all(Human,nesc(isa(Human,tAnimal))=>nesc(hasOrgan(Human,Heart)))&nesc(isa(Heart,tHeart))
%~  It's Proof that:
%~    " ?Heart isa tHeart " is necessarily true
%~
%~ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

( ( poss( nesc(hasOrgan(Human,Heart))&nesc(isa(Human,tAnimal))) &
    '$existential'( Heart,
      1,
      ( all(Human,nesc(isa(Human,tAnimal))=>nesc(hasOrgan(Human,Heart))) &
        nesc( isa(Heart,tHeart))))) ==>
  nesc( isa(Heart,tHeart))).

%  AND
%~ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%~  Whenever:
%~    ( by default ?Heart all(Human,nesc(isa(Human,tAnimal))=>nesc(hasOrgan(Human,Heart)))&nesc(isa(Heart,tHeart))  and
%~    " ?Heart isa tHeart " is possibly false ) and
%~    " ?Human isa tAnimal " is possible
%~  It's Proof that:
%~    " ?Human hasOrgan ?Heart " is possibly false
%~
%~ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

( ( '$existential'( Heart,
      1,
      ( all(Human,nesc(isa(Human,tAnimal))=>nesc(hasOrgan(Human,Heart))) &
        nesc( isa(Heart,tHeart))))  &
    poss( ~( isa(Heart,tHeart))) &
    poss( isa(Human,tAnimal))) ==>
  poss( ~( hasOrgan(Human,Heart)))).

%  AND
%~ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%~  Whenever:
%~    " ?Human hasOrgan ?Heart " is possible  and
%~    ( by default ?Heart all(Human,nesc(isa(Human,tAnimal))=>nesc(hasOrgan(Human,Heart)))&nesc(isa(Heart,tHeart))  and
%~    " ?Heart isa tHeart " is possibly false )
%~  It's Proof that:
%~    " ?Human isa tAnimal " is possibly false
%~
%~ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

( ( poss( hasOrgan(Human,Heart))  &
    '$existential'( Heart,
      1,
      ( all(Human,nesc(isa(Human,tAnimal))=>nesc(hasOrgan(Human,Heart))) &
        nesc( isa(Heart,tHeart)))) &
    poss( ~( isa(Heart,tHeart)))) ==>
  poss( ~( isa(Human,tAnimal)))).


%~ '%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%'.

%~ completed_test_boxlog(t121a)

%~ /var/lib/jenkins/workspace/logicmoo_workspace/packs_sys/logicmoo_base/t/examples/fol/sanity_atleast_01.pfc.pl:27
%~ '%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%'.

~*/

:- add_test(t122, 
  (all(Human, 
    isa(Human,tAnimal)
      => atleast(1,Heart,(isa(Heart,tHeart) & hasOrgan(Human,Heart)))))).

/*~

%~ '%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%'.

%~ test_boxlog(t122)

%~ '%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%'.

%~ correct_special_quantifiers :- all( Human,
%~                                  ( isa(Human,tAnimal) =>
%~                                    exists(Heart,isa(Heart,tHeart)&hasOrgan(Human,Heart)))).
%~ %~ correct_special_quantifiers:-all(Human,isa(Human,tAnimal)=>exists(Heart,isa(Heart,tHeart)&hasOrgan(Human,Heart)))
%~ kifi = all( Human,
%~          ( isa(Human,tAnimal) =>
%~            atleast(1,Heart,isa(Heart,tHeart)&hasOrgan(Human,Heart)))).
%~ kifm = all( Human,
%~          nesc( ( isa(Human,tAnimal) =>
%~                  exists(Heart,isa(Heart,tHeart)&hasOrgan(Human,Heart))))).
%~ kif_to_boxlog_attvars2 = forall('$VAR'('Human'),necessary(=>(isa('$VAR'('Human'),tAnimal),exists('$VAR'('Heart'),and(isa('$VAR'('Heart'),tHeart),hasOrgan('$VAR'('Human'),'$VAR'('Heart')))))))
%~ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%~  Whenever:
%~    " ?Human hasOrgan ?Heart " is necessarily true  and
%~    " ?Heart isa tHeart " is possibly false
%~  It's Proof that:
%~    " ?Human isa tAnimal " is possibly false
%~
%~ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

( nesc(hasOrgan(Human,Heart))&poss(~isa(Heart,tHeart)) ==>
  poss( ~( isa(Human,tAnimal)))).

%  AND
%~ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%~  Whenever:
%~     by default ?Heart nesc(isa(Heart,tHeart))&nesc(hasOrgan(Human,Heart))  and
%~    (" ?Human isa tAnimal " is necessarily true  and
%~    " ?Heart isa tHeart " is possibly false )
%~  It's Proof that:
%~    " ?Human hasOrgan ?Heart " is possibly false
%~
%~ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

( ( '$existential'(Heart,1,nesc(isa(Heart,tHeart))&nesc(hasOrgan(Human,Heart)))  &
    nesc( isa(Human,tAnimal)) &
    poss( ~( isa(Heart,tHeart)))) ==>
  poss( ~( hasOrgan(Human,Heart)))).

%  AND
%~ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%~  Whenever:
%~    (" ?Human hasOrgan ?Heart " is necessarily true  and
%~    " ?Human isa tAnimal " is necessarily true ) and
%~     by default ?Heart nesc(isa(Heart,tHeart))&nesc(hasOrgan(Human,Heart))
%~  It's Proof that:
%~    " ?Heart isa tHeart " is necessarily true
%~
%~ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

( ( nesc( hasOrgan(Human,Heart))  &
    nesc( isa(Human,tAnimal)) &
    '$existential'( Heart,
      1,
      nesc(isa(Heart,tHeart))&nesc(hasOrgan(Human,Heart)))) ==>
  nesc( isa(Heart,tHeart))).

%  AND
%~ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%~  Whenever:
%~    " ?Human hasOrgan ?Heart " is possibly false  and
%~    " ?Heart isa tHeart " is necessarily true
%~  It's Proof that:
%~    " ?Human isa tAnimal " is possibly false
%~
%~ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

( poss(~hasOrgan(Human,Heart))&nesc(isa(Heart,tHeart)) ==>
  poss( ~( isa(Human,tAnimal)))).

%  AND
%~ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%~  Whenever:
%~    (" ?Human hasOrgan ?Heart " is possibly false  and
%~    " ?Human isa tAnimal " is necessarily true ) and
%~     by default ?Heart nesc(isa(Heart,tHeart))&nesc(hasOrgan(Human,Heart))
%~  It's Proof that:
%~    " ?Heart isa tHeart " is possibly false
%~
%~ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

( ( poss( ~( hasOrgan(Human,Heart)))  &
    nesc( isa(Human,tAnimal)) &
    '$existential'( Heart,
      1,
      nesc(isa(Heart,tHeart))&nesc(hasOrgan(Human,Heart)))) ==>
  poss( ~( isa(Heart,tHeart)))).

%  AND
%~ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%~  Whenever:
%~     by default ?Heart nesc(isa(Heart,tHeart))&nesc(hasOrgan(Human,Heart))  and
%~    (" ?Human isa tAnimal " is necessarily true  and
%~    " ?Heart isa tHeart " is necessarily true )
%~  It's Proof that:
%~    " ?Human hasOrgan ?Heart " is necessarily true
%~
%~ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

( ( '$existential'(Heart,1,nesc(isa(Heart,tHeart))&nesc(hasOrgan(Human,Heart)))  &
    nesc( isa(Human,tAnimal)) &
    nesc( isa(Heart,tHeart))) ==>
  nesc( hasOrgan(Human,Heart))).


%~ /var/lib/jenkins/workspace/logicmoo_workspace/packs_sys/logicmoo_base/t/examples/fol/sanity_atleast_01.pfc.pl:32
%~ '%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%'.

%~ completed_test_boxlog(t122)

%~ '%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%'.

~*/

:- add_test(t122a,
 (atleast(1,Heart,
  (all(Human,
    isa(Human,tAnimal)
      => (isa(Heart,tHeart) & hasOrgan(Human,Heart))))))).

/*~

%~ /var/lib/jenkins/workspace/logicmoo_workspace/packs_sys/logicmoo_base/t/examples/fol/sanity_atleast_01.pfc.pl:38
%~ '%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%'.

%~ test_boxlog(t122a)

%~ '%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%'.

%~ correct_special_quantifiers :- exists( Heart,
%~                                  all( Human,
%~                                    isa(Human,tAnimal)=>(isa(Heart,tHeart)&hasOrgan(Human,Heart)))).
%~ %~ correct_special_quantifiers:-exists(Heart,all(Human,isa(Human,tAnimal)=>(isa(Heart,tHeart)&hasOrgan(Human,Heart))))
%~ kifi = atleast( 1,
%~          Heart,
%~          all( Human,
%~            isa(Human,tAnimal)=>(isa(Heart,tHeart)&hasOrgan(Human,Heart)))).
%~ kifm = exists( Heart,
%~          all( Human,
%~            nesc( isa(Human,tAnimal)=>(isa(Heart,tHeart)&hasOrgan(Human,Heart))))).
%~ kif_to_boxlog_attvars2 = exists('$VAR'('Heart'),forall('$VAR'('Human'),necessary(=>(isa('$VAR'('Human'),tAnimal),and(isa('$VAR'('Heart'),tHeart),hasOrgan('$VAR'('Human'),'$VAR'('Heart')))))))
%~ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%~  Whenever:
%~    " ?Human hasOrgan ?Heart " is necessarily true  and
%~    " ?Heart isa tHeart " is possibly false
%~  It's Proof that:
%~    " ?Human isa tAnimal " is possibly false
%~
%~ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

( nesc(hasOrgan(Human,Heart))&poss(~isa(Heart,tHeart)) ==>
  poss( ~( isa(Human,tAnimal)))).

%  AND
%~ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%~  Whenever:
%~     by default ?Heart all(Human,nesc(isa(Human,tAnimal))=>(nesc(isa(Heart,tHeart))&nesc(hasOrgan(Human,Heart))))  and
%~    (" ?Human isa tAnimal " is necessarily true  and
%~    " ?Heart isa tHeart " is possibly false )
%~  It's Proof that:
%~    " ?Human hasOrgan ?Heart " is possibly false
%~
%~ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

( ( '$existential'( Heart,
      1,
      all( Human,
        ( nesc( isa(Human,tAnimal)) =>
          nesc(isa(Heart,tHeart))&nesc(hasOrgan(Human,Heart)))))  &
    nesc( isa(Human,tAnimal)) &
    poss( ~( isa(Heart,tHeart)))) ==>
  poss( ~( hasOrgan(Human,Heart)))).

%  AND
%~ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%~  Whenever:
%~    (" ?Human hasOrgan ?Heart " is necessarily true  and
%~    " ?Human isa tAnimal " is necessarily true ) and
%~     by default ?Heart all(Human,nesc(isa(Human,tAnimal))=>(nesc(isa(Heart,tHeart))&nesc(hasOrgan(Human,Heart))))
%~  It's Proof that:
%~    " ?Heart isa tHeart " is necessarily true
%~
%~ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

( ( nesc( hasOrgan(Human,Heart))  &
    nesc( isa(Human,tAnimal)) &
    '$existential'( Heart,
      1,
      all( Human,
        ( nesc( isa(Human,tAnimal)) =>
          nesc(isa(Heart,tHeart))&nesc(hasOrgan(Human,Heart)))))) ==>
  nesc( isa(Heart,tHeart))).

%  AND
%~ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%~  Whenever:
%~    " ?Human hasOrgan ?Heart " is possibly false  and
%~    " ?Heart isa tHeart " is necessarily true
%~  It's Proof that:
%~    " ?Human isa tAnimal " is possibly false
%~
%~ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

( poss(~hasOrgan(Human,Heart))&nesc(isa(Heart,tHeart)) ==>
  poss( ~( isa(Human,tAnimal)))).

%  AND
%~ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%~  Whenever:
%~    (" ?Human hasOrgan ?Heart " is possibly false  and
%~    " ?Human isa tAnimal " is necessarily true ) and
%~     by default ?Heart all(Human,nesc(isa(Human,tAnimal))=>(nesc(isa(Heart,tHeart))&nesc(hasOrgan(Human,Heart))))
%~  It's Proof that:
%~    " ?Heart isa tHeart " is possibly false
%~
%~ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

( ( poss( ~( hasOrgan(Human,Heart)))  &
    nesc( isa(Human,tAnimal)) &
    '$existential'( Heart,
      1,
      all( Human,
        ( nesc( isa(Human,tAnimal)) =>
          nesc(isa(Heart,tHeart))&nesc(hasOrgan(Human,Heart)))))) ==>
  poss( ~( isa(Heart,tHeart)))).

%  AND
%~ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%~  Whenever:
%~     by default ?Heart all(Human,nesc(isa(Human,tAnimal))=>(nesc(isa(Heart,tHeart))&nesc(hasOrgan(Human,Heart))))  and
%~    (" ?Human isa tAnimal " is necessarily true  and
%~    " ?Heart isa tHeart " is necessarily true )
%~  It's Proof that:
%~    " ?Human hasOrgan ?Heart " is necessarily true
%~
%~ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

( ( '$existential'( Heart,
      1,
      all( Human,
        ( nesc( isa(Human,tAnimal)) =>
          nesc(isa(Heart,tHeart))&nesc(hasOrgan(Human,Heart)))))  &
    nesc( isa(Human,tAnimal)) &
    nesc( isa(Heart,tHeart))) ==>
  nesc( hasOrgan(Human,Heart))).


%~ '%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%'.

%~ completed_test_boxlog(t122a)

%~ '%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%'.

~*/


:- add_test(t123,
 (all(Human,
   atleast(1,Heart,
    isa(Human,tAnimal)
      => (isa(Heart,tHeart) & hasOrgan(Human,Heart)))))).

/*~

%~ '%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%'.

%~ test_boxlog(t123)

%~ '%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%'.

%~ correct_special_quantifiers :- all( Human,
%~                                  exists( Heart,
%~                                    isa(Human,tAnimal)=>(isa(Heart,tHeart)&hasOrgan(Human,Heart)))).
%~ %~ correct_special_quantifiers:-all(Human,exists(Heart,isa(Human,tAnimal)=>(isa(Heart,tHeart)&hasOrgan(Human,Heart))))
%~ /var/lib/jenkins/workspace/logicmoo_workspace/packs_sys/logicmoo_base/t/examples/fol/sanity_atleast_01.pfc.pl:45
%~ kifi = all( Human,
%~          atleast( 1,
%~            Heart,
%~            isa(Human,tAnimal)=>(isa(Heart,tHeart)&hasOrgan(Human,Heart)))).
%~ kifm = all( Human,
%~          exists( Heart,
%~            nesc( isa(Human,tAnimal)=>(isa(Heart,tHeart)&hasOrgan(Human,Heart))))).
%~ kif_to_boxlog_attvars2 = forall('$VAR'('Human'),exists('$VAR'('Heart'),necessary(=>(isa('$VAR'('Human'),tAnimal),and(isa('$VAR'('Heart'),tHeart),hasOrgan('$VAR'('Human'),'$VAR'('Heart')))))))
%~ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%~  Whenever:
%~    " ?Human hasOrgan ?Heart " is necessarily true  and
%~    " ?Heart isa tHeart " is possibly false
%~  It's Proof that:
%~    " ?Human isa tAnimal " is possibly false
%~
%~ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

( nesc(hasOrgan(Human,Heart))&poss(~isa(Heart,tHeart)) ==>
  poss( ~( isa(Human,tAnimal)))).

%  AND
%~ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%~  Whenever:
%~     by default ?Heart nesc(isa(Human,tAnimal))=>(nesc(isa(Heart,tHeart))&nesc(hasOrgan(Human,Heart)))  and
%~    (" ?Human isa tAnimal " is necessarily true  and
%~    " ?Heart isa tHeart " is possibly false )
%~  It's Proof that:
%~    " ?Human hasOrgan ?Heart " is possibly false
%~
%~ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

( ( '$existential'( Heart,
      1,
      ( nesc( isa(Human,tAnimal)) =>
        nesc(isa(Heart,tHeart))&nesc(hasOrgan(Human,Heart))))  &
    nesc( isa(Human,tAnimal)) &
    poss( ~( isa(Heart,tHeart)))) ==>
  poss( ~( hasOrgan(Human,Heart)))).

%  AND
%~ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%~  Whenever:
%~    (" ?Human hasOrgan ?Heart " is necessarily true  and
%~    " ?Human isa tAnimal " is necessarily true ) and
%~     by default ?Heart nesc(isa(Human,tAnimal))=>(nesc(isa(Heart,tHeart))&nesc(hasOrgan(Human,Heart)))
%~  It's Proof that:
%~    " ?Heart isa tHeart " is necessarily true
%~
%~ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

( ( nesc( hasOrgan(Human,Heart))  &
    nesc( isa(Human,tAnimal)) &
    '$existential'( Heart,
      1,
      ( nesc( isa(Human,tAnimal)) =>
        nesc(isa(Heart,tHeart))&nesc(hasOrgan(Human,Heart))))) ==>
  nesc( isa(Heart,tHeart))).

%  AND
%~ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%~  Whenever:
%~    " ?Human hasOrgan ?Heart " is possibly false  and
%~    " ?Heart isa tHeart " is necessarily true
%~  It's Proof that:
%~    " ?Human isa tAnimal " is possibly false
%~
%~ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

( poss(~hasOrgan(Human,Heart))&nesc(isa(Heart,tHeart)) ==>
  poss( ~( isa(Human,tAnimal)))).

%  AND
%~ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%~  Whenever:
%~    (" ?Human hasOrgan ?Heart " is possibly false  and
%~    " ?Human isa tAnimal " is necessarily true ) and
%~     by default ?Heart nesc(isa(Human,tAnimal))=>(nesc(isa(Heart,tHeart))&nesc(hasOrgan(Human,Heart)))
%~  It's Proof that:
%~    " ?Heart isa tHeart " is possibly false
%~
%~ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

( ( poss( ~( hasOrgan(Human,Heart)))  &
    nesc( isa(Human,tAnimal)) &
    '$existential'( Heart,
      1,
      ( nesc( isa(Human,tAnimal)) =>
        nesc(isa(Heart,tHeart))&nesc(hasOrgan(Human,Heart))))) ==>
  poss( ~( isa(Heart,tHeart)))).

%  AND
%~ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%~  Whenever:
%~     by default ?Heart nesc(isa(Human,tAnimal))=>(nesc(isa(Heart,tHeart))&nesc(hasOrgan(Human,Heart)))  and
%~    (" ?Human isa tAnimal " is necessarily true  and
%~    " ?Heart isa tHeart " is necessarily true )
%~  It's Proof that:
%~    " ?Human hasOrgan ?Heart " is necessarily true
%~
%~ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

( ( '$existential'( Heart,
      1,
      ( nesc( isa(Human,tAnimal)) =>
        nesc(isa(Heart,tHeart))&nesc(hasOrgan(Human,Heart))))  &
    nesc( isa(Human,tAnimal)) &
    nesc( isa(Heart,tHeart))) ==>
  nesc( hasOrgan(Human,Heart))).


%~ '%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%'.

%~ completed_test_boxlog(t123)

%~ '%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%'.

~*/

:- add_test(t123a,
  atleast(1,Heart,
    isa(Human,tAnimal)
      => (isa(Heart,tHeart) & hasOrgan(Human,Heart)))).

/*~

%~ '%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%'.

%~ test_boxlog(t123a)

%~ '%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%'.

%~ correct_special_quantifiers :- exists( Heart,
%~                                  isa(Human,tAnimal)=>(isa(Heart,tHeart)&hasOrgan(Human,Heart))).
%~ %~ correct_special_quantifiers:-exists(Heart,isa(Human,tAnimal)=>(isa(Heart,tHeart)&hasOrgan(Human,Heart)))
%~ kifi = atleast( 1,
%~          Heart,
%~          isa(Human,tAnimal)=>(isa(Heart,tHeart)&hasOrgan(Human,Heart))).
%~ /var/lib/jenkins/workspace/logicmoo_workspace/packs_sys/logicmoo_base/t/examples/fol/sanity_atleast_01.pfc.pl:50
%~ kifm = exists( Heart,
%~          nesc( isa(Human,tAnimal)=>(isa(Heart,tHeart)&hasOrgan(Human,Heart)))).
%~ kif_to_boxlog_attvars2 = exists('$VAR'('Heart'),necessary(=>(isa('$VAR'('Human'),tAnimal),and(isa('$VAR'('Heart'),tHeart),hasOrgan('$VAR'('Human'),'$VAR'('Heart'))))))
%~ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%~  Whenever:
%~    " ?Human hasOrgan ?Heart " is necessarily true  and
%~    " ?Heart isa tHeart " is possibly false
%~  It's Proof that:
%~    " ?Human isa tAnimal " is possibly false
%~
%~ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

( nesc(hasOrgan(Human,Heart))&poss(~isa(Heart,tHeart)) ==>
  poss( ~( isa(Human,tAnimal)))).

%  AND
%~ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%~  Whenever:
%~     by default ?Heart nesc(isa(Human,tAnimal))=>(nesc(isa(Heart,tHeart))&nesc(hasOrgan(Human,Heart)))  and
%~    (" ?Human isa tAnimal " is necessarily true  and
%~    " ?Heart isa tHeart " is possibly false )
%~  It's Proof that:
%~    " ?Human hasOrgan ?Heart " is possibly false
%~
%~ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

( ( '$existential'( Heart,
      1,
      ( nesc( isa(Human,tAnimal)) =>
        nesc(isa(Heart,tHeart))&nesc(hasOrgan(Human,Heart))))  &
    nesc( isa(Human,tAnimal)) &
    poss( ~( isa(Heart,tHeart)))) ==>
  poss( ~( hasOrgan(Human,Heart)))).

%  AND
%~ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%~  Whenever:
%~    (" ?Human hasOrgan ?Heart " is necessarily true  and
%~    " ?Human isa tAnimal " is necessarily true ) and
%~     by default ?Heart nesc(isa(Human,tAnimal))=>(nesc(isa(Heart,tHeart))&nesc(hasOrgan(Human,Heart)))
%~  It's Proof that:
%~    " ?Heart isa tHeart " is necessarily true
%~
%~ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

( ( nesc( hasOrgan(Human,Heart))  &
    nesc( isa(Human,tAnimal)) &
    '$existential'( Heart,
      1,
      ( nesc( isa(Human,tAnimal)) =>
        nesc(isa(Heart,tHeart))&nesc(hasOrgan(Human,Heart))))) ==>
  nesc( isa(Heart,tHeart))).

%  AND
%~ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%~  Whenever:
%~    " ?Human hasOrgan ?Heart " is possibly false  and
%~    " ?Heart isa tHeart " is necessarily true
%~  It's Proof that:
%~    " ?Human isa tAnimal " is possibly false
%~
%~ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

( poss(~hasOrgan(Human,Heart))&nesc(isa(Heart,tHeart)) ==>
  poss( ~( isa(Human,tAnimal)))).

%  AND
%~ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%~  Whenever:
%~    (" ?Human hasOrgan ?Heart " is possibly false  and
%~    " ?Human isa tAnimal " is necessarily true ) and
%~     by default ?Heart nesc(isa(Human,tAnimal))=>(nesc(isa(Heart,tHeart))&nesc(hasOrgan(Human,Heart)))
%~  It's Proof that:
%~    " ?Heart isa tHeart " is possibly false
%~
%~ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

( ( poss( ~( hasOrgan(Human,Heart)))  &
    nesc( isa(Human,tAnimal)) &
    '$existential'( Heart,
      1,
      ( nesc( isa(Human,tAnimal)) =>
        nesc(isa(Heart,tHeart))&nesc(hasOrgan(Human,Heart))))) ==>
  poss( ~( isa(Heart,tHeart)))).

%  AND
%~ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%~  Whenever:
%~     by default ?Heart nesc(isa(Human,tAnimal))=>(nesc(isa(Heart,tHeart))&nesc(hasOrgan(Human,Heart)))  and
%~    (" ?Human isa tAnimal " is necessarily true  and
%~    " ?Heart isa tHeart " is necessarily true )
%~  It's Proof that:
%~    " ?Human hasOrgan ?Heart " is necessarily true
%~
%~ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

( ( '$existential'( Heart,
      1,
      ( nesc( isa(Human,tAnimal)) =>
        nesc(isa(Heart,tHeart))&nesc(hasOrgan(Human,Heart))))  &
    nesc( isa(Human,tAnimal)) &
    nesc( isa(Heart,tHeart))) ==>
  nesc( hasOrgan(Human,Heart))).


%~ '%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%'.

%~ completed_test_boxlog(t123a)

%~ '%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%'.

~*/


:- add_test(t124,
  (all(Human,
    isa(Human,tAnimal) =>
      atleast(1, Heart, (isa(Heart,tHeart)  =>  hasOrgan(Human,Heart)))))).

/*~

%~ '%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%'.

%~ /var/lib/jenkins/workspace/logicmoo_workspace/packs_sys/logicmoo_base/t/examples/fol/sanity_atleast_01.pfc.pl:56
%~ test_boxlog(t124)

%~ '%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%'.

%~ correct_special_quantifiers :- all( Human,
%~                                  ( isa(Human,tAnimal) =>
%~                                    exists(Heart,isa(Heart,tHeart)=>hasOrgan(Human,Heart)))).
%~ %~ correct_special_quantifiers:-all(Human,isa(Human,tAnimal)=>exists(Heart,isa(Heart,tHeart)=>hasOrgan(Human,Heart)))
%~ kifi = all( Human,
%~          ( isa(Human,tAnimal) =>
%~            atleast(1,Heart,isa(Heart,tHeart)=>hasOrgan(Human,Heart)))).
%~ kifm = all( Human,
%~          nesc( ( isa(Human,tAnimal) =>
%~                  exists(Heart,isa(Heart,tHeart)=>hasOrgan(Human,Heart))))).
%~ kif_to_boxlog_attvars2 = forall('$VAR'('Human'),necessary(=>(isa('$VAR'('Human'),tAnimal),exists('$VAR'('Heart'),=>(isa('$VAR'('Heart'),tHeart),hasOrgan('$VAR'('Human'),'$VAR'('Heart')))))))
%~ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%~  Whenever:
%~    " ?Human hasOrgan ?Heart " is possibly false  and
%~    " ?Heart isa tHeart " is necessarily true
%~  It's Proof that:
%~    " ?Human isa tAnimal " is possibly false
%~
%~ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

( poss(~hasOrgan(Human,Heart))&nesc(isa(Heart,tHeart)) ==>
  poss( ~( isa(Human,tAnimal)))).

%  AND
%~ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%~  Whenever:
%~    (" ?Human hasOrgan ?Heart " is possibly false  and
%~    " ?Human isa tAnimal " is necessarily true ) and
%~     by default ?Heart nesc(isa(Heart,tHeart))=>nesc(hasOrgan(Human,Heart))
%~  It's Proof that:
%~    " ?Heart isa tHeart " is possibly false
%~
%~ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

( ( poss( ~( hasOrgan(Human,Heart)))  &
    nesc( isa(Human,tAnimal)) &
    '$existential'( Heart,
      1,
      nesc(isa(Heart,tHeart))=>nesc(hasOrgan(Human,Heart)))) ==>
  poss( ~( isa(Heart,tHeart)))).

%  AND
%~ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%~  Whenever:
%~     by default ?Heart nesc(isa(Heart,tHeart))=>nesc(hasOrgan(Human,Heart))  and
%~    (" ?Human isa tAnimal " is necessarily true  and
%~    " ?Heart isa tHeart " is necessarily true )
%~  It's Proof that:
%~    " ?Human hasOrgan ?Heart " is necessarily true
%~
%~ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

( ( '$existential'(Heart,1,nesc(isa(Heart,tHeart))=>nesc(hasOrgan(Human,Heart)))  &
    nesc( isa(Human,tAnimal)) &
    nesc( isa(Heart,tHeart))) ==>
  nesc( hasOrgan(Human,Heart))).


%~ '%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%'.

%~ completed_test_boxlog(t124)

%~ '%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%'.

~*/


:- add_test(t124a,
  (atleast(1, Heart,
     all(Human,
       isa(Human,tAnimal) =>
        (isa(Heart,tHeart)  =>  hasOrgan(Human,Heart)))))).

/*~

%~ '%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%'.

%~ test_boxlog(t124a)

%~ '%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%'.

%~ message_hook(
%~    error( syntax_error(operator_clash),
%~      string("wid(rule8:0,rule,atleast(1,Heart,all(Human,isa(Human,tAnimal)=>isa(Heart,tHeart)=>hasOrgan(Human,Heart)))) . ",62)),
%~    error,
%~    [ 'Syntax error: ', 'Operator priority clash',nl,
%~      '~w'-["wid(rule8:0,rule,atleast(1,Heart,all(Human,isa(Human,tAnimal)="], nl,'** here **',nl,
%~      '~w'-[">isa(Heart,tHeart)=>hasOrgan(Human,Heart)))) . "]])
Syntax error: Operator priority clash
wid(rule8:0,rule,atleast(1,Heart,all(Human,isa(Human,tAnimal)=
** here **
>isa(Heart,tHeart)=>hasOrgan(Human,Heart)))) .
ERROR: Syntax error: Operator priority clash
ERROR: wid(rule8:0,rule,atleast(1,Heart,all(Human,isa(Human,tAnimal)=
ERROR: ** here **
ERROR: >isa(Heart,tHeart)=>hasOrgan(Human,Heart)))) .
%~ message_hook(
%~    goal_failed( directive,
%~      t123 : add_test( t124a,
%~               atleast( 1,
%~                 Heart,
%~                 all( Human,
%~                   ( isa(Human,tAnimal)  =>
%~                     isa(Heart,tHeart) =>
%~                     hasOrgan(Human,Heart)))))),
%~    warning,
%~    [ 'Goal (~w) failed: ~p' - [ directive,
%~                                 t123 : add_test( t124a,
%~                                          atleast( 1,
%~                                            Heart,
%~                                            all( Human,
%~                                              ( isa(Human,tAnimal)  =>
%~                                                isa(Heart,tHeart) =>
%~                                                hasOrgan(Human,Heart)))))]])
Goal (directive) failed: t123:add_test(t124a,atleast(1,_588,all(_592,isa(_592,tAnimal)=>isa(_588,tHeart)=>hasOrgan(_592,_588))))
Warning: Goal (directive) failed: t123:add_test(t124a,atleast(1,_588,all(_592,isa(_592,tAnimal)=>isa(_588,tHeart)=>hasOrgan(_592,_588))))
~*/


:- cls.

/*~
%~ skipped(messy_on_output,cls)
~*/

:- expects_dialect(pfc).

/*~
~*/

:- t122.

/*~

%~ '%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%'.

%~ running_test(t122)

%~ '%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%'.

%~ correct_special_quantifiers :- all( Human,
%~                                  ( isa(Human,tAnimal) =>
%~                                    exists(Heart,isa(Heart,tHeart)&hasOrgan(Human,Heart)))).
%~ %~ correct_special_quantifiers:-all(Human,isa(Human,tAnimal)=>exists(Heart,isa(Heart,tHeart)&hasOrgan(Human,Heart)))
%~ kifi = all( Human,
%~          ( isa(Human,tAnimal) =>
%~            atleast(1,Heart,isa(Heart,tHeart)&hasOrgan(Human,Heart)))).
%~ kifm = all( Human,
%~          nesc( ( isa(Human,tAnimal) =>
%~                  exists(Heart,isa(Heart,tHeart)&hasOrgan(Human,Heart))))).
%~ kif_to_boxlog_attvars2 = forall('$VAR'('Human'),necessary(=>(isa('$VAR'('Human'),tAnimal),exists('$VAR'('Heart'),and(isa('$VAR'('Heart'),tHeart),hasOrgan('$VAR'('Human'),'$VAR'('Heart')))))))
%~ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%~  Whenever:
%~    " ?Human hasOrgan ?Heart " is necessarily true  and
%~    " ?Heart isa tHeart " is possibly false
%~  It's Proof that:
%~    " ?Human isa tAnimal " is possibly false
%~
%~ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

( nesc(hasOrgan(Human,Heart))&poss(~isa(Heart,tHeart)) ==>
  poss( ~( isa(Human,tAnimal)))).

%  AND
%~ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%~  Whenever:
%~     by default ?Heart nesc(isa(Heart,tHeart))&nesc(hasOrgan(Human,Heart))  and
%~    (" ?Human isa tAnimal " is necessarily true  and
%~    " ?Heart isa tHeart " is possibly false )
%~  It's Proof that:
%~    " ?Human hasOrgan ?Heart " is possibly false
%~
%~ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

( ( '$existential'(Heart,1,nesc(isa(Heart,tHeart))&nesc(hasOrgan(Human,Heart)))  &
    nesc( isa(Human,tAnimal)) &
    poss( ~( isa(Heart,tHeart)))) ==>
  poss( ~( hasOrgan(Human,Heart)))).

%  AND
%~ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%~  Whenever:
%~    (" ?Human hasOrgan ?Heart " is necessarily true  and
%~    " ?Human isa tAnimal " is necessarily true ) and
%~     by default ?Heart nesc(isa(Heart,tHeart))&nesc(hasOrgan(Human,Heart))
%~  It's Proof that:
%~    " ?Heart isa tHeart " is necessarily true
%~
%~ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

( ( nesc( hasOrgan(Human,Heart))  &
    nesc( isa(Human,tAnimal)) &
    '$existential'( Heart,
      1,
      nesc(isa(Heart,tHeart))&nesc(hasOrgan(Human,Heart)))) ==>
  nesc( isa(Heart,tHeart))).

%  AND
%~ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%~  Whenever:
%~    " ?Human hasOrgan ?Heart " is possibly false  and
%~    " ?Heart isa tHeart " is necessarily true
%~  It's Proof that:
%~    " ?Human isa tAnimal " is possibly false
%~
%~ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

( poss(~hasOrgan(Human,Heart))&nesc(isa(Heart,tHeart)) ==>
  poss( ~( isa(Human,tAnimal)))).

%  AND
%~ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%~  Whenever:
%~    (" ?Human hasOrgan ?Heart " is possibly false  and
%~    " ?Human isa tAnimal " is necessarily true ) and
%~     by default ?Heart nesc(isa(Heart,tHeart))&nesc(hasOrgan(Human,Heart))
%~  It's Proof that:
%~    " ?Heart isa tHeart " is possibly false
%~
%~ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

( ( poss( ~( hasOrgan(Human,Heart)))  &
    nesc( isa(Human,tAnimal)) &
    '$existential'( Heart,
      1,
      nesc(isa(Heart,tHeart))&nesc(hasOrgan(Human,Heart)))) ==>
  poss( ~( isa(Heart,tHeart)))).

%  AND
%~ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%~  Whenever:
%~     by default ?Heart nesc(isa(Heart,tHeart))&nesc(hasOrgan(Human,Heart))  and
%~    (" ?Human isa tAnimal " is necessarily true  and
%~    " ?Heart isa tHeart " is necessarily true )
%~  It's Proof that:
%~    " ?Human hasOrgan ?Heart " is necessarily true
%~
%~ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

( ( '$existential'(Heart,1,nesc(isa(Heart,tHeart))&nesc(hasOrgan(Human,Heart)))  &
    nesc( isa(Human,tAnimal)) &
    nesc( isa(Heart,tHeart))) ==>
  nesc( hasOrgan(Human,Heart))).


%~ '%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%'.

%~ /var/lib/jenkins/workspace/logicmoo_workspace/packs_sys/logicmoo_base/t/examples/fol/sanity_atleast_01.pfc.pl:70
%~ completed_running_test(t122)

%~ '%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%'.

~*/

:- mpred_test(\+ tHeart(_)).
/*~
%~ ?-( mpred_test("Test_0001_Line_0000__naf_tHeart_1_in_t123",t123:(\+tHeart(Heart)))).
%~ make_dynamic_here(t123,tHeart(_37514))
passed=info(why_was_true(t123:(\+tHeart(_37514))))
no_proof_for(\+tHeart(Heart1)).

no_proof_for(\+tHeart(Heart1)).

no_proof_for(\+tHeart(Heart1)).

name='logicmoo.base.examples.fol.SANITY_ATLEAST_01-Test_0001_Line_0000__naf_tHeart_1_in_t123'.
JUNIT_CLASSNAME='logicmoo.base.examples.fol.SANITY_ATLEAST_01'.
JUNIT_CMD='timeout --foreground --preserve-status -s SIGKILL -k 10s 10s swipl -x /var/lib/jenkins/workspace/logicmoo_workspace/bin/lmoo-clif -t "[\'sanity_atleast_01.pfc.pl\']"'.
% saving_junit: /var/lib/jenkins/workspace/logicmoo_workspace/test_results/jenkins/Report-logicmoo-base-examples-fol-vSTARv0vSTARvvDOTvvSTARv-2-1--grep-2-i-WARN-ERROR-_file-00-fail-pass--Units-Logicmoo_base_examples_fol_SANITY_ATLEAST_01_Test_0001_Line_0000_naf_tHeart_1_in_t123-junit.xml
~*/

:- ain(tAnimal(iBob)).

/*~
~*/

:- mpred_
goal=t123:tHeart(_967600).
time=0.00011897087097167969.
failure=failure=info((why_was_true(t123:(\+tHeart(_907694))),nop(ftrace(t123:tHeart(_907694)))))
no_proof_for(\+tHeart(Heart1)).

no_proof_for(\+tHeart(Heart1)).

no_proof_for(\+tHeart(Heart1)).

result=failure.