Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
LATIN2
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
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
MMT
LATIN2
Commits
2dc7c069
Unverified
Commit
2dc7c069
authored
1 year ago
by
ColinRothgang
Browse files
Options
Downloads
Patches
Plain Diff
Support higher-order dependencies
parent
c8fec433
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
scala/latin2/tptp/DHOLExporter.scala
+6
-1
6 additions, 1 deletion
scala/latin2/tptp/DHOLExporter.scala
scala/latin2/tptp/DIHOLExporter.scala
+7
-1
7 additions, 1 deletion
scala/latin2/tptp/DIHOLExporter.scala
with
13 additions
and
2 deletions
scala/latin2/tptp/DHOLExporter.scala
+
6
−
1
View file @
2dc7c069
...
...
@@ -102,7 +102,7 @@ class DHOLExporter extends DIHOLExporter {
override
def
translate_term
(
t
:
Term
)
:
THF.Formula
=
{
t
match
{
case
Lambda
(
v
,
ty
,
body
)
=>
THF
.
QuantifiedFormula
(
THF
.^,
Seq
((
translate_var_name
(
v
),
translate_type
(
ty
))),
translate_term
(
body
))
THF
.
QuantifiedFormula
(
THF
.^,
Seq
((
translate_var_name
(
v
),
translate_type
(
ty
))),
translate_term
(
body
))
case
tforall
((
ty
,
Lambda
(
v
,
_
,
body
)))
=>
relativized_forall
(
v
,
ty
,
body
)
case
texists
((
ty
,
Lambda
(
v
,
_
,
body
)))
=>
...
...
@@ -115,6 +115,8 @@ class DHOLExporter extends DIHOLExporter {
val
varname
=
Context
.
pickFresh
(
body
.
freeVars
.
map
(
VarDecl
(
_
)),
LocalName
(
"X"
)).
_1
translate_term
(
texists
(
ty
,
Lambda
(
varname
,
ty
,
ApplySpine
(
body
,
OMV
(
varname
)))))
case
tequal
(
tp
,
s
,
t
)
=>
type_rel
(
tp
,
translate_term
(
s
),
translate_term
(
t
))
// TODO: This case shouldn't be necessary
case
ft
@FunType
(
args
,
bdy
)
if
args
.
length
>
0
=>
translate_type
(
ft
)
case
_
=>
super
.
translate_term
(
t
)
}
}
...
...
@@ -153,6 +155,9 @@ class DHOLExporter extends DIHOLExporter {
case
None
=>
newTypeRelVarName
(
None
,
xTp
)(
controller
)
}
typeRelFuncType
(
x
,
xTp
,
FunType
(
tl
,
codomain
))
// type variables, not really supported so we fall back to plain equality
// TODO: rethink this
case
ApplyGeneral
(
OMV
(
n
),
args
)
=>
THF
.
BinaryFormula
(
THF
.
Eq
,
left
,
right
)
case
_
=>
UNSUPPORTED
(
"Typing relation not defined on unsupported type "
+
controller
.
presenter
.
asString
(
tp
))
}
...
...
This diff is collapsed.
Click to expand it.
scala/latin2/tptp/DIHOLExporter.scala
+
7
−
1
View file @
2dc7c069
...
...
@@ -164,7 +164,7 @@ class DIHOLExporter extends logicExporter {
def
translate_term
(
t
:
Term
)
:
THF.Formula
=
{
t
match
{
case
Lambda
(
v
,
ty
,
body
)
=>
THF
.
QuantifiedFormula
(
THF
.^,
Seq
((
translate_var_name
(
v
),
translate_type
(
ty
))),
translate_term
(
body
))
THF
.
QuantifiedFormula
(
THF
.^,
Seq
((
translate_var_name
(
v
),
translate_type
(
ty
))),
translate_term
(
body
))
case
DependentFunctions
.
deplambda
(
_
,
_
,
f
)
=>
translate_term
(
f
)
case
DependentFunctions
.
depapply
(
_
,
_
,
f
,
x
)
=>
THFApp
(
translate_term
(
f
),
translate_term
(
x
))
...
...
@@ -391,6 +391,12 @@ object DIHOLExporterUtil {
DHOLAxiom
(
Context
.
empty
,
ax
)
case
OMBINDC
(
binder
,
context
,
List
(
scopes
))
if
binder
.
toStr
(
true
)
==
"unknown"
=>
// this case shouldn't be necessary
unapplyPis
(
lf
.
Proofs
.
ded
(
scopes
))
// case of a dependent type with no (further) arguments
case
depType
@ApplyGeneral
(
fun
,
args
)
=>
DHOLTermDeclaration
(
Context
.
empty
,
Context
.
empty
,
depType
)
case
default
=>
println
(
"Unexpected type in declaration: "
+
default
.
toStr
(
true
))
DHOLTermDeclaration
(
Context
.
empty
,
Context
.
empty
,
default
)
}
def
is_bool_valued
(
ty
:
Term
)
:
Boolean
=
ty
match
{
...
...
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