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
96cc7612
Commit
96cc7612
authored
3 years ago
by
hondet
Browse files
Options
Downloads
Patches
Plain Diff
super projector
parent
55be04b4
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
personoj/proj.lp
+2
-2
2 additions, 2 deletions
personoj/proj.lp
personoj/tuple.lp
+0
-30
0 additions, 30 deletions
personoj/tuple.lp
with
2 additions
and
32 deletions
personoj/proj.lp
+
2
−
2
View file @
96cc7612
...
...
@@ -5,8 +5,8 @@ symbol Proj : Nat → Nat → Π (a: Set), El a → TYPE;
rule Proj 0 0 $a _ ↪ El $a with
Proj 0 (succ _) (Σ $a _) _ ↪ El $a with
Proj 0 (succ _) (σ $a _) _ ↪ El $a with
Proj (succ $n) (succ $l) (Σ _ $u)
(consd $x $y)
↪ Proj $n $l ($u $x)
$y
with
Proj (succ $n) (succ $l) (σ _ $u)
(cons _ $y)
↪ Proj $n $l $u
$y
;
Proj (succ $n) (succ $l) (Σ _ $u)
$x
↪ Proj $n $l ($u
(card
$x)
)
(cdrd $x)
with
Proj (succ $n) (succ $l) (σ _ $u)
$x
↪ Proj $n $l $u
(cdr $x)
;
assert (T: Set) (U: Set) (x: El T) (y: El U) ⊢ Proj 1 1 (σ T U) (cons x y) ≡ El U;
assert (T: Set) (U: El T → Set) (x: El T) (y: El (U x)) ⊢ Proj 1 1 (Σ T U) (consd x y) ≡ El (U x);
...
...
This diff is collapsed.
Click to expand it.
personoj/tuple.lp
+
0
−
30
View file @
96cc7612
...
...
@@ -7,33 +7,3 @@ symbol car {a: Set} {b: Set}: El (σ a b) → El a;
symbol cdr {a: Set} {b: Set}: El (σ a b) → El b;
rule car (cons $x _) ↪ $x;
rule cdr (cons _ $y) ↪ $y;
require open personoj.nat;
/// [Proj n l t] returns the element at index [n] of tuple [t] of length [l].
symbol Proj : Nat → Nat → Set → TYPE;
rule Proj 0 0 $t ↪ El $t
with Proj 0 (succ _) (σ $t _) ↪ El $t
with Proj (succ $n) (succ $l) (σ _ $u) ↪ Proj $n $l $u;
/// [proj n l e] returns the element at index [n] of list (made of pairs) [e] of
/// length [l], where [length (σ _ B) = 1 + length B] and [length t = 0] if [t]
/// is not a pair.
symbol proj {A: Set} {B: Set} (n: Nat) (m: Nat) (_: El (σ A B)):
Proj n m (σ A B);
rule proj 0 (succ _) $e ↪ car $e
with proj 1 1 $e ↪ cdr $e
with @proj $A (σ $B1 $B2) (succ $n) (succ $l) $e
↪ @proj $B1 $B2 $n $l (@cdr $A (σ $B1 $B2) $e);
assert (T: Set) (U: Set) ⊢ Proj 1 1 (σ T U) ≡ El U;
assert (T: Set) (U: Set) ⊢ Proj 0 1 (σ T U) ≡ El T;
assert (T: Set) (U: Set) (V: Set) ⊢ Proj 2 2 (σ T (σ U V)) ≡ El V;
assert (T: Set) (e: El T) (e': El T) ⊢ proj 1 1 (cons e e') ≡ e';
assert (T: Set) (e: El T) (e': El T) ⊢ proj 0 1 (cons e e') ≡ e;
assert (T: Set) (U: Set) (V: Set) (et: El T) (eu: El U) (ev: El V) ⊢
proj 2 2 (cons et (cons eu ev)) ≡ ev;
assert (T: Set) (U: Set) (V: Set) (et: El T) (eu: El U) (ev: El V) ⊢
proj 1 2 (cons et (cons eu ev)) ≡ eu;
assert (T: Set) (U: Set) (V: Set) (et: El T) (eu: El U) (ev: El V) ⊢
proj 0 2 (cons et (cons eu ev)) ≡ et;
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