(**************************************************************************)
(*                                BELENIOS                                *)
(*                                                                        *)
(*  Copyright © 2012-2021 Inria                                           *)
(*                                                                        *)
(*  This program is free software: you can redistribute it and/or modify  *)
(*  it under the terms of the GNU Affero General Public License as        *)
(*  published by the Free Software Foundation, either version 3 of the    *)
(*  License, or (at your option) any later version, with the additional   *)
(*  exemption that compiling, linking, and/or using OpenSSL is allowed.   *)
(*                                                                        *)
(*  This program is distributed in the hope that it will be useful, but   *)
(*  WITHOUT ANY WARRANTY; without even the implied warranty of            *)
(*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU     *)
(*  Affero General Public License for more details.                       *)
(*                                                                        *)
(*  You should have received a copy of the GNU Affero General Public      *)
(*  License along with this program.  If not, see                         *)
(*  <http://www.gnu.org/licenses/>.                                       *)
(**************************************************************************)

<doc text="Serializable datatypes for non-homomorphic questions">

(** {2 Predefined types} *)

type 'a ciphertext <ocaml predef from="Belenios_core.Serializable_core"> = abstract
type 'a proof <ocaml predef from="Belenios_core.Serializable_core"> = abstract

(** {2 Questions and answers} *)

type question = {
  answers : string list <ocaml repr="array">;
  question : string;
} <ocaml field_prefix="q_">

type ('a, 'b) answer = {
  choices : 'a ciphertext;
  proof : 'b proof;
}
<doc text="An answer to a question.">

type result = int list <ocaml repr="array"> list <ocaml repr="array">

(** {2 Counting methods} *)

type mj_extra = {
  blank : bool;
  grades : string list <ocaml repr="array">;
} <ocaml field_prefix="mj_extra_">

type schulze_extra = {
  blank : bool;
} <ocaml field_prefix="schulze_extra_">

type stv_extra = {
  blank : bool;
  seats : int;
} <ocaml field_prefix="stv_extra_">
