4hour_dom(D) :- D .>. 0, D .<. 23. 5 6switch :- not neg_switch. 7neg_switch :- not switch. 8 9lightOn :- switch, not am. 10 11% :- not lightOn. 12 13am :- not neg_am. 14neg_am :- not am. 15 16hour(X) :- hour_dom(X), X .>=. 12, not am. 17hour(X) :- hour_dom(X), X .<. 12, am. 18 19light_is(on) :- lightOn. 20light_is(off) :- not lightOn