/* Files: model/model4.pl, model/heart4.pl, model/possible4.pl kardio_dm.pl deep model of the heart, 4th level of detail, standard Prolog, suitable for simulation Copyright (c) 1989, Igor Mozetic. All rights reserved. Author : Dr. Igor Mozetic Austrian Research Institute for Artificial Intelligence Schottengasse 3 A-1010 Vienna, Austria Phone: (+43 1) 533-6112 Email: igor@ai.univie.ac.at Updated: 6/29/1990 Bratko, I., Mozetic, I., Lavrac, N. KARDIO: A Study in Deep and Qualitative Knowledge for Expert Systems. The MIT Press, Cambridge, MA, 1989. Mozetic, I. Diagnostic efficiency of deep and surface knowledge in KARDIO. Artificial Intelligence in Medicine 2 (2), pp. 67-83, 1990. Mozetic, I., Pfahringer, B. Improving diagnostic efficiency in KARDIO: abstractions, constraint propagation, and model compilation. To appear in Deep Models for Medical Knowledge Engineering (E. Keravnou, Ed.), Elsevier, Amsterdam, 1992. The following are domain specifications (domains are sorted): SA = sino-atrial node AV = atrio ventricular condictipn BB= bundle branches ECT = ectopic ventricular focus etc e.g. normal state SA = sr (sinyus rythmn) BB = normal AV = normal ECT = quiet etc domains_arr(arr(SA, Atr, AV, Jun, BB, Reg, Ect)) :- domain( SA, [quiet,sa,sad,sb,sr,st] ), domain( Atr, [aeb,af,afl,at,mat,quiet,wp] ), domain( AV, [avb1,avb3,lgl,mob2,normal,wen,wpw] ), domain( Jun, [jb,jeb,jr,jt,quiet] ), domain( BB, [lbbb,normal,rbbb] ), domain( Reg, [avr,quiet,vf,vfl,vr,vt] ), domain( Ect, [quiet,veb] ). domains_ecg(ecg(Rhythm, P, RateP, P_QRS, PR, QRS, Rate, EctP, EctPR, EctQRS)) :- domain( Rhythm,[irregular,regular] ), domain( P, [abnormal,absent,changing,normal] ), domain( RateP, [between_100_250,between_250_350,between_60_100, over_350,under_60,zero] ), domain( P_QRS, [after_P_always_QRS,after_P_some_QRS_miss, independent_P_QRS,meaningless] ), domain( PR, [after_QRS_is_P,changing,meaningless,normal, prolonged,shortened] ), domain( QRS, [absent,delta_LBBB,delta_RBBB,normal,wide_LBBB, wide_LBBB_RBBB,wide_RBBB] ), domain( Rate, [between_100_250,between_250_350,between_60_100, over_350,under_60] ), domain( EctP, [abnormal,absent] ), domain( EctPR, [after_QRS_is_P,meaningless,normal,prolonged,shortened] ), domain( EctQRS,[absent,delta_LBBB,delta_RBBB,normal,wide_LBBB, wide_LBBB_RBBB,wide_RBBB] ). ******************************************************************************** % % Model of the heart at the most detailed, 4th level. % Fast for simulation, slower for diagnosis, % can be used to generate a complete Arr-ECG relational table. % Non-redundant specification, relates 943 Arr to 3096 ECG, 5240 pairs. /* ?- sample_arr(4, Arr ), simulate( Arr, ECG ). ECG = ecg(regular,abnormal,between_100_250,after_P_always_QRS,shortened, normal,between_100_250,abnormal,shortened,normal) ; ECG = ecg(regular,abnormal,between_100_250,after_P_always_QRS,shortened, normal,between_100_250,abnormal,after_QRS_is_P,normal) ; ECG = ecg(regular,abnormal,between_100_250,after_P_always_QRS,shortened, normal,between_100_250,absent,meaningless,normal) ; no ?- sample_ecg(4, ECG ), simulate( Arr, ECG ). Arr = arr(quiet,at,normal,jeb,normal,quiet,quiet) ; Arr = arr(quiet,at,lgl,jeb,normal,quiet,quiet) ; no ?- simulate( Arr, ECG ). Arr = arr(sa,aeb,avb1,quiet,normal,quiet,quiet), ECG = ecg(irregular,normal,between_60_100,after_P_always_QRS,prolonged, normal,between_60_100,abnormal,prolonged,normal) ; Arr = arr(sa,aeb,avb1,quiet,lbbb,quiet,quiet), ECG = ecg(irregular,normal,between_60_100,after_P_always_QRS,prolonged, wide_LBBB,between_60_100,abnormal,prolonged,wide_LBBB) ; ... */ sample_ecg(4, ecg(regular, abnormal, between_100_250, after_P_always_QRS, shortened, normal, between_100_250, abnormal, after_QRS_is_P, normal)). sample_arr(4, arr(quiet,at,lgl,jeb,normal,quiet,quiet)). /********************************************** * * ?- simulate( Arr, Ecg). % as 5240 solutions