fix: SubExpr.Pos.toString not terminating
fixes 1232
This commit is contained in:
parent
58d5a11928
commit
b6f251bcd3
2 changed files with 3 additions and 1 deletions
|
|
@ -29,7 +29,7 @@ def root : Pos := (1 : Nat)
|
|||
|
||||
instance : Inhabited Pos := ⟨root⟩
|
||||
|
||||
def isRoot (p : Pos) : Bool := p.asNat == 1
|
||||
def isRoot (p : Pos) : Bool := p.asNat < maxChildren
|
||||
|
||||
/-- The coordinate deepest in the Pos. -/
|
||||
def head (p : Pos) : Nat :=
|
||||
|
|
|
|||
|
|
@ -17,3 +17,5 @@ theorem Pos.stringRoundtrip :
|
|||
let x := Pos.ofArray p
|
||||
some x == (Except.toOption $ Pos.fromString? $ Pos.toString $ x)
|
||||
) := by native_decide
|
||||
|
||||
#eval Pos.toString Nat.zero
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue