Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
COLIBRI
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
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
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
pub
COLIBRI
Commits
f1b7e237
Commit
f1b7e237
authored
4 years ago
by
François Bobot
Browse files
Options
Downloads
Patches
Plain Diff
Compile and execute on windows
parent
b05903bc
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!7
Add a wrapper for colibri in ocaml (cross-platform)
Pipeline
#27679
passed
4 years ago
Stage: test
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
colibri_for_bundle.ml
+50
-22
50 additions, 22 deletions
colibri_for_bundle.ml
compile_colibri.bat
+10
-0
10 additions, 0 deletions
compile_colibri.bat
compile_colibri.sh
+1
-1
1 addition, 1 deletion
compile_colibri.sh
with
61 additions
and
23 deletions
colibri_for_bundle.ml
+
50
−
22
View file @
f1b7e237
let
coldir
=
Filename
.
dirname
Sys
.
executable_name
let
conf
=
ref
"true"
let
memlimit
=
ref
3000
let
interpreter
=
ref
false
let
get_steps
=
ref
false
let
max_steps
=
ref
0
let
exec_cmd
=
ref
""
let
goal
=
ref
"
solve('smt_colibri.in')
"
let
goal
=
ref
""
let
path_sep
=
if
Sys
.
win32
then
";"
else
":"
...
...
@@ -40,51 +42,77 @@ let argspec =
acceptable values are (z3, z3-debug \
-- prints z3 inputs outputs to \
/tmp/{input,output}.smt2)"
;
"--get-steps"
,
Arg
.
Set
get_steps
,
" output the number of steps at the end"
;
"--max-steps"
,
Arg
.
Set_int
max_steps
,
" limit the number of steps"
;
"--interpreter-mode"
,
Arg
.
Set
interpreter
,
"run the prolog interactive interpreter"
;
" run the prolog interactive interpreter"
;
"--exec"
,
Arg
.
Set_string
exec_cmd
,
" exec a command in interpreter mode"
]
let
()
=
Arg
.
parse
(
Arg
.
align
argspec
)
(
fun
s
->
goal
:=
Printf
.
sprintf
"smt_solve('%s')"
s
)
(
fun
s
->
goal
:=
s
)
"colibri <file>"
let
()
=
if
!
goal
=
""
then
begin
print_endline
"No input file given."
;
exit
1
end
let
eclipsedir
=
Filename
.
concat
coldir
"ECLIPSE"
let
eclipselib
=
Filename
.
concat
eclipsedir
"lib"
let
colibridir
=
Filename
.
concat
coldir
"COLIBRI"
let
arch
=
if
Sys
.
win32
then
"x86_64_nt"
else
"x86_64_linux"
let
()
=
Unix
.
putenv
"ECLIPSEDIR"
eclipsedir
let
()
=
Unix
.
putenv
"FILTER_SMTLIB_FILE"
(
Filename
.
concat
colibridir
"filter_smtlib_file"
)
let
()
=
Unix
.
putenv
"ARCH"
"x86_64"
let
()
=
Unix
.
putenv
"ARCH"
arch
let
extend_env
var
value
=
match
Unix
.
getenv
var
with
|
exception
Not_found
->
Unix
.
putenv
var
value
|
s
->
Unix
.
putenv
var
(
value
^
path_sep
^
s
)
let
eclipseexe
=
if
Sys
.
win32
then
Filename
.
concat
eclipselib
"x86_64_nt"
else
Filename
.
concat
eclipselib
"x86_64_linux"
let
eclipseexe
=
Filename
.
concat
eclipselib
arch
let
()
=
if
Sys
.
win32
then
extend_env
"PATH"
eclipseexe
then
begin
extend_env
"PATH"
eclipseexe
;
extend_env
"PATH"
colibridir
;
extend_env
"PATH"
(
List
.
fold_left
Filename
.
concat
colibridir
[
"lib"
;
"v7"
;
arch
])
end
else
extend_env
"LD_LIBRARY_PATH"
eclipseexe
let
quote_for_prolog
f
=
let
s
=
Printf
.
sprintf
"%S"
f
in
Printf
.
sprintf
"'%s'"
(
String
.
sub
s
1
(
String
.
length
s
-
2
))
let
()
=
let
exe
=
Filename
.
concat
eclipseexe
"eclipse.exe"
in
Unix
.
execv
exe
(
Array
.
append
[
|
exe
;
"-b"
;
Filename
.
concat
colibridir
"compile_flag"
;
"-b"
;
Filename
.
concat
colibridir
"col_solve"
;
"-g"
;
Printf
.
sprintf
"%iM"
!
memlimit
;
|
]
(
if
!
interpreter
then
[
|
|
]
else
[
|
"-e"
;
Printf
.
sprintf
"seed(0),%s,%s"
!
conf
!
goal
|
])
(
Array
.
concat
[
[
|
exe
;
"-b"
;
Filename
.
concat
colibridir
"compile_flag"
;
"-b"
;
Filename
.
concat
colibridir
"col_solve"
;
"-g"
;
Printf
.
sprintf
"%iM"
!
memlimit
;
|
];
(
if
!
exec_cmd
=
""
then
[
|
|
]
else
[
|
"-e"
;
!
exec_cmd
|
])
;
(
if
!
interpreter
then
[
|
|
]
else
[
|
"-e"
;
Printf
.
sprintf
"seed(0),%s,smt_solve%s(%s)"
!
conf
(
if
!
get_steps
then
"_stats"
else
""
)
(
quote_for_prolog
!
goal
)
|
])
]
)
This diff is collapsed.
Click to expand it.
compile_colibri.bat
0 → 100644
+
10
−
0
View file @
f1b7e237
@echo
off
set
COLDIR
=
%~dp0
set
ECLIPSEDIR
=
%~dpnx1
set
PATH
=
%COLDIR%
Src
\COLIBRI
;
%COLDIR%
Src
\COLIBRI\lib\v7\x86_64_nt
;
%PATH%
cd
Src
\COLIBRI
@echo
on
"
%ECLIPSEDIR%
\lib\x86_64_nt\eclipse.exe"
-g
3000
M
-b
col_solve_dumpeco
.pl
-e
halt
This diff is collapsed.
Click to expand it.
compile_colibri.sh
+
1
−
1
View file @
f1b7e237
...
...
@@ -2,7 +2,7 @@
ARCH
=
"x86_64_linux"
ECLIPSEDIR
=
$(
pwd
)
/Bin/ECLIPSE_V7.0_45
LD_LIBRARY_PATH
=
"
$ECLIPSEDIR
/lib/
$ARCH
"
LD_LIBRARY_PATH
=
"
$ECLIPSEDIR
/lib/
$ARCH
:
$LD_LIBRARY_PATH
"
export
ARCH ECLIPSEDIR LD_LIBRARY_PATH
...
...
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