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
104d5302
Commit
104d5302
authored
5 years ago
by
gabrielhdt
Browse files
Options
Downloads
Patches
Plain Diff
fixed implicit args of prod
parent
5a3ca41b
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
adlib/cert_f/booleans.lp
+6
-8
6 additions, 8 deletions
adlib/cert_f/booleans.lp
encodings/cert_f.lp
+4
-3
4 additions, 3 deletions
encodings/cert_f.lp
prelude/cert_f/logic.lp
+4
-9
4 additions, 9 deletions
prelude/cert_f/logic.lp
prelude/cert_f/numbers.lp
+3
-1
3 additions, 1 deletion
prelude/cert_f/numbers.lp
with
17 additions
and
21 deletions
adlib/cert_f/booleans.lp
+
6
−
8
View file @
104d5302
require open encodings.cert_f
definition bool ≔ uProp
definition false
: Term bool
≔ @prod Type Prop
uProp
(λ x, x)
definition true
: Term bool
≔ @prod Prop Prop false (λ _, false)
definition false ≔ @prod Type Prop
bool
(λ x, x)
definition true ≔ @prod Prop Prop false (λ _, false)
definition imp (P Q: Term uProp): Term bool ≔ @prod Prop Prop P (λ_, Q)
definition forall {eT: Term uType} (P: Term eT ⇒ Term bool): Term bool ≔
@prod _ _ eT P
definition imp (P Q: Term uProp) ≔ @prod Prop Prop P (λ_, Q)
definition forall {T: Term uType} (P: Term T ⇒ Term bool) ≔ @prod _ _ T P
definition bnot (P: Term uProp)
: Term bool
≔ @prod Prop Prop P (λ _, false)
definition bnot (P: Term uProp) ≔ @prod Prop Prop P (λ _, false)
set prefix 5 "¬" ≔ bnot
definition band (P Q: Term uProp) ≔ bnot (imp P (bnot Q))
...
...
@@ -20,11 +19,10 @@ definition biff (P Q: Term bool) ≔ (imp P Q) ∧ (imp Q P)
set infix 7 "⇔" ≔ biff
definition when (P Q: Term uProp) ≔ imp Q P
// FIXME explicitness?
set builtin "bot" ≔ false
set builtin "top" ≔ true
set builtin "imp" ≔ imp
set builtin "and" ≔ band
set builtin "or" ≔ bor
set builtin "or"
≔ bor
set builtin "not" ≔ bnot
This diff is collapsed.
Click to expand it.
encodings/cert_f.lp
+
4
−
3
View file @
104d5302
...
...
@@ -28,9 +28,10 @@ rule Term uProp → Univ Prop
and Term uType → Univ Type
// [prod s1 s2 A B] encodes [Π x : (A: s1). (B: s2)]
symbol prod {sA sB: Sort} (A: Univ sA): (Term A ⇒ Univ sB) ⇒ Univ (Rule sA sB)
symbol prod {sA: Sort} {sB: Sort} (A: Univ sA):
(Term A ⇒ Univ sB) ⇒ Univ (Rule sA sB)
rule Term (
@
prod &sA
&sB &A &B) → ∀ x : Term {&sA} &A, Term {&sB} (&B x)
rule Term (prod
{
&sA
} {
&sB
}
&A &B) → ∀ x : Term {&sA} &A, Term {&sB} (&B x)
// Predicate subtyping
// can be seen as a dependant pair type with
...
...
@@ -46,7 +47,7 @@ symbol fst {T: Univ Type} (P: Term T ⇒ Univ Prop): Term (Psub T P) ⇒ Term T
// Γ ⊢ M : { v : T | P }
// ——————————————————————————PROJr
// Γ ⊢ snd(M) : P[v ≔ fst(M)]
constant symbol snd {T: Univ Type}
(
P: Term T ⇒ Univ Prop
)
constant symbol snd {T: Univ Type}
{
P: Term T ⇒ Univ Prop
}
(M: Term (Psub T P)):
Term (P (fst P M))
...
...
This diff is collapsed.
Click to expand it.
prelude/cert_f/logic.lp
+
4
−
9
View file @
104d5302
...
...
@@ -12,10 +12,11 @@ require adlib.cert_f.subtype as S
//
symbol eq {T: Term uType}: Term T ⇒ Term T ⇒ Term uProp
set infix 5 "=" ≔ eq
// set builtin "eq" ≔ eq
// NOTE not in the prelude
constant symbol cast_trans (A B C: Term uType) (prab: Term (A ⊑ B))
(prbc: Term (B ⊑ C))
(x: Term A):
constant symbol cast_trans (A B C: Term uType) (prab: Term (A ⊑ B))
(prbc: Term (B ⊑ C))
(x: Term A):
Term (eq (↑ {B} C prbc (↑ {A} B prab x))
(↑ {A} C (S.trans A B C prab prbc) x))
...
...
@@ -80,7 +81,7 @@ definition ∃ {eT: Term uType} (P: Term eT ⇒ Term bool) ≔
//
// Defined types
//
definition pred (eT: Univ Type) ≔
@
prod
Type Type
eT (λ_, bool)
definition pred (eT: Univ Type) ≔ prod eT (λ_, bool)
definition PRED ≔ pred
definition predicate ≔ pred
definition PREDICATE ≔ pred
...
...
@@ -114,12 +115,6 @@ proof
qed
symbol reflexivity_of_equal T (x: Term T) : Term (eq x x)
// FIXME: carrying builtins over import?
set builtin "T" ≔ T
set builtin "P" ≔ P
// FIXME: could builtins be more flexible?
// set builtin "eq" ≔ eq
// set builtin "refl" ≔ reflexivity_of_equal
symbol transitivity_of_equal T (x y z: Term T) :
...
...
This diff is collapsed.
Click to expand it.
prelude/cert_f/numbers.lp
+
3
−
1
View file @
104d5302
...
...
@@ -47,7 +47,9 @@ definition nzreal ≔ nonzero_real
symbol closed_plus_real: ∀(x y: Term real),
let pr ≔ S.restr numfield real_pred in
Term (real_pred ((↑ numfield pr x) + (↑ numfield pr y)))
let xnf ≔ ↑ numfield pr x in
let ynf ≔ ↑ numfield pr y in
Term (real_pred (xnf + ynf))
symbol lt (x y: Term real): Term bool
...
...
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