Skip to content

Adapt "is_canonical" method to contemplate several formats of canonical expressions #25

@jmansilla

Description

@jmansilla

The is_canonical method should take an optional argument named "mode". By default mode should take the value "eager".

An expression is in canonical form if one of the following is met:

  • the root node is an instance of Lam
  • the root node is an instance of BooleanConstant
  • the root node is an instance of NaturalConstant
  • the root node is an instance of UnaryOperator who's operation is "-", and it's operand is a NaturalConstant
  • in mode "normal", if the root node is an instance of Tuple
  • in mode "eager", the root node is an instance of Tuple, and every sub-expression of the tuple is in canonical_form as well

Tasks:

  • adapt method
  • add correspondent tests cases

Metadata

Metadata

Assignees

No one assigned

    Labels

    logicWork on logic of expressions manipulation

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions