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
2bd35f8f
Commit
2bd35f8f
authored
4 years ago
by
gabrielhdt
Browse files
Options
Downloads
Patches
Plain Diff
laziness, booleans
parent
134b71d9
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
adlib/booleans.lp
+27
-0
27 additions, 0 deletions
adlib/booleans.lp
encodings/lazy.lp
+8
-25
8 additions, 25 deletions
encodings/lazy.lp
encodings/subtype.lp
+5
-5
5 additions, 5 deletions
encodings/subtype.lp
prelude/logic2.lp
+4
-4
4 additions, 4 deletions
prelude/logic2.lp
with
44 additions
and
34 deletions
adlib/booleans.lp
0 → 100644
+
27
−
0
View file @
2bd35f8f
require open
personoj.encodings.lhol
personoj.encodings.pvs_cert
definition false ≔ forall {bool} (λx, x)
definition true ≔ impd {false} (λ_, false)
definition imp P Q ≔ impd {P} (λ_, Q)
definition bnot P ≔ impd {P} (λ_, false)
definition band P Q ≔ bnot (imp P (bnot Q))
definition bor P Q ≔ imp (bnot P) Q
set prefix 5 "¬" ≔ bnot
set infix 6 "∧" ≔ band
set infix 5 "∨" ≔ bor
definition biff P Q ≔ (imp P Q) ∧ (imp Q P)
set infix 7 "⇔" ≔ biff
definition when P Q ≔ imp Q P
set builtin "bot" ≔ false
set builtin "top" ≔ true
set builtin "imp" ≔ imp
set builtin "not" ≔ bnot
set builtin "and" ≔ band
set builtin "or" ≔ bor
This diff is collapsed.
Click to expand it.
encodings/lazy.lp
+
8
−
25
View file @
2bd35f8f
...
...
@@ -2,32 +2,15 @@ require open
personoj.encodings.lhol
personoj.encodings.pvs_cert
definition false ≔ forall {bool} (λx, x)
definition true ≔ impd {false} (λ_, false)
constant symbol delayed: Set ⇒ TYPE
constant symbol quote {T: Set}: η T ⇒ delayed T
definition imp P Q ≔ impd {P} (λ_, Q)
constant symbol s_app: Set ⇒ Set ⇒ Set
definition bnot P ≔ impd {P} (λ_, false)
definition band P Q ≔ bnot (imp P (bnot Q))
definition bor P Q ≔ imp (bnot P) Q
set prefix 5 "¬" ≔ bnot
set infix 6 "∧" ≔ band
set infix 5 "∨" ≔ bor
constant symbol app {T: Set} {S: Set}
: delayed T ⇒ delayed S ⇒ delayed (s_app T S)
definition biff P Q ≔ (imp P Q) ∧ (imp Q P)
set infix 7 "⇔" ≔ biff
symbol unquote {T: Set}: delayed T ⇒ η T
definition when P Q ≔ imp Q P
set builtin "bot" ≔ false
set builtin "top" ≔ true
set builtin "imp" ≔ imp
set builtin "not" ≔ bnot
set builtin "and" ≔ band
set builtin "or" ≔ bor
// Lazy reduction rules
//rule bor true → λ_, true
//rule bor false → λx, x
//rule band true → λx, x
//rule band false → λ_, false
rule unquote (quote &x) → &x
rule unquote {&S} (app {&T ~> &S} {&T} &t &u) → (unquote &t) (unquote &u)
This diff is collapsed.
Click to expand it.
encodings/subtype.lp
+
5
−
5
View file @
2bd35f8f
...
...
@@ -4,13 +4,13 @@ require open personoj.encodings.pvs_cert
symbol subtype : Set ⇒ Set ⇒ Bool
set infix left 6 "⊑" ≔ subtype
symbol Refl (a: Set): ε (a ⊑ a)
symbol Trans (s t u: Set): ε (s ⊑ t) ⇒ ε (t ⊑ u) ⇒ ε (s ⊑ u)
symbol
S_
Refl (a: Set): ε (a ⊑ a)
symbol
S_
Trans (s t u: Set): ε (s ⊑ t) ⇒ ε (t ⊑ u) ⇒ ε (s ⊑ u)
symbol Restr {a: Set} (p: η a ⇒ Bool): ε (psub p ⊑ a)
symbol
S_
Restr {a: Set} (p: η a ⇒ Bool): ε (psub p ⊑ a)
symbol Arr (t u1 u2: Set): ε (u1 ⊑ u2) ⇒ ε ((t ~> u1) ⊑ (t ~> u2))
symbol Darr (d: Set) (r1: η d ⇒ Set) (r2: η d ⇒ Set)
symbol
S_
Arr (t u1 u2: Set): ε (u1 ⊑ u2) ⇒ ε ((t ~> u1) ⊑ (t ~> u2))
symbol
S_
Darr (d: Set) (r1: η d ⇒ Set) (r2: η d ⇒ Set)
: ε (forall (λx, (r1 x) ⊑ (r2 x))) ⇒ ε ((arrd r1) ⊑ (arrd r2))
symbol upcast {A: Set} {B: Set}: ε (A ⊑ B) ⇒ η A ⇒ η B
...
...
This diff is collapsed.
Click to expand it.
prelude/logic2.lp
+
4
−
4
View file @
2bd35f8f
...
...
@@ -4,7 +4,7 @@ require open
personoj.encodings.equality
personoj.encodings.prenex
personoj.encodings.if
personoj.
encodings.lazy
personoj.
adlib.booleans
personoj.encodings.subtype
definition neq {T: Set} (x y: η T) ≔ bnot (eq x y)
...
...
@@ -35,7 +35,7 @@ theorem xor_def
(forall {bool} (λb, eq {bool}
(xor a b)
(if {bool} {bool} bool
(Refl bool) (Refl bool)
(
S_
Refl bool) (
S_
Refl bool)
a (bnot b) b)))))
proof
simpl
...
...
@@ -91,7 +91,7 @@ theorem lift_if1
forall
{s ~> t}
(λf, eq
(f (if s (Refl s) (Refl s) a x y))
(if t (Refl t) (Refl t) a (f x) (f y)))))))))))
(f (if s (
S_
Refl s) (
S_
Refl s) a x y))
(if t (
S_
Refl t) (
S_
Refl t) a (f x) (f y)))))))))))
proof
admit
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