mirror of
https://github.com/c-cube/sidekick.git
synced 2025-12-06 11:15:43 -05:00
fix emission of reference terms
This commit is contained in:
parent
6b1b1eb587
commit
72d79d7c0a
3 changed files with 8 additions and 11 deletions
|
|
@ -158,7 +158,7 @@ end = struct
|
|||
let name = name_term lid in
|
||||
let step = lazy (P.S_define_t_name (name, !!t)) in
|
||||
add_top_step step;
|
||||
L_terms.add lid (lazy (P.T.ref id))
|
||||
L_terms.add lid (lazy (P.T.ref name))
|
||||
) else (
|
||||
L_terms.add lid t
|
||||
)
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ module Ty = struct
|
|||
| Bool
|
||||
| Arrow of t array * t
|
||||
| App of string * t array
|
||||
| Ref of id
|
||||
| Ref of string
|
||||
|
||||
let equal : t -> t -> bool = (=)
|
||||
let hash : t -> int = CCHash.poly
|
||||
|
|
@ -22,7 +22,7 @@ module Ty = struct
|
|||
| App (c, [||]) -> Fmt.string out c
|
||||
| App (c, args) ->
|
||||
Fmt.fprintf out "(@[%s@ %a@])" c (Util.pp_array pp) args
|
||||
| Ref id -> Fmt.fprintf out "@@%d" id
|
||||
| Ref name -> Fmt.fprintf out "(@@ %s)" name
|
||||
end
|
||||
|
||||
module Fun = struct
|
||||
|
|
@ -43,7 +43,7 @@ module T = struct
|
|||
| Ite of t * t * t
|
||||
| Not of t
|
||||
| Eq of t * t
|
||||
| Ref of id
|
||||
| Ref of string
|
||||
let[@inline] view (self:t) : t = self
|
||||
|
||||
let equal : t -> t -> bool = (=)
|
||||
|
|
@ -54,7 +54,7 @@ module T = struct
|
|||
let bool b = Bool b
|
||||
let not_ = function Not x -> x | x -> Not x
|
||||
let eq a b : t = Eq (a,b)
|
||||
let ref id : t = Ref id
|
||||
let ref name : t = Ref name
|
||||
let app_fun f args : t = App_fun (f, args)
|
||||
let const c = app_fun c [||]
|
||||
let app_ho a b : t = App_ho (a,b)
|
||||
|
|
@ -69,7 +69,7 @@ module T = struct
|
|||
| App_ho (f,a) -> Fmt.fprintf out "(@[%a@ %a@])" pp f pp a
|
||||
| Not a -> Fmt.fprintf out "(@[not@ %a@])" pp a
|
||||
| Eq (a,b) -> Fmt.fprintf out "(@[=@ %a@ %a@])" pp a pp b
|
||||
| Ref id -> Fmt.fprintf out "@@%d" id
|
||||
| Ref name -> Fmt.fprintf out "(@@ %s)" name
|
||||
end
|
||||
|
||||
type term = T.t
|
||||
|
|
@ -112,7 +112,6 @@ type t =
|
|||
| CC_lemma of clause
|
||||
| Assertion of term
|
||||
| Assertion_c of clause
|
||||
| Drup_res of clause
|
||||
| Hres of t * hres_step list
|
||||
| Res of term * t * t
|
||||
| Res1 of t * t
|
||||
|
|
@ -208,7 +207,6 @@ let bool_eq a b : t = Bool_eq (a,b)
|
|||
let bool_c name c : t = Bool_c (name, c)
|
||||
let nn c : t = Nn c
|
||||
|
||||
let drup_res c : t = Drup_res c
|
||||
let hres_l p l : t =
|
||||
let l = List.filter (function (P1 (Refl _)) -> false | _ -> true) l in
|
||||
if l=[] then p else Hres (p,l)
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ module Make_printer(Out : OUT) = struct
|
|||
| T.App_fun (c, [||]) -> a c
|
||||
| T.App_fun (c, args) ->
|
||||
l(a c :: Util.array_to_list_map pp_t args)
|
||||
| T.Ref i -> l[a"@"; a(string_of_int i)]
|
||||
| T.Ref name -> l[a"@"; a name]
|
||||
| T.App_ho(f,a) -> l[pp_t f;pp_t a]
|
||||
| T.Eq (t,u) -> l[a"=";pp_t t;pp_t u]
|
||||
| T.Not u -> l[a"not";pp_t u]
|
||||
|
|
@ -54,7 +54,7 @@ module Make_printer(Out : OUT) = struct
|
|||
a c
|
||||
| Ty.App (c,args) ->
|
||||
l(a c::Util.array_to_list_map pp_ty args)
|
||||
| Ty.Ref i -> l[a "@"; a (string_of_int i)]
|
||||
| Ty.Ref name -> l[a "@"; a name]
|
||||
| Ty.Arrow (args,b) ->
|
||||
l (a "->" :: Util.array_to_list_map pp_ty args @ [pp_ty b])
|
||||
|
||||
|
|
@ -83,7 +83,6 @@ module Make_printer(Out : OUT) = struct
|
|||
| Nn p -> l[a"nn";pp_rec p]
|
||||
| Assertion t -> l[a"assert";pp_t t]
|
||||
| Assertion_c c -> l[a"assert-c";pp_cl c]
|
||||
| Drup_res c -> l[a"drup";pp_cl c]
|
||||
| Hres (c, steps) -> l[a"hres";pp_rec c;l(List.map pp_hres_step steps)]
|
||||
| Res (t,p1,p2) -> l[a"r";pp_t t;pp_rec p1;pp_rec p2]
|
||||
| Res1 (p1,p2) -> l[a"r1";pp_rec p1;pp_rec p2]
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue