Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
C
cpdt
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
research
cpdt
Commits
63785816
Commit
63785816
authored
Oct 06, 2011
by
Adam Chlipala
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Hide some more Subset code in template
parent
e660789e
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
0 deletions
+10
-0
Subset.v
src/Subset.v
+10
-0
No files found.
src/Subset.v
View file @
63785816
...
...
@@ -484,6 +484,8 @@ let rec eq_nat_dec' n m0 =
We
can
build
%
``
%
#
"#smart#"
#
%
''
%
versions
of
the
usual
boolean
operators
and
put
them
to
good
use
in
certified
programming
.
For
instance
,
here
is
a
[
sumbool
]
version
of
boolean
%
``
%
#
"#or.#"
#
%
''
%
*
)
(
*
EX
:
Write
a
function
that
decides
if
an
element
belongs
to
a
list
.
*
)
(
*
begin
thide
*
)
Notation
"x || y"
:=
(
if
x
then
Yes
else
Reduce
y
)
.
...
...
@@ -638,12 +640,16 @@ Notation "x <- e1 ; e2" := (match e1 with
This
notation
is
very
helpful
for
composing
richly
typed
procedures
.
For
instance
,
here
is
a
very
simple
implementation
of
a
function
to
take
the
predecessors
of
two
naturals
at
once
.
*
)
(
*
EX
:
Write
a
function
that
tries
to
compute
predecessors
of
two
[
nat
]
s
at
once
.
*
)
(
*
begin
thide
*
)
Definition
doublePred
:
forall
n1
n2
:
nat
,
{{
p
|
n1
=
S
(
fst
p
)
/
\
n2
=
S
(
snd
p
)
}}.
refine
(
fun
n1
n2
=>
m1
<-
pred_strong7
n1
;
m2
<-
pred_strong7
n2
;
[
|
(
m1
,
m2
)
|
])
;
tauto
.
Defined
.
(
*
end
thide
*
)
(
**
We
can
build
a
[
sumor
]
version
of
the
%
``
%
#
"#bind#"
#
%
''
%
notation
and
use
it
to
write
a
similarly
straightforward
version
of
this
function
.
*
)
...
...
@@ -657,6 +663,9 @@ Notation "x <-- e1 ; e2" := (match e1 with
(
**
printing
*
$
\
times
$
*
)
(
*
EX
:
Write
a
more
expressively
typed
version
of
the
last
exercise
.
*
)
(
*
begin
thide
*
)
Definition
doublePred
'
:
forall
n1
n2
:
nat
,
{
p
:
nat
*
nat
|
n1
=
S
(
fst
p
)
/
\
n2
=
S
(
snd
p
)
}
+
{
n1
=
0
\
/
n2
=
0
}.
...
...
@@ -665,6 +674,7 @@ Definition doublePred' : forall n1 n2 : nat,
m2
<--
pred_strong8
n2
;
[
||
(
m1
,
m2
)
||
])
;
tauto
.
Defined
.
(
*
end
thide
*
)
(
**
*
A
Type
-
Checking
Example
*
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment