10
1
mirror of https://gitlab.com/scemama/QCaml.git synced 2024-11-06 22:23:42 +01:00
QCaml/CI/Phase.ml

23 lines
376 B
OCaml

type t =
| Pos
| Neg
let of_nperm nperm =
if (nperm land 1) = 1 then Neg
else Pos
let add_nperm phase = function
| 0 -> phase
| nperm ->
begin
match (phase, of_nperm nperm) with
| (Pos,Pos) | (Neg,Neg) -> Pos
| _ -> Neg
end
let pp_phase ppf = function
| Pos -> Format.fprintf ppf "@[<h>+1@]"
| Neg -> Format.fprintf ppf "@[<h>-1@]"