Nasty.AST.Semantic.Modality (Nasty v0.3.0)
View SourceModality node representing epistemic and deontic modality.
Modality expresses the speaker's attitude toward the proposition: necessity, possibility, certainty, obligation, permission, etc.
Summary
Types
@type modal_strength() :: float()
Strength of the modal (0.0 to 1.0).
- 1.0 = Strong modality ("must", "certainly")
- 0.5 = Medium modality ("should", "probably")
- 0.0 = Weak modality ("might", "possibly")
@type modality_type() ::
:certainty
| :probability
| :possibility
| :necessity
| :obligation
| :permission
| :ability
Modality type classification.
Epistemic (knowledge-related)
:certainty- High confidence ("certainly", "definitely"):probability- Likely but not certain ("probably", "likely"):possibility- May or may not be true ("possibly", "maybe")
Deontic (obligation/permission-related)
:necessity- Required ("must", "have to"):obligation- Expected ("should", "ought to"):permission- Allowed ("can", "may")
Dynamic (ability-related)
:ability- Capable of ("can", "able to")
@type t() :: %Nasty.AST.Semantic.Modality{ marker: Nasty.AST.Token.t(), span: Nasty.AST.Node.span(), strength: modal_strength(), type: modality_type() }