feat(library/standard): add bit, char, and string types
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
This commit is contained in:
parent
0198dfc7c5
commit
9f9f93645b
3 changed files with 25 additions and 1 deletions
10
library/standard/bit.lean
Normal file
10
library/standard/bit.lean
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
-- Copyright (c) 2014 Microsoft Corporation. All rights reserved.
|
||||||
|
-- Released under Apache 2.0 license as described in the file LICENSE.
|
||||||
|
-- Author: Leonardo de Moura
|
||||||
|
namespace bit
|
||||||
|
inductive bit : Type :=
|
||||||
|
| b0 : bit
|
||||||
|
| b1 : bit
|
||||||
|
notation `'0` := b0
|
||||||
|
notation `'1` := b1
|
||||||
|
end
|
|
@ -1,2 +1,2 @@
|
||||||
import logic tactic num
|
import logic tactic num string
|
||||||
|
|
||||||
|
|
14
library/standard/string.lean
Normal file
14
library/standard/string.lean
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
-- Copyright (c) 2014 Microsoft Corporation. All rights reserved.
|
||||||
|
-- Released under Apache 2.0 license as described in the file LICENSE.
|
||||||
|
-- Author: Leonardo de Moura
|
||||||
|
import bit
|
||||||
|
using bit
|
||||||
|
|
||||||
|
namespace string
|
||||||
|
inductive char : Type :=
|
||||||
|
| ascii : bit → bit → bit → bit → bit → bit → bit → bit → char
|
||||||
|
|
||||||
|
inductive string : Type :=
|
||||||
|
| empty : string
|
||||||
|
| str : char → string → string
|
||||||
|
end
|
Loading…
Reference in a new issue