module Config.Pages.Debate.Arguments.Types exposing
    ( Argument
    , Notation(..)
    , logic
    )

import Config.Data.Hashtags.Types exposing (Hashtags(..))


type alias Argument =
    { argumentTitle : String
    , propositionTitle : String
    , propositionSummary : String
    , propositionReductio : String
    , proofLink : String
    , definitionTable : List Definition
    , argumentCertainty : Int
    , argumentImage : String
    , argumentHashtags : List Hashtags
    , isNewTabLink : Bool
    , argumentFormalization : List ArgumentEntry
    }


type alias ArgumentEntry =
    { premises : List PremiseWithNotation
    , conclusion : String
    , conclusionNotation : String
    }


type alias PremiseWithNotation =
    { premise : String
    , notation : String
    }


type alias Definition =
    { definiendum : String
    , definiens : String
    }


type Notation
    = Implies
    | Biconditional
    | Negation
    | Conjunction
    | Disjunction
    | Universal
    | Existential
    | Therefore
    | VariableW
    | VariableX
    | VariableY
    | VariableZ


logic : Notation -> String
logic operator =
    case operator of
        Implies ->
            "→"

        Biconditional ->
            "↔"

        Negation ->
            "¬"

        Conjunction ->
            "∧"

        Disjunction ->
            "∨"

        Universal ->
            "∀"

        Existential ->
            "∃"

        Therefore ->
            "∴"

        VariableW ->
            "𝑤"

        VariableX ->
            "𝑥"

        VariableY ->
            "𝑦"

        VariableZ ->
            "𝑧"
