File: PatComplete.md

package info (click to toggle)
curry-tools 1.0.1%2Bdfsg1-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 5,492 kB
  • ctags: 121
  • sloc: makefile: 470; sh: 421
file content (34 lines) | stat: -rw-r--r-- 845 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
Pattern completeness analysis
-----------------------------

This analysis analyzes an operation for a pattern-complete definition.
An operation is pattern complete if each pattern match is
defined for all constructors.

For instance, the operation

    not True  = False
    not False = True

is pattern complete, whereas the operation

    head (x:_) = x

is incomplete. If an operation is defined by overlapping rules,
it is complete if there is one alternative with complete pattern matching.
For instance, the operation

    por True  x     = True
    por x     True  = True
    por False False = False

is not complete, since it corresponds to the following definition:

    por x y = por1 x y ? por2 x y
    
    por1 True  _     = True
    por1 False False = True
    
    por2 _     True  = True

Hence, each alternative is incomplete.