Three things

% 1 All of these demonstrate stability until 29/05/2022 when there can be seen to have been acute decompensation due to the onset of an infection.

% 2 Since the physiological decline which would have prompted ITU level care can be demonstrated to have commenced on 29/05/2022.

% 3 She was transferred to HDU on the date that there was demonstrable precipitous deterioration in renal and cardiac function.

% 4 She was reviewed…admitted to the High Dependency Unit on 30/05/2022 due to multiple organ dysfunction.

% 5 NEWS scores over the 48 hours prior to her admission to HDU on 30/05/2022 demonstrate acceptable parameters throughout and no suggestion of a missed physiological decline.

stability_until(date(2022, 5, 29)).
physiological_decline_commenced(date(2022, 5, 29)).
physiological_decline_commenced(date(2022, 5, 30)).
multiple_organ_dysfunction_commenced(date(2022, 5, 30)).

acute_decompensation_commenced(Date) :-
stability_until(Date),
physiological_decline_commenced(Date).

acute_decompensation_commenced(Date) :-
multiple_organ_dysfunction_commenced(Date),
physiological_decline_commenced(Date).

precipitous_deterioration_in_renal_and_cardiac_function_began(Date) :-
acute_decompensation_commenced(Date).

admitted_to_HDU(Date) :-
precipitous_deterioration_in_renal_and_cardiac_function_began(Date).

admitted_to_HDU(Date) :-
multiple_organ_dysfunction_commenced(Date).

admitted_to_HDU(Date) :-
Date = date(2022, 5, 30).

queries :- acute_decompensation_commenced(Date).
% :- admitted_to_HDU(Date).wolf

Long time! :slight_smile:
I’m being told the 5 statements, above are congruent. I can see that they’re not. I set about proving it with my never very good Prolog skills and the above is my effort at accurately reflecting the statements.

I’d very much appreciate it if:…

  1. someone would check if my program has accurately captured the 5 statements.

  2. tell me why I get each of the “Date = date(2022, 5, 30)” lines…

    ?- [incongruent].
    true.

?- admitted_to_HDU(Date).
Date = date(2022, 5, 29) ;
Date = date(2022, 5, 30) ;
Date = date(2022, 5, 30) ;
Date = date(2022, 5, 30).

?- acute_decompensation_commenced(Date).
Date = date(2022, 5, 29) ;
Date = date(2022, 5, 30).

  1. tell me if its possible to run these queries non-interactively AND include them in the source file…I did read SWIPL -s incongruent -g , -t but I’m missing something.

Thank you for your patience and assistance.

This is expected behavior I guess. The query asks for the date at which acute decompensation began. The program has two rules for deciding it,

From what I see in the database, both are fulfilled for 29 and 30 May.

Thank you very much.