mirror of
https://gitlab.com/scemama/QCaml.git
synced 2024-11-15 10:33:39 +01:00
23 lines
376 B
OCaml
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@]"
|
|
|