Skip to content

statics-bool.stx

pdmosses/metaborg-poosl/org.metaborg.lang.poosl/trans/statics-bool.stx

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
module statics-bool

signature

    sorts
        

    constructors
         : TYPE_BOOL
         : TYPE_BOOL

rules

     : list(TYPE_BOOL) -> TYPE_BOOL
    forall([]          ) = TRUE().
    forall([FALSE()|Ts]) = FALSE().
    forall([TRUE() |Ts]) = forall(Ts).

     : TYPE_BOOL * TYPE_BOOL -> TYPE_BOOL
    bool_and(FALSE(), _      ) = FALSE().
    bool_and(TRUE() , x      ) = x.
//  bool_and(_      , FALSE()) = FALSE().
//  bool_and(x      , TRUE() ) = x.

     : TYPE_BOOL * TYPE_BOOL -> TYPE_BOOL
    or(FALSE(), x      ) = x.
    or(TRUE() , _      ) = TRUE().
//  or(x      , FALSE()) = x.
//  or(_      , TRUE() ) = TRUE().