data61 / PSL

Other
65 stars 9 forks source link

Abduction: earlier termination of the loop #193

Closed yutakang closed 1 year ago

yutakang commented 1 year ago

We should break out of the loop as soon as we complete the proof of final goal here.

yutakang commented 1 year ago

We need to replace fold with something else?

val fold: ('a -> 'b -> 'b) -> 'a list -> 'b -> 'b to something like... val breakable_fold: ('a -> 'b -> ( 'b * bool) ) -> 'a list -> 'b -> ( 'b * bool ) where bool is used to indicate if the final goal is proved or not. That is, the condition to break out of the loop / fold.

yutakang commented 1 year ago

We can implement this with Synchronized.var and Par_List.find_some.

yutakang commented 1 year ago

Done.