10
1
mirror of https://gitlab.com/scemama/QCaml.git synced 2024-07-05 02:45:50 +02:00
QCaml/CI/Phase.ml

23 lines
376 B
OCaml
Raw Normal View History

2019-02-15 13:48:48 +01:00
type t =
| Pos
| Neg
let of_nperm nperm =
if (nperm land 1) = 1 then Neg
else Pos
2019-02-15 16:25:47 +01:00
let add_nperm phase = function
| 0 -> phase
| nperm ->
begin
match (phase, of_nperm nperm) with
| (Pos,Pos) | (Neg,Neg) -> Pos
| _ -> Neg
end
2019-02-15 23:11:37 +01:00
2019-02-15 16:25:47 +01:00
2019-02-15 13:48:48 +01:00
let pp_phase ppf = function
| Pos -> Format.fprintf ppf "@[<h>+1@]"
| Neg -> Format.fprintf ppf "@[<h>-1@]"