String literal expansion (C++ kernel: try_string_lit_expansion_core). When `t` is a string literal, expand it to constructor form via `str_lit_to_constructor` (String.ofList [Char.ofNat c₁, ...]), WHNF the result so String.ofList + Char.ofNat delta-unfold to the canonical `String.ofByteArray ...` form, then compare with `s`.
(
&mut self,
t: &KExpr<M>,
s: &KExpr<M>,
)
| 1001 | /// Def-eq for nat-like values: handles mixed literal/constructor comparison. |
| 1002 | /// Fast-path: two Nat literals are compared directly by value (O(1) instead of |
| 1003 | /// O(n) recursion depth that would blow the def_eq_depth limit). |
| 1004 | fn is_def_eq_nat( |
| 1005 | &mut self, |
| 1006 | a: &KExpr<M>, |
| 1007 | b: &KExpr<M>, |
| 1008 | ) -> Result<bool, TcError<M>> { |
| 1009 | // Fast path: both literals — compare by value directly |
| 1010 | if let (ExprData::Nat(va, _, _), ExprData::Nat(vb, _, _)) = |
| 1011 | (a.data(), b.data()) |
| 1012 | { |
| 1013 | return Ok(va == vb); |
| 1014 | } |
| 1015 | if self.is_nat_zero(a) && self.is_nat_zero(b) { |
| 1016 | return Ok(true); |
| 1017 | } |
no test coverage detected