Skip to content

Test if-statement syntax and semantics #9

@cowang

Description

@cowang

Write a Cucumber feature with the if-then- and if-then-else syntax and semantics

  • allow either blocks or individual statements that are interpreted as trivial blocks
  • show an if-then statement whose proof fails because an assigned value in the then-block isn't dealt with when the condition is false
  • show how we need a trivial assignment, which is ignored in implementation, where we would normally use an if-then statement
  • mention that an if-then statement might be useful for non-tracked state-change, such as logging
  • show several equivalent ways to interpret an if-then-else in a means-statement

Semantics

A natural semantics for the if-then-else-statement is
(Condition -> Then-semantics) /\ (~Condition -> Else-semantics) but use the equivalent
(Condition /\ Then-semantics) \/ (~Condition /\ Else-semantics) to reduce the number of disjunctions, since implication is implicitly a disjunction.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions