Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
why3
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
119
Issues
119
List
Boards
Labels
Service Desk
Milestones
Merge Requests
16
Merge Requests
16
Operations
Operations
Incidents
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Why3
why3
Commits
8c721d48
Commit
8c721d48
authored
May 24, 2011
by
MARCHE Claude
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ML example exposing bug 12244
parent
383157bb
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
87 additions
and
9 deletions
+87
-9
Makefile.in
Makefile.in
+3
-0
examples/bts12244.ml
examples/bts12244.ml
+74
-0
src/ide/session.ml
src/ide/session.ml
+8
-9
tests/test-claude.why
tests/test-claude.why
+2
-0
No files found.
Makefile.in
View file @
8c721d48
...
@@ -933,6 +933,9 @@ test-api: src/why.cma
...
@@ -933,6 +933,9 @@ test-api: src/why.cma
ocaml
$(EXTCMA)
src/why.cma
-I
src examples/use_api.ml
\
ocaml
$(EXTCMA)
src/why.cma
-I
src examples/use_api.ml
\
||
(
printf
"Test of Why API calls failed. Please fix it"
;
exit
2
)
||
(
printf
"Test of Why API calls failed. Please fix it"
;
exit
2
)
bts12244
:
src/why.cma
ocaml
$(EXTCMA)
src/why.cma
-I
src examples/bts12244.ml
## Examples : Plugins ##
## Examples : Plugins ##
...
...
examples/bts12244.ml
0 → 100644
View file @
8c721d48
(**************************************************************************)
(* *)
(* Copyright (C) 2010- *)
(* François Bobot *)
(* Jean-Christophe Filliâtre *)
(* Claude Marché *)
(* Andrei Paskevich *)
(* *)
(* This software is free software; you can redistribute it and/or *)
(* modify it under the terms of the GNU Library General Public *)
(* License version 2.1, with the special exception on linking *)
(* described in file LICENSE. *)
(* *)
(* This software is distributed in the hope that it will be useful, *)
(* but WITHOUT ANY WARRANTY; without even the implied warranty of *)
(* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. *)
(* *)
(**************************************************************************)
(*******************
This file exposes bug 12244 directly using the API
******************)
open
Why
open
Format
(* reads the config file *)
let
config
:
Whyconf
.
config
=
Whyconf
.
read_config
None
(* the [main] section of the config file *)
let
main
:
Whyconf
.
main
=
Whyconf
.
get_main
config
(* builds the environment from the [loadpath] *)
let
env
:
Env
.
env
=
Lexer
.
create_env
(
Whyconf
.
loadpath
main
)
let
int_theory
:
Theory
.
theory
=
Env
.
find_theory
env
[
"int"
]
"Int"
(*
An arithmetic goal: 1 = 2
*)
let
one
:
Term
.
term
=
Term
.
t_const
(
Term
.
ConstInt
"1"
)
let
two
:
Term
.
term
=
Term
.
t_const
(
Term
.
ConstInt
"2"
)
let
fmla
:
Term
.
term
=
Term
.
t_equ
one
two
let
task
=
Task
.
use_export
None
int_theory
let
goal_id
=
Decl
.
create_prsymbol
(
Ident
.
id_fresh
"G"
)
let
task
=
Task
.
add_prop_decl
task
Decl
.
Pgoal
goal_id
fmla
(*
let () = printf "@[task:@\n%a@]@." Pretty.print_task task
*)
let
inline
=
Trans
.
lookup_transform
"inline_goal"
env
let
split
=
Trans
.
lookup_transform_l
"split_goal"
env
let
task_inline
=
Trans
.
apply
inline
task
let
()
=
printf
"@[task == task_inline ? %b@]@."
(
task
==
task_inline
)
let
task_split
=
match
Trans
.
apply
split
task
with
|
[
t
]
->
t
|
_
->
assert
false
let
()
=
printf
"@[task == task_split ? %b@]@."
(
task
==
task_split
)
src/ide/session.ml
View file @
8c721d48
...
@@ -1486,16 +1486,15 @@ let transformation_on_goal g tr =
...
@@ -1486,16 +1486,15 @@ let transformation_on_goal g tr =
let
b
=
let
b
=
match
subgoals
with
match
subgoals
with
|
[
task
]
->
|
[
task
]
->
let
s1
=
task_checksum
(
get_task
g
)
in
(* let s1 = task_checksum (get_task g) in *)
let
s2
=
task_checksum
task
in
(* let s2 = task_checksum task in *)
(*
(*
(\* *)
eprintf "Transformation returned only one task. sum before = %s, sum after = %s@." (task_checksum g.task) (task_checksum task);
(* eprintf "Transformation returned only one task. sum before = %s, sum after = %s@." (task_checksum g.task) (task_checksum task); *)
eprintf "addresses: %x %x@." (Obj.magic g.task) (Obj.magic task);
(* eprintf "addresses: %x %x@." (Obj.magic g.task) (Obj.magic task); *)
*)
(* *\)
*)
s1
<>
s2
(* s1 <> s2 *)
(*
task
!=
(
get_task
g
)
task
!=
(
get_task
g
)
*)
|
_
->
true
|
_
->
true
in
in
if
b
then
if
b
then
...
...
tests/test-claude.why
View file @
8c721d48
...
@@ -159,6 +159,8 @@ theory TestInline
...
@@ -159,6 +159,8 @@ theory TestInline
use import int.Int
use import int.Int
goal T : 1 = 2
logic p (x:int) (y:int) = x <= 3 and y <= 7
logic p (x:int) (y:int) = x <= 3 and y <= 7
goal G : p 4 4
goal G : p 4 4
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment