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
d336b2e8
Commit
d336b2e8
authored
3 years ago
by
hondet
Browse files
Options
Downloads
Patches
Plain Diff
posix shell, no ksh needed
parent
7efed11f
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
.github/workflows/check_encoding.yml
+1
-1
1 addition, 1 deletion
.github/workflows/check_encoding.yml
specs/tools/pvs2dk.sh
+26
-17
26 additions, 17 deletions
specs/tools/pvs2dk.sh
with
27 additions
and
18 deletions
.github/workflows/check_encoding.yml
+
1
−
1
View file @
d336b2e8
...
...
@@ -44,7 +44,7 @@ jobs:
# Runs a set of commands using the runners shell
-
name
:
install lambdapi and deps
run
:
|
sudo apt install --yes bmake
ksh
perl
sudo apt install --yes bmake perl
(cd "${GITHUB_WORKSPACE}/lambdapi/" || exit 1
opam install .)
eval $(opam env)
...
...
This diff is collapsed.
Click to expand it.
specs/tools/pvs2dk.sh
+
26
−
17
View file @
d336b2e8
#!/bin/
k
sh
#!/bin/sh
# usage: pvs2dk.sh [options]
# -f p, --file p translate theory from file p
# -t h, --theory h translate theory t
# -o p, --output p write translation to file p
# -v n, --verbose n set verbosity level
set
-euf
o
pipefail
set
-euf
theory
=
""
file
=
""
output
=
""
verbose
=
3
USAGE
=
"[-author?Gabriel Hondet <gabriel.hondet@inria.fr>]"
USAGE+
=
"[+NAME?pvs2dk.sh --- Translate a PVS specification to Dedukti]"
USAGE+
=
"[+DESCRIPTION?Parse and proofcheck a theory in PVS to translate it
HELP
()
{
printf
'NAME: %s --- Translate a PVS specification to Dedukti
SYNOPSIS:
%s -f FILE -t THEORY -o OUTPUT
Options:
-f File containing the theory
-t Name of the theory to translate
-o Target file of the translation
DESCRIPTION:
Parse and proofcheck a theory in PVS to translate it
to Dedukti, an implementation of λΠ/R.
PVS filepaths are ALWAYS relative to the root of PVS. This restriction
...
...
@@ -25,22 +35,21 @@ Theories are translated one at a time using the -f and -t options,
such as in pvs2dk --file=lib/prelude.pvs --theory=booleans.
Translated files can be type checked by Lambdapi (taken from the PATH). Files to
be typechecked may be edited.]"
USAGE+
=
"[f:file?File containing the theory.]:[path]"
USAGE+
=
"[t:theory?Name of the theory to translate.]:[theory]"
USAGE+
=
"[o:output?Target file of the translation.]:[path]"
USAGE+
=
"[v:verbose]#[verbose:=3?Verbosity level.]"
USAGE+
=
$'
\n\n\n\n
'
while
getopts
"
${
USAGE
}
"
o
;
do
be typechecked may be edited.\n'
"
$0
"
"
$0
"
exit
1
}
while
getopts
'f:t:o:h'
o
;
do
case
"
$o
"
in
f
)
file
=
"
$(
realpath
"
${
OPTARG
}
"
)
"
;;
t
)
theory
=
"
${
OPTARG
}
"
;;
o
)
output
=
"
${
OPTARG
}
"
;;
v
)
verbose
=
"
${
OPTARG
}
"
h
)
HELP
;;
?
)
HELP
;;
esac
done
output
=
"
$(
realpath
$(
dirname
${
output
}
)
)
/
$(
basename
${
output
}
)
"
output
=
"
$(
realpath
"
$(
dirname
"
${
output
}
"
)
"
)
/
$(
basename
"
${
output
}
"
)
"
pvscmd
=
"(prettyprint-dedukti
\"
${
file
}
#
${
theory
}
\"
\"
${
output
}
\"
)"
(
cd
${
PVSPATH
:?
'PVSPATH not set'
}
||
exit
1
(
cd
"
${
PVSPATH
:?
'PVSPATH not set'
}
"
||
exit
1
./pvs
-raw
-E
"
${
pvscmd
}
"
--quit
)
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