Documentation Index
Fetch the complete documentation index at: https://docs.canton.network/llms.txt
Use this file to discover all available pages before exploring further.
DA.Logic
Logic - Propositional calculus.Module Snapshot
Lifecycle
Stable.
Notices
Status:
active
Introduced in: 3.4.9
Removed in: -
Warnings: 0
Deprecations: 0
Deprecated since: -Data Types
data Formula t
A Formula t is a formula in propositional calculus with
propositions of type t.
Constructors:
Proposition tProposition pis the formula p
Negation (Formula t)For a formula f,Negation fis ¬f
Conjunction [Formula t]For formulas f1, …, fn,Conjunction [f1, ..., fn]is f1 ∧ … ∧ fn
Disjunction [Formula t]For formulas f1, …, fn,Disjunction [f1, ..., fn]is f1 ∨ … ∨ fn
instance Action Formulainstance Applicative Formulainstance Functor Formulainstance Eq t => Eq (Formula t)instance Ord t => Ord (Formula t)instance Show t => Show (Formula t)
Functions
&&&
&&& is the ∧ operation of the boolean algebra of formulas, to
be read as “and”
|||
||| is the ∨ operation of the boolean algebra of formulas, to
be read as “or”
true
true is the 1 element of the boolean algebra of formulas,
represented as an empty conjunction.
false
false is the 0 element of the boolean algebra of formulas,
represented as an empty disjunction.
neg
neg is the ¬ (negation) operation of the boolean algebra of
formulas.
conj
conj is a list version of &&&, enabled by the associativity
of ∧.
disj
disj is a list version of |||, enabled by the associativity
of ∨.
fromBool
fromBool converts True to true and False to false.
toNNF
toNNF transforms a formula to negation normal form
(see https://en.wikipedia.org/wiki/Negation_normal_form).
toDNF
toDNF turns a formula into disjunctive normal form.
(see https://en.wikipedia.org/wiki/Disjunctive_normal_form).
traverse
traverse in the usual sense.
zipFormulas
zipFormulas takes to formulas of same shape, meaning only
propositions are different and zips them up.
substitute
substitute takes a truth assignment and substitutes True or
False into the respective places in a formula.
reduce
reduce reduces a formula as far as possible by:
- Removing any occurrences of
trueandfalse; - Removing directly nested Conjunctions and Disjunctions;
- Going to negation normal form.
isBool
isBool attempts to convert a formula to a bool. It satisfies
isBool true == Some True and isBool false == Some False.
Otherwise, it returns None.
interpret
interpret is a version of toBool that first substitutes using
a truth function and then reduces as far as possible.
substituteA
substituteA is a version of substitute that allows for truth
values to be obtained from an action.
interpretA
interpretA is a version of interpret that allows for truth
values to be obtained form an action.
Orphan Typeclass Instances
-
instance Eq t => Eq (Formula t) -
instance Ord t => Ord (Formula t) -
instance Show t => Show (Formula t) -
instance Functor Formula -
instance Applicative Formula -
instance Action Formula