200 | aconn_map pos f (AOr, phis) = AConn (AOr, map (f pos) phis) |
200 | aconn_map pos f (AOr, phis) = AConn (AOr, map (f pos) phis) |
201 | aconn_map _ f (c, phis) = AConn (c, map (f NONE) phis) |
201 | aconn_map _ f (c, phis) = AConn (c, map (f NONE) phis) |
202 |
202 |
203 fun formula_fold pos f = |
203 fun formula_fold pos f = |
204 let |
204 let |
205 fun aux pos (AQuant (_, _, phi)) = aux pos phi |
205 fun fld pos (AQuant (_, _, phi)) = fld pos phi |
206 | aux pos (AConn conn) = aconn_fold pos aux conn |
206 | fld pos (AConn conn) = aconn_fold pos fld conn |
207 | aux pos (AAtom tm) = f pos tm |
207 | fld pos (AAtom tm) = f pos tm |
208 in aux pos end |
208 in fld pos end |
209 |
209 |
210 fun formula_map f (AQuant (q, xs, phi)) = AQuant (q, xs, formula_map f phi) |
210 fun formula_map f (AQuant (q, xs, phi)) = AQuant (q, xs, formula_map f phi) |
211 | formula_map f (AConn (c, phis)) = AConn (c, map (formula_map f) phis) |
211 | formula_map f (AConn (c, phis)) = AConn (c, map (formula_map f) phis) |
212 | formula_map f (AAtom tm) = AAtom (f tm) |
212 | formula_map f (AAtom tm) = AAtom (f tm) |
213 |
213 |