Skip to content

Commit db02b07

Browse files
committed
Added code gaps, unit + stdlib checking
1 parent 5e5ac29 commit db02b07

30 files changed

Lines changed: 617 additions & 269 deletions

src/ecCorePrinting.ml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,8 @@ module type PrinterAPI = sig
7676

7777
val pp_codepos : PPEnv.t -> EcMatching.Position.codepos pp
7878
val pp_codepos_range : PPEnv.t -> EcMatching.Position.codepos_range pp
79+
val pp_codegap1 : PPEnv.t -> EcMatching.Position.codegap1 pp
80+
val pp_codegap : PPEnv.t -> EcMatching.Position.codegap pp
7981

8082
(* ------------------------------------------------------------------ *)
8183
type vsubst = [

src/ecLowPhlGoal.ml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -390,6 +390,35 @@ let o_split ?rev env i s =
390390
try Pos.may_split_at_cpos1 ?rev env i s
391391
with Pos.InvalidCPos -> raise (InvalidSplit (oget i))
392392

393+
(* Gap-based split functions *)
394+
let s_split_at_gap env (g : codegap1) s =
395+
let module Pos = EcMatching.Position in
396+
try Pos.split_at_cgap1 env g s
397+
with Pos.InvalidCPos ->
398+
let cp = match g with GapBefore cp | GapAfter cp -> cp in
399+
raise (InvalidSplit cp)
400+
401+
let o_split_at_gap ?rev env (g : codegap1 option) s =
402+
let module Pos = EcMatching.Position in
403+
try Pos.may_split_at_cgap1 ?rev env g s
404+
with Pos.InvalidCPos ->
405+
let cp = match oget g with GapBefore cp | GapAfter cp -> cp in
406+
raise (InvalidSplit cp)
407+
408+
(* -------------------------------------------------------------------- *)
409+
(* Gap processing functions *)
410+
let tc1_process_codegap1 tc (side, g) =
411+
let me, _ = tc1_get_stmt side tc in
412+
let env = FApi.tc1_env tc in
413+
let env = EcEnv.Memory.push_active_ss me env in
414+
EcTyping.trans_codegap1 env g
415+
416+
let tc1_process_codegap tc (side, g) =
417+
let me, _ = tc1_get_stmt side tc in
418+
let env = FApi.tc1_env tc in
419+
let env = EcEnv.Memory.push_active_ss me env in
420+
EcTyping.trans_codegap env g
421+
393422
(* -------------------------------------------------------------------- *)
394423
let t_hS_or_bhS_or_eS ?th ?teh ?tbh ?te tc =
395424
match (FApi.tc1_goal tc).f_node with

0 commit comments

Comments
 (0)