Commit aa11df94 authored by Andrei Paskevich's avatar Andrei Paskevich

change the syntax of transformations in driver files

parent 7defebc9
......@@ -12,29 +12,22 @@ unknown "I don't know" "Unknown"
fail "typing error:\\(.*\\)$" "Failure : File generation error : \\1"
(* À discuter *)
transformations
"simplify_recursive_definition"
"compile_match"
"eliminate_definition"
"eliminate_algebraic"
"eliminate_let"
"inline_trivial"
(* "split_goal_pos_neg_goal"*)
(*"split_goal_pos_neg_all"*)
end
transformation "simplify_recursive_definition"
transformation "compile_match"
transformation "eliminate_definition"
transformation "eliminate_algebraic"
transformation "eliminate_let"
transformation "inline_trivial"
(* transformation "split_goal_pos_neg_goal" *)
(* transformation "split_goal_pos_neg_all" *)
theory BuiltIn
syntax type int "int"
syntax type real "real"
syntax logic (_=_) "(%1 = %2)"
syntax logic (_<>_) "(%1 <> %2)"
end
theory int.Int
prelude "(* this is a prelude for Alt-Ergo integer arithmetic *)"
......
......@@ -10,26 +10,19 @@ valid "unsat"
unknown "\\bunknown\\b\\|\\bsat\\b" "Unknown"
(* À discuter *)
transformations
"simplify_recursive_definition"
(*"split_goal_pos_neg_goal"*) "split_goal_pos_neg_all"
"inline_trivial"
"remove_logic_definition"
"encoding_decorate"
end
transformation "simplify_recursive_definition"
transformation (*"split_goal_pos_neg_goal"*) "split_goal_pos_neg_all"
transformation "inline_trivial"
transformation "remove_logic_definition"
transformation "encoding_decorate"
theory BuiltIn
syntax type int "Int"
syntax type real "Real"
syntax logic (_=_) "(= %1 %2)"
syntax logic (_<>_) "(not (= %1 %2))"
end
theory int.Int
prelude ";;; this is a prelude for CVC3, Arithmetic"
......
printer "why3"
filename "%f-%t-%g.why"
transformations
"remove_logic_definition"
"encoding_decorate"
end
transformation "remove_logic_definition"
transformation "encoding_decorate"
theory BuiltIn
syntax type int "int"
......
......@@ -2,10 +2,8 @@ printer "why3"
filename "%f-%t-%g.why"
(* À discuter *)
transformations
"simplify_recursive_definition"
"inline_all"
end
transformation "simplify_recursive_definition"
transformation "inline_all"
theory BuiltIn
syntax type int "int"
......
......@@ -2,9 +2,7 @@ printer "why3"
filename "%f-%t-%g.why"
(* À discuter *)
transformations
"split_goal_pos_neg_all"
end
transformation "split_goal_pos_neg_all"
theory BuiltIn
syntax type int "int"
......
printer "why3"
filename "%f-%t-%g.why"
transformations
"compile_match"
"eliminate_definition"
"eliminate_inductive"
"eliminate_algebraic"
"eliminate_let"
end
transformation "compile_match"
transformation "eliminate_definition"
transformation "eliminate_inductive"
transformation "eliminate_algebraic"
transformation "eliminate_let"
theory BuiltIn
syntax type int "int"
......
......@@ -10,23 +10,18 @@ valid "unsat"
unknown "unknown\\|sat\\|Fail" "Unknown"
(* À discuter *)
transformations
"simplify_recursive_definition"
(*"split_goal_pos_neg_goal"*) "split_goal_pos_neg_all"
"inline_trivial"
"remove_logic_definition"
"encoding_decorate"
end
transformation "simplify_recursive_definition"
transformation (*"split_goal_pos_neg_goal"*) "split_goal_pos_neg_all"
transformation "inline_trivial"
transformation "remove_logic_definition"
transformation "encoding_decorate"
theory BuiltIn
syntax type int "Int"
syntax type real "Real"
syntax logic (_=_) "(= %1 %2)"
syntax logic (_<>_) "(not (= %1 %2))"
end
......
This diff is collapsed.
......@@ -24,17 +24,17 @@ type qualid = loc * string list
type cloned = bool
type trule =
| Rremove of cloned * qualid
| Rremove of cloned * qualid
| Rsyntaxty of qualid * string
| Rsyntaxls of qualid * string
| Rtagty of cloned * qualid * string
| Rtagls of cloned * qualid * string
| Rtagpr of cloned * qualid * string
| Rprelude of loc * string
| Rprelude of string
type theory_rules = {
thr_name : qualid;
thr_rules : trule list;
thr_name : qualid;
thr_rules : (loc * trule) list;
}
type global =
......@@ -51,10 +51,11 @@ type global =
| ExitCodeUnknown of int * string
| ExitCodeFailure of int * string
| Filename of string
| Transforms of (loc * string) list
| Transform of string
| Plugin of (string * string)
type file = {
f_global : (loc * global) list;
f_rules : theory_rules list;
}
......@@ -44,7 +44,7 @@
"type", TYPE;
"prop", PROP;
"filename", FILENAME;
"transformations", TRANSFORMS;
"transformation", TRANSFORM;
"plugin", PLUGIN
]
......
......@@ -33,7 +33,7 @@
%token THEORY END SYNTAX REMOVE TAG PRELUDE PRINTER
%token VALID INVALID TIMEOUT UNKNOWN FAIL
%token UNDERSCORE LEFTPAR RIGHTPAR CLONED DOT EOF
%token LOGIC TYPE PROP FILENAME TRANSFORMS PLUGIN
%token LOGIC TYPE PROP FILENAME TRANSFORM PLUGIN
%type <Driver_ast.file> file
%start file
......@@ -64,16 +64,10 @@ global:
| UNKNOWN INTEGER STRING { ExitCodeUnknown ($2, $3) }
| FAIL INTEGER STRING { ExitCodeFailure ($2, $3) }
| FILENAME STRING { Filename $2 }
| TRANSFORMS list0_string END { Transforms $2 }
| TRANSFORM STRING { Transform $2 }
| PLUGIN STRING STRING { Plugin ($2,$3) }
;
list0_string:
| /* epsilon */ { [] }
| STRING list0_string { (loc_i 1, $1) :: $2 }
;
list0_theory:
| /* epsilon */ { [] }
| theory list0_theory { $1 :: $2 }
......@@ -86,11 +80,11 @@ theory:
list0_trule:
| /* epsilon */ { [] }
| trule list0_trule { $1 :: $2 }
| trule list0_trule { (loc_i 1, $1) :: $2 }
;
trule:
| PRELUDE STRING { Rprelude (loc (),$2) }
| PRELUDE STRING { Rprelude ($2) }
| REMOVE cloned PROP qualid { Rremove ($2, $4) }
| SYNTAX TYPE qualid STRING { Rsyntaxty ($3, $4) }
| SYNTAX LOGIC qualid STRING { Rsyntaxls ($3, $4) }
......@@ -105,21 +99,21 @@ cloned:
;
qualid:
| ident { loc(), [$1] }
| ident DOT qualid { loc(), ($1 :: snd $3) }
| ident { loc (), [$1] }
| ident DOT qualid { loc (), ($1 :: snd $3) }
;
ident:
| IDENT
| IDENT
{ $1 }
| STRING
| STRING
{ $1 }
| LEFTPAR UNDERSCORE OPERATOR UNDERSCORE RIGHTPAR
| LEFTPAR UNDERSCORE OPERATOR UNDERSCORE RIGHTPAR
{ infix $3 }
| LEFTPAR OPERATOR UNDERSCORE RIGHTPAR
| LEFTPAR OPERATOR UNDERSCORE RIGHTPAR
{ prefix $2 }
/*
| LEFTPAR UNDERSCORE lident_op RIGHTPAR
| LEFTPAR UNDERSCORE lident_op RIGHTPAR
{ { id = postfix $3; id_loc = loc () } }
*/
| PRELUDE
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment