(
&mut self,
e: &KExpr<M>,
depth: u16,
)
| 1147 | } |
| 1148 | |
| 1149 | // Nat primitive reduction |
| 1150 | if family == PrimFamily::Nat |
| 1151 | && let Some(reduced) = |
| 1152 | self.try_reduce_nat_with_succ_mode(&cur, nat_succ_mode)? |
| 1153 | { |
| 1154 | cur = reduced; |
| 1155 | continue; |
| 1156 | } |
| 1157 | |
| 1158 | // Native/string primitives must run before projection-definition |
| 1159 | // rewriting. In the compiled environment, wrappers such as |
| 1160 | // `Subtype.val` and `String.toByteArray` are projection definitions; |
| 1161 | // once rewritten to `Prj`, the cheap primitive recognizers no longer |
| 1162 | // see the original head. |
| 1163 | if family == PrimFamily::Native |
| 1164 | && let Some(reduced) = self.try_reduce_native(&cur)? |
| 1165 | { |
| 1166 | cur = reduced; |
| 1167 | continue; |
| 1168 | } |
| 1169 | |
| 1170 | // String literal primitives. |
| 1171 | if family == PrimFamily::Str |
| 1172 | && let Some(reduced) = self.try_reduce_string(&cur)? |
| 1173 | { |
| 1174 | cur = reduced; |
| 1175 | continue; |
| 1176 | } |
| 1177 | |
| 1178 | if flags.is_full() |
| 1179 | && let Some(reduced) = self.try_reduce_projection_definition(&cur)? |
| 1180 | { |
| 1181 | cur = reduced; |
no test coverage detected