mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-04-10 13:29:32 -06:00
22 lines
609 B
Plaintext
22 lines
609 B
Plaintext
import bool
|
|
import stoneage
|
|
|
|
monoid_Bool : sig { zero : Bool; plus : Bool -> Bool -> Bool }
|
|
monoid_Bool = rec
|
|
zero = False
|
|
plus = \x -> \y -> x && y
|
|
|
|
isSnake : (A : Tree) -> Tree A -> Bool
|
|
isSnake _ x = case x of
|
|
Snake -> True
|
|
_ -> composFold ? ? compos_Tree Bool monoid_Bool ? isSnake x
|
|
|
|
wideSnake : (A : Cat) -> Tree A -> Tree A
|
|
wideSnake _ x = case x of
|
|
Wide y -> let y' = wideSnake ? y
|
|
in if isSnake CN y' then Thick y' else Wide y'
|
|
_ -> composOp ? ? compos_Tree ? wideSnake x
|
|
|
|
wideSnakeNP : Tree NP -> Tree NP
|
|
wideSnakeNP = wideSnake NP
|