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
44bcb558
Commit
44bcb558
authored
3 years ago
by
hondet
Browse files
Options
Downloads
Patches
Plain Diff
new equality
parent
551f8e76
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
encoding/eq.lp
+23
-0
23 additions, 0 deletions
encoding/eq.lp
specs/src/pp-dk3.lisp
+9
-9
9 additions, 9 deletions
specs/src/pp-dk3.lisp
with
32 additions
and
9 deletions
encoding/eq.lp
0 → 100644
+
23
−
0
View file @
44bcb558
// Equality
require open personoj.lhol personoj.pvs_cert personoj.tuple personoj.logical;
symbol = {a: Set} (_ _: El a): Prop;
symbol eqind {a: Set} (p: El a → Prop) (x y: El a): Prf (p x) → Prf (@= a x y) → Prf (p y);
symbol refl {a: Set} (x: El a): Prf (@= a x x);
opaque symbol eq_psub (a: Set) (t u: El a) (p: El a → Prop)
(ht: Prf (p t)) (hu: Prf (p u))
(e: Prf (@= a t u)):
Prf (@= (@psub a p) (@pair a p t ht) (@pair a p u hu)) ≔
@eqind a
(λ x: El a, (p x) ⇒ (λ h: Prf (p x), @= (@psub a p) (@pair a p t ht) (@pair a p x h))) t u
(λ ht': Prf (p t), @refl (@psub a p) (@pair a p t ht')) e hu;
// Equality operates on the maximal supertype. It allows to profit
// from predicate subtyping for free in the propositional equality.
//rule @eq (@psub $t $p) ($x ^ $y ^ ^nil)
// ↪ @eq $t ((@fst $t $p $x) ^ (@fst $t $p $y) ^ ^nil);
symbol != {a: Set} (x y: El a) ≔ ¬ (@= a x y);
This diff is collapsed.
Click to expand it.
specs/src/pp-dk3.lisp
+
9
−
9
View file @
44bcb558
...
...
@@ -88,7 +88,7 @@ BODY."
(
set-workdir
(
uiop:pathname-directory-pathname
path
))
(
with-open-file
(
stream
file
:direction
:output
:if-exists
:supersede
)
(
princ
"require open personoj.lhol personoj.tuple personoj.sum
personoj.logical personoj.pvs_cert personoj.eq
tup
;
personoj.logical personoj.pvs_cert personoj.eq;
require open personoj.nat personoj.coercions;
require personoj.extra.arity-tools as A;"
stream
)
(
fresh-line
stream
)
...
...
@@ -928,8 +928,8 @@ as ``f (σcons e1 e2) (σcons g1 g2)''."
;;; REVIEW: factorise disequation and equation
(
defmethod
pp-dk
(
stream
(
ex
dis
equation
)
&optional
colon-p
at-sign-p
)
"
/
=(A, B)"
(
defmethod
pp-dk
(
stream
(
ex
equation
)
&optional
colon-p
at-sign-p
)
"=(A, B)"
(
with-parens
(
stream
colon-p
)
(
let*
((
eq-ty
(
type
(
operator
ex
)))
(
dom
(
types
(
domain
eq-ty
)))
...
...
@@ -937,11 +937,11 @@ as ``f (σcons e1 e2) (σcons g1 g2)''."
(
tyr
(
cadr
dom
)))
(
assert
(
equal
tyl
tyr
))
(
with-binapp-args
(
argl
argr
ex
)
(
format
stream
"@
neq
~:/pvs:pp-dk/ ~:/pvs:pp-dk/"
tyl
(
make!-tuple-expr
(
list
argl
argr
)))))
))
(
format
stream
"@
= ~:/pvs:pp-dk/
~:/pvs:pp-dk/ ~:/pvs:pp-dk/"
tyl
argl
argr
)))))
(
defmethod
pp-dk
(
stream
(
ex
equation
)
&optional
colon-p
at-sign-p
)
"=(A, B)"
(
defmethod
pp-dk
(
stream
(
ex
dis
equation
)
&optional
colon-p
at-sign-p
)
"
/
=(A, B)"
(
with-parens
(
stream
colon-p
)
(
let*
((
eq-ty
(
type
(
operator
ex
)))
(
dom
(
types
(
domain
eq-ty
)))
...
...
@@ -949,8 +949,8 @@ as ``f (σcons e1 e2) (σcons g1 g2)''."
(
tyr
(
cadr
dom
)))
(
assert
(
equal
tyl
tyr
))
(
with-binapp-args
(
argl
argr
ex
)
(
format
stream
"@
eq
~:/pvs:pp-dk/ ~:/pvs:pp-dk/"
tyl
(
make!-tuple-expr
(
list
argl
argr
)))))
))
(
format
stream
"@
!= ~:/pvs:pp-dk/
~:/pvs:pp-dk/ ~:/pvs:pp-dk/"
tyl
argl
argr
)))))
(
defmethod
pp-dk
(
stream
(
ex
conjunction
)
&optional
colon-p
at-sign-p
)
"AND(A, B)"
...
...
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