Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
personoj
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
koizel
personoj
Commits
34be791c
Commit
34be791c
authored
4 years ago
by
hondet
Browse files
Options
Downloads
Patches
Plain Diff
added stack
parent
b0c363de
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
paper/stack.lp
+28
-0
28 additions, 0 deletions
paper/stack.lp
with
28 additions
and
0 deletions
paper/stack.lp
0 → 100644
+
28
−
0
View file @
34be791c
require open personoj.encodings.lhol
require open personoj.encodings.pvs_cert
require open personoj.encodings.bool_hol
constant symbol stack: Set
constant symbol empty: El stack
definition nonempty_stack_p (s: El stack) ≔ ¬ (s = empty)
definition nonempty_stack ≔ psub nonempty_stack_p
constant symbol t: Set
symbol push: El t → El stack → El nonempty_stack
symbol pop: El nonempty_stack → El stack
symbol top: El nonempty_stack → El t
symbol push_top_pop (s: El stack) (hn: Prf (nonempty_stack_p s))
: let sne ≔ pair s hn in
Prf ((push (top sne) (pop sne)) = sne)
rule pop (push _ $s) ↪ $s
rule top (push $x _) ↪ $x
symbol pop_push (x: El t) (s: El stack): Prf ((pop (push x s)) = s)
symbol top_push (x: El t) (s: El stack): Prf ((top (push x s)) = x)
theorem pop2push2 (x y: El t) (s: El stack)
: Prf (pop (pair (pop (push x (fst (push y s)))) _) = s)
proof
qed
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment