logicmoo / logicmoo_workspace

https://jenkins.logicmoo.org/job/logicmoo_workspace https://logicmoo.org/xwiki/
http://www.logicmoo.org/
Other
45 stars 8 forks source link

logicmoo.base.examples.fol.BOXLOG_SANITY_02 JUnit #614

Open TeamSPoon opened 3 years ago

TeamSPoon commented 3 years ago

(cd /var/lib/jenkins/workspace/logicmoo_workspace@2/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 "['boxlog_sanity_02.pfc.pl']")

% EDIT: https://github.com/logicmoo/logicmoo_workspace/edit/master/packs_sys/logicmoo_base/t/examples/fol/boxlog_sanity_02.pfc.pl % JENKINS: https://jenkins.logicmoo.org/job/logicmoo_workspace/lastBuild/testReport/logicmoo.base.examples.fol/BOXLOG_SANITY_02/ % ISSUE_SEARCH: https://github.com/logicmoo/logicmoo_workspace/issues?q=is%3Aissue+label%3ABOXLOG_SANITY_02 % ISSUE: https://github.com/logicmoo/logicmoo_workspace/issues/614

%~ 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@2/packs_sys/logicmoo_base/t/examples/fol/boxlog_sanity_02.pfc.pl'),
%~ this_test_might_need( :-( use_module( library(logicmoo_plarkc))))

:- ensure_loaded(library(script_files)).

% :- process_this_script.

% Initially Dmiles thought LEM was the culprit, it was not.
% this is a more generalized problem in Nomics

% ==============================================================
% Section 1:  Nomics Problem
% ==============================================================

% Turn off modal extensions (default was full)

%:- rtrace.
/*~
~*/

% :- process_this_script.

% Initially Dmiles thought LEM was the culprit, it was not.
% this is a more generalized problem in Nomics

% ==============================================================
% Section 1:  Nomics Problem
% ==============================================================

% Turn off modal extensions (default was full)

%:- rtrace.
:- set_kif_option(qualify_modality,false).
/*~
~*/

:- must(kif_option_value(qualify_modality,false)).
%:- break.

% :- fully_expand_into_cache(change(assert,assert_u),~exists(X, cute_puppy(X))=>buys(joan, horse),_O).

% Rule 1: If no cute puppies exist, then Joan will buy a horse  (authored by Joan)
/*~
%~ ?-( mpred_test("Test_0001_Line_0000__Qualify_modality",baseKB:kif_option_value(qualify_modality,false))).
passed=info(why_was_true(baseKB:kif_option_value(qualify_modality,false)))
no_proof_for(kif_option_value(qualify_modality,false)).

no_proof_for(kif_option_value(qualify_modality,false)).

no_proof_for(kif_option_value(qualify_modality,false)).

    name    =   'logicmoo.base.examples.fol.BOXLOG_SANITY_02-Test_0001_Line_0000__Qualify_modality'. 
    JUNIT_CLASSNAME =   'logicmoo.base.examples.fol.BOXLOG_SANITY_02'. 
    JUNIT_CMD   =   'timeout --foreground --preserve-status -s SIGKILL -k 10s 10s swipl -x /var/lib/jenkins/workspace/logicmoo_workspace/bin/lmoo-clif -t "[\'boxlog_sanity_02.pfc.pl\']"'. 
% saving_junit: /var/lib/jenkins/workspace/logicmoo_workspace@2/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_BOXLOG_SANITY_02_Test_0001_Line_0000_Qualify_modality-junit.xml
~*/

%:- break.

% :- fully_expand_into_cache(change(assert,assert_u),~exists(X, cute_puppy(X))=>buys(joan, horse),_O).

% Rule 1: If no cute puppies exist, then Joan will buy a horse  (authored by Joan)
:- test_boxlog([+assert], 
  ~exists(X,cute_puppy(X)) => buys(joan,horse)).

