Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CN: Separate well-typed and consistency checks #797

Merged
merged 1 commit into from
Dec 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions backend/cn/bin/main.ml
Original file line number Diff line number Diff line change
Expand Up @@ -322,9 +322,9 @@ let verify
~magic_comment_char_dollar (* Callbacks *)
~handle_error:(handle_type_error ~json ?output_dir ~serialize_json:json_trace)
~f:(fun ~prog5:_ ~ail_prog:_ ~statement_locs:_ ~paused ->
let check (functions, lemmas) =
let check (functions, global_var_constraints, lemmas) =
let open Typing in
let@ errors = Check.time_check_c_functions functions in
let@ errors = Check.time_check_c_functions (global_var_constraints, functions) in
if not quiet then
List.iter
(fun (fn, err) ->
Expand Down
197 changes: 103 additions & 94 deletions backend/cn/lib/check.ml

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions backend/cn/lib/resourceInference.ml
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ module General = struct
=
Pp.(debug 7 (lazy (item __LOC__ (Req.pp (P requested)))));
let start_timing = Pp.time_log_start __LOC__ "" in
let@ oarg_bt = WellTyped.oarg_bt_of_pred loc requested.name in
let@ oarg_bt = WellTyped.WRS.oarg_bt_of_pred loc requested.name in
let@ provable = provable loc in
let@ global = get_global () in
let@ simp_ctxt = simp_ctxt () in
Expand Down Expand Up @@ -384,7 +384,7 @@ module General = struct

and qpredicate_request loc uiinfo (requested : Req.QPredicate.t) =
let@ o_oarg = qpredicate_request_aux loc uiinfo requested in
let@ oarg_item_bt = WellTyped.oarg_bt_of_pred loc requested.name in
let@ oarg_item_bt = WellTyped.WRS.oarg_bt_of_pred loc requested.name in
match o_oarg with
| None -> return None
| Some (oarg, rw_time) ->
Expand Down
4 changes: 2 additions & 2 deletions backend/cn/lib/typing.ml
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,9 @@ let pause_to_result (pause : 'a pause) : 'a Or_TypeError.t = Result.map fst paus

let pure (m : 'a t) : 'a t =
fun s ->
Solver.push (Option.get s.solver);
Option.iter Solver.push s.solver;
let outcome = match m s with Ok (a, _) -> Ok (a, s) | Error e -> Error e in
Solver.pop (Option.get s.solver) 1;
Option.iter (fun s -> Solver.pop s 1) s.solver;
outcome


Expand Down
2 changes: 0 additions & 2 deletions backend/cn/lib/typing.mli
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
type solver

type 'a t

type 'a m = 'a t
Expand Down
Loading