1414 limitations under the License.
1515-/
1616
17+ module
18+
1719import Cedar.Spec
18- import Cedar.SymCC.Encoder
19- import Cedar.SymCC.Interpretation
20+ public import Cedar.SymCC.Encoder
21+ public import Cedar.SymCC.Interpretation
2022import Cedar.Validation
2123import Std.Internal.Parsec.Basic
2224
@@ -34,7 +36,8 @@ See also Appendix B of https://smt-lib.org/papers/smt-lib-reference-v2.7-r2025-0
3436namespace Cedar.SymCC.Decoder
3537
3638open Std.Internal.Parsec String Batteries
37- open Cedar.Spec Cedar.Validation Cedar.Data
39+ open Cedar.Validation Cedar.Data
40+ open Cedar.Spec hiding Result
3841
3942----- Parsing functions for SMTLib syntax -----
4043
@@ -188,7 +191,7 @@ where
188191 let etyId ← enc.types.find? (.entity ety)
189192 .some (mems.mapIdx λ i eid => (Encoder.enumId etyId i, ⟨ety, eid⟩))
190193
191- abbrev Result (α) := Except String α
194+ public abbrev Result (α) := Except String α
192195
193196instance : Coe α (Result α) where
194197 coe := Except.ok
@@ -356,21 +359,21 @@ def defaultPrim (eidOf : EntityType → String) : TermPrimType → TermPrim
356359 | .entity ety => .entity ⟨ety, eidOf ety⟩
357360 | .ext xty => defaultExt xty
358361
359- def defaultLit (eidOf : EntityType → String) : TermType → Term
362+ public def defaultLit (eidOf : EntityType → String) : TermType → Term
360363 | .prim pty => .prim (defaultPrim eidOf pty)
361364 | .option ty => .none ty
362365 | .set ty => .set Set.empty ty
363366 | .record tys => .record (tys.mapOnValues₂ λ ⟨ty, _⟩ => defaultLit eidOf ty)
364367
365- def defaultUDF (eidOf : EntityType → String) (f : UUF) : UDF :=
368+ public def defaultUDF (eidOf : EntityType → String) (f : UUF) : UDF :=
366369 ⟨f.arg, f.out, Map.empty, defaultLit eidOf f.out⟩
367370
368- def eidOfForEntities (εs : SymEntities) (ety : EntityType) : String :=
371+ public def eidOfForEntities (εs : SymEntities) (ety : EntityType) : String :=
369372 match εs.find? ety with
370373 | .some ⟨_, _, .some (Set.mk (eid :: _)), _⟩ => eid
371374 | _ => ""
372375
373- def defaultInterpretation (εs : SymEntities) : Interpretation :=
376+ public def defaultInterpretation (εs : SymEntities) : Interpretation :=
374377 let eidOf := (eidOfForEntities εs)
375378 {
376379 vars := λ v => defaultLit eidOf v.ty,
@@ -386,7 +389,7 @@ environment `εnv`. If `εnv` is well-formed, the terms `ts` are well-formed wit
386389respect to `εnv.entities`, and CVC5 is sound, the the resulting Interpretation
387390satisfies `ts` and is well-formed with respect to `εnv.entities`.
388391-/
389- def decode (model : String) (enc : EncoderState) : Result Interpretation := do
392+ public def decode (model : String) (enc : EncoderState) : Result Interpretation := do
390393 let x ← SExpr.parse |>.run model
391394 let ⟨vars, uufs⟩ ← x.decodeModel (IdMaps.ofEncoderState enc)
392395 let eidOf := λ ety =>
0 commit comments