Skip to content

Commit 6754354

Browse files
committed
Add function to get finite-field value.
1 parent 8a879a9 commit 6754354

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

cvc5.lean

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1402,6 +1402,14 @@ Requires `term` to have a bit-vector sort.
14021402
-/
14031403
extern_def!? getBitVectorValue : Term → UInt32 → Except Error String
14041404

1405+
/-- Get the string representation of a finite field value.
1406+
1407+
Requires `term` to have a finite-field sort.
1408+
1409+
-/
1410+
extern_def!? getFiniteFieldValue : Term → Except Error String
1411+
1412+
14051413
/-- Get the native integral value of an integral value. -/
14061414
extern_def!? getIntegerValue : Term → Except Error Int
14071415

ffi/ffi.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -982,6 +982,14 @@ LEAN_EXPORT lean_obj_res term_getBitVectorValue(lean_obj_arg t, uint32_t base)
982982
CVC5_LEAN_API_TRY_CATCH_EXCEPT_END;
983983
}
984984

985+
LEAN_EXPORT lean_obj_res term_getFiniteFieldValue(lean_obj_arg t)
986+
{
987+
CVC5_LEAN_API_TRY_CATCH_EXCEPT_BEGIN;
988+
return except_ok(
989+
lean_mk_string(term_unbox(t)->getFiniteFieldValue().c_str()));
990+
CVC5_LEAN_API_TRY_CATCH_EXCEPT_END;
991+
}
992+
985993
LEAN_EXPORT lean_obj_res term_getIntegerValue(lean_obj_arg t)
986994
{
987995
CVC5_LEAN_API_TRY_CATCH_EXCEPT_BEGIN;

0 commit comments

Comments
 (0)