feat(library/standard): add bit, char, and string types

Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
This commit is contained in:
Leonardo de Moura 2014-07-02 08:36:05 -07:00
parent 0198dfc7c5
commit 9f9f93645b
3 changed files with 25 additions and 1 deletions

10
library/standard/bit.lean Normal file
View 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

View file

@ -1,2 +1,2 @@
import logic tactic num import logic tactic num string

View 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