logicmoo / Logicmoo_docker

Docker Master Container that starts the rest of the Logicmoo services (see https://hub.docker.com/repository/docker/logicmoo/logicmoo_starter_image )
GNU Lesser General Public License v2.1
4 stars 0 forks source link

logicmoo.base.examples.fol.FOL_CARDINAITY_AXIOMITIZED_01 JUnit #227

Open TeamSPoon opened 2 years ago

TeamSPoon commented 2 years ago

(cd /var/lib/jenkins/workspace/logicmoo_workspace/packs_sys/logicmoo_base/t/examples/fol ; timeout --foreground --preserve-status -s SIGKILL -k 10s 10s lmoo-clif fol_cardinaity_axiomitized_01.pfc.pl)

GH_MASTER_ISSUE_FINFO=478 OPEN logicmoo.base.examples.fol.FOL_CARDINAITY_AXIOMITIZED_01 JUnit Test_9999, FOL_CARDINAITY_AXIOMITIZED_01, logicmoo.base.examples.fol, unit_test, Passing 2021-09-19 09:11:02 +0000 UTC

ISSUE: https://github.com/logicmoo/logicmoo_workspace/issues/478 EDIT: https://github.com/logicmoo/logicmoo_workspace/edit/master/packs_sys/logicmoo_base/t/examples/fol/fol_cardinaity_axiomitized_01.pfc.pl JENKINS: https://jenkins.logicmoo.org/job/logicmoo_workspace/lastBuild/testReport/logicmoo.base.examples.fol/FOL_CARDINAITY_AXIOMITIZED_01/logicmoo_base_examples_fol_FOL_CARDINAITY_AXIOMITIZED_01_JUnit/ PREVIOUS: https://jenkins.logicmoo.org/job/logicmoo_workspace/75/testReport/logicmoo.base.examples.fol/FOL_CARDINAITY_AXIOMITIZED_01/logicmoo_base_examples_fol_FOL_CARDINAITY_AXIOMITIZED_01_JUnit/ ISSUE_SEARCH: https://github.com/logicmoo/logicmoo_workspace/issues?q=is%3Aissue+label%3AFOL_CARDINAITY_AXIOMITIZED_01 GITLAB: https://gitlab.logicmoo.org/gitlab/logicmoo/logicmoo_workspace/-/blob/d634ef0111a0d231abcc9646db7bb922b04915b9/packs_sys/logicmoo_base/t/examples/fol/fol_cardinaity_axiomitized_01.pfc.pl GITHUB: https://github.com/logicmoo/logicmoo_workspace/commit/d634ef0111a0d231abcc9646db7bb922b04915b9

%
running('/var/lib/jenkins/workspace/logicmoo_workspace/packs_sys/logicmoo_base/t/examples/fol/fol_cardinaity_axiomitized_01.pfc.pl'),
%~ this_test_might_need( :-( use_module( library(logicmoo_plarkc))))

% Tests that you can express regular semweb cardinatility though in FOL

/*
ISSUE: https://github.com/logicmoo/logicmoo_workspace/issues/70 
EDIT: https://github.com/logicmoo/logicmoo_workspace/edit/master/packs_sys/logicmoo_base/t/examples/fol/family_regress_01.pfc.pl 
JENKINS: https://jenkins.logicmoo.org/job/logicmoo_workspace/lastBuild/testReport/logicmoo.base.examples.fol/FAMILY_REGRESS_01/logicmoo_base_examples_fol_FAMILY_REGRESS_01_JUnit/ 
PREVIOUS: https://jenkins.logicmoo.org/job/logicmoo_workspace/69/testReport/logicmoo.base.examples.fol/FAMILY_REGRESS_01/logicmoo_base_examples_fol_FAMILY_REGRESS_01_JUnit/ 
ISSUE_SEARCH: https://github.com/logicmoo/logicmoo_workspace/issues?q=is%3Aissue+label%3AFAMILY_REGRESS_01 
GITLAB: https://gitlab.logicmoo.org/gitlab/logicmoo/logicmoo_workspace/-/blob/013514de819eead21c818af170c91f9052a89466/packs_sys/logicmoo_base/t/examples/fol/family_regress_01.pfc.pl 
GITHUB: https://github.com/logicmoo/logicmoo_workspace/commit/013514de819eead21c818af170c91f9052a89466 

#import: written-on(word,paper).

my-minus-one(N,M) <->  (N > 1)  &  (M = N-1)

legal-pad(paper) <-> min-elements(1, paper)

exactly-n-elements(1,paper) <->
(exists paper word.  
    (   written-on(word,paper) 
      & ~(exists other-word.
           (  written-on(other-word,paper) 
             & ~same(other-word,word)))))

exactly-n-elements(2,paper) <->
(exists paper word1 word2. 
  (  written-on(word1,paper) 
   & written-on(word2,paper) 
   & ~same(word1,word2)   
   & ~ (exists other-word. 
         (   written-on(other-word,paper) 
          & ~same(other-word,word1) 
          & ~same(other-word,word2)))))

exactly-n-elements(N,paper) <-> 
   range-elements(N,N,paper)  

range-elements(N,M,paper) <-> 
 (exists paper.
  ( min-elements(N,paper) 
    & max-elements(M,paper)))

min-elements(1,paper) <-> 
 (exists paper word1.
     (written-on(word1,paper)))

min-elements(2,paper) <->
 (exists paper word1 word2. 
   (  written-on(word1,paper) 
    & written-on(word2,paper)
    & ~same(word1,word2)))

max-elements(2,paper) <->  
(exists paper word1 word2. 
   (  written-on(word1,paper) 
    & written-on(word2,paper) 
    &  ~(exists other-word.
          (  written-on(other-word,paper) 
            & ~same(other-word,word1)
            & ~same(other-word,word2)))))

% exists a paper with no elements
exactly-n-elements(0,paper) <->
  (exists paper
     ~(exists word1. written-on(word1,paper)))

max-elements(1,paper) <->
 exactly-n-elements(0,paper) v exactly-n-elements(1,paper)

containsAtLeastOneUnique(paper1,paper2) <->
  (exists word. (written-on(word,paper1) -> ~written-on(word,paper2)))

disjoint(paper1,paper2) <->
  ~(exists word. (written-on(word,paper1) & written-on(word,paper2)))

subset(paper1,paper2) <-> 
    (forall word.
      written-on(word,paper1) -> written-on(word,paper2) )

union(paper1,paper2,paper) <->
 (forall word.
   (written-on(word,paper) <-> 
       (written-on(word,paper1) v written-on(word,paper2))))

union(paper1,paper2,paper) <->
  (exists scratchpad. 
      union(paper1,paper2,scratchpad)
     & ~containsAtLeastOneUnique(paper,scratchpad))

union-disjoint(paper1,paper2,paper) <-> 
   (   union(paper1,paper2,paper) 
     & disjoint(paper1,paper2))

min-elements(4,paper) <-> 
  (exists paper1 paper2.
     min-elements(2,paper1) 
   & min-elements(2,paper2)
   & union-disjoint(paper1,paper2))

min-elements(N,paper) <-> 
  (exists paper1 paper2.
     min-elements(1,paper1) 
   & min-elements(M,paper2)
   & legal-pad(paper2)
   & union-disjoint(paper1,paper2)
   & my-minus-one(N,M))

max-elements(N,paper) <-> 
  (exists paper1 paper2.
     max-elements(1,paper1) 
   & max-elements(M,paper2)
   & legal-pad(paper2)
   & union-disjoint(paper1,paper2)
   & my-minus-one(N,M))

equal_papers_v2(paper1,paper2) <->
   ( ~containsAtLeastOneUnique(paper1,paper2)
     & ~containsAtLeastOneUnique(paper2,paper1)
     & legal-pad(paper1)
     & legal-pad(paper2))

equal_papers_v1(paper1,paper2) <->
 ( legal-pad(paper1)
   & (forall word. 
      (written-on(word,paper1) <-> written-on(word,paper2))))

*/

:- debug_logicmoo(_).

:- nodebug_logicmoo(http(_)).

:- expects_dialect(pfc).

house(red_house).

house(blue_house).
% house(green_house).

% house(green_house).

:- must((existing_count(X,house(X),EC),EC==2)).

%~ /var/lib/jenkins/workspace/logicmoo_workspace/packs_sys/logicmoo_base/t/examples/fol/fol_cardinaity_axiomitized_01.pfc.pl:153 
%~ message_hook_type(error)
%~ message_hook(
%~    error(
%~       existence_error(procedure,baseKB:existing_count/3),
%~       context(system:'<meta-call>'/1,Context_Kw)),
%~    error,
%~    [ '~q/~w: '-['<meta-call>',1],
%~      'Unknown procedure: ~q' - [ baseKB : existing_count/3]])
%~ message_hook_type(warning)
%~ message_hook(
%~    goal_failed(directive,baseKB:(existing_count(X,house(X),EC),EC==2)),
%~    warning,
%~    [ 'Goal (~w) failed: ~p' - [ directive,
%~                                 baseKB : existing_count(X,house(X),EC),EC==2]])
/*~
'<meta-call>'/1: Unknown procedure: baseKB:existing_count/3
ERROR: '<meta-call>'/1: Unknown procedure: baseKB:existing_count/3
Goal (directive) failed: baseKB:must((existing_count(_472,house(_472),_474),_474==2))
Warning: Goal (directive) failed: baseKB:must((existing_count(_472,house(_472),_474),_474==2))
~*/

singleValuedInArg(existing_count,1).

exists_count(3,X,house(X)).

exists_count(N,X,G),{(need_plugs(X,G,EP); EP=0),existing_count(X,G,EC),Need is N-(EC-EP), copy_term(G,GG)}
  ==>
    (need_plugs(Need,X,G),
    (\+ GG ==> exists_count(N,X,G)),
    (   GG ==> exists_count(N,X,G))).

%~ make_dynamic_here(baseKB,existing_count(_1722,house(_1722),_2450))

need_plugs(EP,X,G) ==> {between(1,EP,Plug),copy_term(G,GG,_),X=skFn(Plug,GG)},G.

:- listing(exists_count).
%~ skipped( listing(exists_count))

:- listing(need_plugs).
%~ skipped( listing(need_plugs))

:- listing(house).

%~ skipped( listing(house))

/*

exists_count(3, A, house(A)).

need_plugs(1, A, house(A)).

house(red_house).
house(blue_house).
house(skFn(1, house(_))).

*/

:- must((existing_count(X,house(X),EC),EC==3)).
sHOW_MUST_go_on_failed_F__A__I__L_(baseKB:(existing_count(_16186,house(_16186),_16208),_16208==3))
%~ FIlE: * https://logicmoo.org:2082/gitlab/logicmoo/logicmoo_workspace/-/blob/master/packs_sys/logicmoo_base/t/examples/fol/fol_cardinaity_axiomitized_01.pfc.pl#L186  
%~ error( sHOW_MUST_go_on_failed_F__A__I__L_( baseKB : existing_count(X,house(X),EC),EC==3))
%~ FILE: * https://logicmoo.org:2082/gitlab/logicmoo/logicmoo_workspace/-/blob/master/packs_sys/logicmoo_base/t/examples/fol/fol_cardinaity_axiomitized_01.pfc.pl#L186  

totalTime=10

ISSUE: https://github.com/logicmoo/logicmoo_workspace/issues/478 EDIT: https://github.com/logicmoo/logicmoo_workspace/edit/master/packs_sys/logicmoo_base/t/examples/fol/fol_cardinaity_axiomitized_01.pfc.pl JENKINS: https://jenkins.logicmoo.org/job/logicmoo_workspace/lastBuild/testReport/logicmoo.base.examples.fol/FOL_CARDINAITY_AXIOMITIZED_01/logicmoo_base_examples_fol_FOL_CARDINAITY_AXIOMITIZED_01_JUnit/ PREVIOUS: https://jenkins.logicmoo.org/job/logicmoo_workspace/75/testReport/logicmoo.base.examples.fol/FOL_CARDINAITY_AXIOMITIZED_01/logicmoo_base_examples_fol_FOL_CARDINAITY_AXIOMITIZED_01_JUnit/ ISSUE_SEARCH: https://github.com/logicmoo/logicmoo_workspace/issues?q=is%3Aissue+label%3AFOL_CARDINAITY_AXIOMITIZED_01 GITLAB: https://gitlab.logicmoo.org/gitlab/logicmoo/logicmoo_workspace/-/blob/d634ef0111a0d231abcc9646db7bb922b04915b9/packs_sys/logicmoo_base/t/examples/fol/fol_cardinaity_axiomitized_01.pfc.pl GITHUB: https://github.com/logicmoo/logicmoo_workspace/commit/d634ef0111a0d231abcc9646db7bb922b04915b9

FAILED: /var/lib/jenkins/workspace/logicmoo_workspace/bin/lmoo-junit-minor -k fol_cardinaity_axiomitized_01.pfc.pl (returned 137)

TeamSPoon commented 2 years ago

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