mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-05-17 15:12:50 -06:00
23 lines
375 B
Plaintext
23 lines
375 B
Plaintext
concrete basic_cnc of basic = open Prelude in {
|
|
|
|
lincat N = {s : Str; is_zero : Bool} ;
|
|
lincat S = Str ;
|
|
|
|
printname fun z = "0" ;
|
|
printname fun s = "1" ;
|
|
|
|
lin z = {s="0"; is_zero=True} ;
|
|
s n = {
|
|
s = case n.is_zero of {
|
|
True => "1" ;
|
|
False => n.s ++ "+" ++ "1"
|
|
} ;
|
|
is_zero = False
|
|
} ;
|
|
|
|
lin c n = n.s ;
|
|
|
|
lincat P = {};
|
|
|
|
}
|