don't read into the heap while incrementing self.s (#1233, #1245)

This commit is contained in:
Mark Thom
2022-01-24 18:47:53 -07:00
parent e6c4ecfc10
commit a562793fce
5 changed files with 71 additions and 78 deletions

View File

@@ -11,7 +11,7 @@
*/
:- module(least_time, [find_min_time/2,
write_time_nl/1]).
write_time_nl/1]).
:- use_module(library(dcgs)).
@@ -27,10 +27,10 @@ valid_time([H1,H2,M1,M2], T) :-
memberd_t(M2, [0,1,2,3,4,5,6,7,8,9], TM2),
( maplist(=(true), [TH1, TH2, TM1, TM2]) ->
( H1 =:= 2 ->
( H2 =< 3 ->
T = true
; T = false
)
( H2 =< 3 ->
T = true
; T = false
)
; T = true
)
; T = false