% Rule 2: It is impossible for broke people to buy things  (authored by a Shop Keeper)
/*~
%~ kifm = (~exists(X,cute_puppy(X)))=>buys(joan,horse).
%~ kif_to_boxlog_attvars2 = =>(not(exists('$VAR'('X'),cute_puppy('$VAR'('X')))),buys(joan,horse))
%~ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%~  Whenever:
%~    " joan buys horse " is necessarily false  and
%~    "  by default ?X cute_puppy(X) " is necessarily true
%~  It's Proof that:
%~    " ?X isa cute_puppy " is necessarily true
%~ 
%~ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

( nesc(~buys(joan,horse))&nesc('$existential'(X,1,cute_puppy(X))) ==> 
  nesc( cute_puppy(X))).

%  AND
%~ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%~  Whenever:
%~    " ?X isa cute_puppy " is necessarily false
%~  It's Proof that:
%~    " joan buys horse " is necessarily true
%~ 
%~ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

nesc(~cute_puppy(X))==>nesc(buys(joan,horse)).

~*/

% Rule 2: It is impossible for broke people to buy things  (authored by a Shop Keeper)
:- test_boxlog([+assert], 
  forall([P,A], 
    broke(P) => ~ buys(P,A))).

% Fact A: Joan is a broke person  (authored by Joan)
/*~
%~ /var/lib/jenkins/workspace/logicmoo_workspace@2/packs_sys/logicmoo_base/t/examples/fol/boxlog_sanity_02.pfc.pl:36 
%~ correct_special_quantifiers :- all( P,
%~                                  all(A,broke(P)=>(~buys(P,A)))).
%~ %~ correct_special_quantifiers:-all(P,all(A,broke(P)=>(~buys(P,A))))
%~ kifi = all([P,A],broke(P)=>(~buys(P,A))).
%~ kifm = all(P,all(A,broke(P)=>(~buys(P,A)))).
%~ kif_to_boxlog_attvars2 = forall('$VAR'('P'),forall('$VAR'('A'),=>(broke('$VAR'('P')),not(buys('$VAR'('P'),'$VAR'('A'))))))
%~ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%~  Whenever:
%~    " ?P buys ?A " is necessarily true
%~  It's Proof that:
%~    " ?P isa broke " is necessarily false
%~ 
%~ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

nesc(buys(P,A))==>nesc(~broke(P)).

%  AND
%~ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%~  Whenever:
%~    " ?P isa broke " is necessarily true
%~  It's Proof that:
%~    " ?P buys ?A " is necessarily false
%~ 
%~ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

nesc(broke(P))==>nesc(~buys(P,A)).

~*/

% Fact A: Joan is a broke person  (authored by Joan)
:- test_boxlog([+assert], 
  nesc(broke(joan))).

/*~
%~ kifm = nesc( broke(joan)).
%~ kif_to_boxlog_attvars2 = necessary(broke(joan))
%~ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%~  it is necessarily true that joan isa broke
%~ 
%~ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

nesc( broke(joan)).

~*/
%~ unused(no_junit_results)
Test_0001_Line_0000__Qualify_modality   result  =   passed. 

%~ test_completed_exit(64)

totalTime=1.000

SUCCESS: /var/lib/jenkins/workspace/logicmoo_workspace/bin/lmoo-junit-minor -k boxlog_sanity_02.pfc.pl (returned 64) Add_LABELS='' Rem_LABELS='Skipped,Errors,Warnings,Overtime,Skipped,Skipped'

TeamSPoon commented 3 years ago

Broken in https://github.com/logicmoo/logicmoo_workspace/commit/47cfb56e12234430e980d22dbcca206411201b38 https://logicmoo.org:2082/gitlab/logicmoo/logicmoo_workspace/-/commit/47cfb56e12234430e980d22dbcca206411201b38

TeamSPoon commented 3 years ago

Fixed in https://github.com/logicmoo/logicmoo_workspace/commit/51a38b8a8cc92a39cbea53faf8883a32e6dc3b61 https://logicmoo.org:2082/gitlab/logicmoo/logicmoo_workspace/-/commit/51a38b8a8cc92a39cbea53faf8883a32e6dc3b61