41 Commits

Author SHA1 Message Date
MARCHE Claude
715fa89d16 separate transformations for intros, dequant, and remove_unused
remove unused before reflection transformation

avoid subst to a unused symbol
2023-04-25 12:20:08 +00:00
Jacques-Henri Jourdan
8eac3e8ba1 eliminate_epsilon before eliminate_algebraic, because eliminate_epsilon needs original true/false symbols.
eliminate_if also needs to be moved, because it produces epsilon terms.
2023-01-31 01:37:24 +01:00
Quentin Garchery
5d7a985ad9 hybrid eliminate_if
we continue to use the duplicating version of eliminate_if_term for
atomic formulas but we replace if-then-else with epsilon in Tlet and Tcase
2019-01-17 14:09:53 +01:00
Guillaume Melquiond
d754ddee29 Merge branch 'master' into new_system 2017-10-03 17:49:58 +02:00
Claude Marche
a6d8902312 updated drivers with eliminate_literal 2017-09-28 11:29:30 +02:00
Andrei Paskevich
6b28b63528 cosmetic changes in drivers
also, remove the "material_type_arg" meta for (->), hardcoded now
in Eliminate_algebraic
2016-03-08 17:03:35 +01:00
Andrei Paskevich
9fa6da6d2f do not put spaces around colon in metas and labels 2016-03-08 16:48:59 +01:00
Andrei Paskevich
cb9aa0a2b5 adapt the standard library
except for modules/impset.mlw (because of Fset) and modules/mach/*
(because of program cloning), the standard library now typechecks.

This is still very much the work in progress. Many functions and
predicates have still to be converted to "let function" and
"let predicate". Here are some TODOs:
- do not require the return type for "val predicate", "val lemma", etc.
- do not require explicit variant for "let rec" if the code passes
  the termination check in Decl (see list.why)
- what should become "val ghost function" and what should stay just
  "function" (see array.mlw, matrix.mlw, string.mlw, etc)?
- some defined functions in algebra.why and relations.why had to be
  removed, so that they can be implemented with "let function" in
  int.mlw (since they are defined, they cannot be instantiated with
  let-functions). This seems too restrictive. One way out would be
  to authorise instantiation of defined functions (with a VC).
- should we keep the keyword "model"? reuse of "abstract" in types
  breaks syntax coloring ("abstract" requires closing "end" in
  programs but not in types; maybe we can drop that "end" again?).
2015-08-20 13:25:30 +02:00
Andrei Paskevich
9c20cd7ce2 "eliminate_epsilon" added in drivers
Currently, the builtin theory why3.HighOrd (or just HighOrd) must
be explicitly "use"-d. However, the type (HighOrd.func 'a 'b) can
be written ('a -> 'b), and the type (HighOrd.pred 'a) can be written
('a -> bool), and the application operation (HighOrd.(@)) can be
written as the usual juxtaposition. Thus, normally, you do not have
to write the qualifiers. The builtin theory why3.Bool (or just Bool)
is needed for "bool". The names "HighOrd", "func", "pred", and "(@)"
are not yet fixed and may change.

"eliminate_epsilon" tries to be smart when a lambda (or some other
comprehension form) occurs under equality or at the top of a definition.
We could go even further and replace (\ x . t) s with t[x <- s], without
lifting the lambda. I'm not sure it's worth it: we rarely write redexes
manually. They can and will appear through inlining, though.

Anyone who wants to construct epsilon-terms directly using the API
should remember that these are not Hilbert's epsilons: by writing
an epsilon term, you postulate the existence (though not necessarily
uniqueness) of the described object, and "eliminate_epsilon" will
happily convert it to an axiom expressing this existence. We only
use epsilons to write comprehensions whose soundness is guaranteed
by a background theory, e.g. lambda-calculus.
2014-01-20 22:49:10 +01:00
Andrei Paskevich
8515d7d1b4 minor corrections in drivers 2013-11-03 17:48:19 +01:00
Andrei Paskevich
9640fb2b59 implement printers as memoizing transformations
also, avoid the "encoding_sort" transformation, if it can be done
directly in the printer.

On the same example as in the previous commits, this gives 5x
acceleration together with some memory usage reduction.
2013-11-02 20:56:21 +01:00
Andrei Paskevich
036c6ce5b8 change default polymorphism encoding methods
in a series of tests on available examples, lightweight polymorphism
encoding techniques combined with a more agressive generation of
monomorphic instances (via Discriminate) show better results than
our earlier defaults.

In the same commit:
- remove Encoding_explicit (unsound), Encoding_decoexp (too naive),
  and Encoding_instantiate (subsumed by Discriminate)
- rename Encoding_decorate to Encoding_tags_full and Encoding_guard
  to Encoding_guards_full
- move Encoding_guards_full specific functions from Libencoding to
  Encoding_guards_full
- do not apply type protection in "encoding_tptp" and remove
  Protect_finite which is not needed anymore.
2013-08-06 17:25:04 +02:00
Andrei Paskevich
a60867e2fb remove "simplify_recursive_definition", never used 2013-08-06 13:43:12 +02:00
Guillaume Melquiond
726b3f5bc0 Fix units and inverses so that they are both left and right for nonabelian groups.
Add monoids to the algebraic hierarchy.
2012-09-01 13:00:22 +02:00
Claude Marché
ffe1235d18 no 'Unknown: Unknown' prover result anymore 2012-06-20 06:48:26 +02:00
Claude Marché
45b4742974 Fixed bug 13002 2012-03-31 18:09:06 +02:00
Andrei Paskevich
8bc86e68c8 eliminate_algebraic can keep enums and records 2012-03-17 16:51:33 +01:00
Andrei Paskevich
6ecf1ff21f in ordered rings, 0 <= 1 2011-12-14 15:12:58 +01:00
Andrei Paskevich
99b99b0a3a replace "logic" with "function" and "predicate" in drivers 2011-06-29 19:44:40 +02:00
Andrei Paskevich
cbf0cede80 get rid of user-supplied ty_base
What was its purpose in the first place? Integers are protected
in Simplify anyway and then we can simply forget the difference
between the infinite sorts (as we do in encoding_tptp).
2011-06-05 14:19:14 +02:00
Andrei Paskevich
35c0d32eab separate symbol discrimination from polymorphism encoding 2011-06-03 22:21:40 +02:00
François Bobot
5ccab507eb add a test for booleans 2011-04-21 19:36:32 +02:00
Andrei Paskevich
ed4f9a61f3 Elim_algebraic: generate indexing function only for SMT provers 2011-03-16 19:31:06 +01:00
François Bobot
e859e9ed50 explicit forbidden with enumeration :
TPTP/simplify : explicit not anymore the default
2011-02-15 14:49:01 +01:00
François Bobot
54cd6e4850 driver : comment simplify trivial quantification which can grow monstruously the size of th goal 2011-01-21 15:13:28 +01:00