MCPcopy Create free account
hub / github.com/BasisResearch/lean.py / Default

Function Default

lean_py/z3/core.py:4292–4300  ·  view source on GitHub ↗

Get the default value of a constant array. Otherwise build an AppNode.

(a: ExprRef)

Source from the content-addressed store, hash-verified

4290
4291
4292def Default(a: ExprRef) -> ExprRef:
4293 """Get the default value of a constant array. Otherwise build an AppNode."""
4294 if isinstance(a._ast, ConstArrayNode):
4295 # Return the value stored in the constant array
4296 sort = a._sort
4297 rng = sort.range() if isinstance(sort, ArraySortRef) else a._sort
4298 return ExprRef(a._ast.val, rng, a._vars)
4299 # Generic: build an application node
4300 return ExprRef(AppNode(_AstVar("default"), (a._ast,)), a._sort, a._vars)
4301
4302
4303def Ext(a: ExprRef, b: ExprRef) -> ExprRef:

Callers

nothing calls this directly

Calls 3

AppNodeClass · 0.90
ExprRefClass · 0.85
rangeMethod · 0.45

Tested by

no test coverage detected