mirror of
https://github.com/c-cube/sidekick.git
synced 2025-12-06 03:05:31 -05:00
feat: decoders for LRA terms
This commit is contained in:
parent
17ac25d314
commit
dbe64f5975
2 changed files with 39 additions and 17 deletions
|
|
@ -141,23 +141,43 @@ let ops =
|
|||
in
|
||||
{ Const.Ops.equal; hash; ser; pp }
|
||||
|
||||
(* TODO
|
||||
let deser _tst =
|
||||
Ser_decode.
|
||||
let const_decoders : Const.decoders =
|
||||
[
|
||||
( "Qn",
|
||||
ops,
|
||||
Ser_decode.(
|
||||
fun _ ->
|
||||
let* s = string in
|
||||
let+ q =
|
||||
unwrap_opt "expected rational number"
|
||||
(Sidekick_zarith.Rational.of_string s)
|
||||
in
|
||||
Const q );
|
||||
Const q) );
|
||||
( "Qp",
|
||||
ops,
|
||||
Ser_decode.(
|
||||
fun _ ->
|
||||
let* s = string in
|
||||
let+ p = unwrap_opt "expected predicate" (Pred.of_string s) in
|
||||
Pred p );
|
||||
Pred p) );
|
||||
( "Qo",
|
||||
ops,
|
||||
Ser_decode.(
|
||||
fun _ ->
|
||||
let* s = string in
|
||||
let+ o = unwrap_opt "expected LRA operator" (Op.of_string s) in
|
||||
Op o) );
|
||||
( "Q*",
|
||||
ops,
|
||||
Ser_decode.(
|
||||
fun _ ->
|
||||
let* s = string in
|
||||
let+ q =
|
||||
unwrap_opt "expected rational number"
|
||||
(Sidekick_zarith.Rational.of_string s)
|
||||
in
|
||||
Mult_by q) );
|
||||
]
|
||||
*)
|
||||
|
||||
let real tst = Ty.real tst
|
||||
let has_ty_real t = Ty.is_real (T.ty t)
|
||||
|
|
|
|||
|
|
@ -12,6 +12,8 @@ module Op : sig
|
|||
include Sidekick_sigs.EQ_HASH_PRINT with type t := t
|
||||
end
|
||||
|
||||
val const_decoders : Const.decoders
|
||||
|
||||
module View : sig
|
||||
type ('num, 'a) lra_view = ('num, 'a) Sidekick_th_lra.lra_view =
|
||||
| LRA_pred of Pred.t * 'a * 'a
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue