10
1
mirror of https://gitlab.com/scemama/QCaml.git synced 2024-11-15 10:33:39 +01:00
QCaml/CI/Phase.ml

27 lines
423 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-18 15:39:26 +01:00
let to_nperm = function
| Pos -> 0
| Neg -> 1
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@]"