File tree Expand file tree Collapse file tree 2 files changed +19
-0
lines changed
Expand file tree Collapse file tree 2 files changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -619,6 +619,12 @@ extern_def!? getNullableElementSort : cvc5.Sort → Except Error cvc5.Sort
619619/-- Get the associated uninterpreted sort constructor of an instantiated uninterpreted sort. -/
620620extern_def!? getUninterpretedSortConstructor : cvc5.Sort → Except Error cvc5.Sort
621621
622+ /-- Get the sorts used to instantiate the sort parameters of a parametric sort.
623+
624+ A parametric sort is a parametric datatype or an uninterpreted sort constructor sort.
625+ See `cvc5.Sort.instantiate`. -/
626+ extern_def!? getInstantiatedParameters : cvc5.Sort → Except Error (Array cvc5.Sort )
627+
622628/-- Instantiate a parameterized datatype sort or uninterpreted sort constructor sort.
623629
624630Create sort parameters with `TermManager.mkParamSort symbol`.
Original file line number Diff line number Diff line change @@ -686,6 +686,19 @@ LEAN_EXPORT lean_obj_res sort_getUninterpretedSortConstructor(lean_obj_arg s)
686686 CVC5_LEAN_API_TRY_CATCH_EXCEPT_END;
687687}
688688
689+ LEAN_EXPORT lean_obj_res sort_getInstantiatedParameters (lean_obj_arg s)
690+ {
691+ CVC5_LEAN_API_TRY_CATCH_EXCEPT_BEGIN;
692+ std::vector<Sort> params = sort_unbox (s)->getInstantiatedParameters ();
693+ lean_object* ps = lean_mk_empty_array ();
694+ for (const Sort& param : params)
695+ {
696+ ps = lean_array_push (ps, sort_box (new Sort (param)));
697+ }
698+ return except_ok (lean_box (0 ), ps);
699+ CVC5_LEAN_API_TRY_CATCH_EXCEPT_END;
700+ }
701+
689702LEAN_EXPORT lean_obj_arg sort_instantiate (lean_obj_arg s, lean_obj_arg params)
690703{
691704 CVC5_LEAN_API_TRY_CATCH_EXCEPT_BEGIN;
You can’t perform that action at this time.
0 commit comments