NG decompilation is now activated. However, it is called from the old
decompilation that cannot detect when a NG-only file A is used by another
NG-only file B. As a consequence, decompiling A does not decompile B too.
Good:
1) all set_* methods are now polymorphic
2) no more :> coercions
3) no more technical class types
Bad:
1) some polymorphic set_* methods have explicit row types that are
problematic when extending another class in another file. The
row types should just be #classname, but ocaml rejects them that
way.
Enrico Tassi [Thu, 18 Jun 2009 14:46:17 +0000 (14:46 +0000)]
callbacks were taking in input a status bu were not using them.
thanks to the new #type for statuses this was a problem, and Obj.magic
was required to fix them. Removed both the dummy parameter and the
unsafe cast
Stricter type: the type now shows that disambiguation only alter the lexicon.
In this way we are forced to manually set the content of the object in place of
setting the whole object, that leads to information loss since in the meanwhile
new commands may have altered the rest of the state.
Initial implementation of statuses using objects in place of nested records.
So nicer!
The only major problem is that the NCicLibrary functor does not return a
function #status as 'status -> 'status, but a function status -> status.
Thus I have to painfully wrap NCicLibrary.Realizer(...).require in NRstatus.
TO REMEMBER:
- every function that works on a data type that used to be put in the status
(e.g. a db) must now work on a functional class with just two members
(db and set_db). Moreover, every function in the module must work on the
open variants of the class type, i.e. #status
1) unification hint now takes NG terms (as it should have been from the very
beginning)
2) refresh_uris_in_term is now passed to the constructor of the
existential/universal data type in NCicLibrary
3) URIs are now refreshed in unification hint data
1) NCicLibrary (which is untrusted) moved after NCicUntrusted.
NCicLibrary registers get_obj to NCicEnvironemnt (and to NCicPp)
2) URIs are now refreshed when objects are included from disk
Observation: even NCicPp is untrusted. Thus its implementation should be put
at the end and some references set to one early module. Which one? Two
choices: NCic or NCicPp (two modules, one with the implementation follows).
Could the same be done for NCicLibrary too in order to bring back the explicit
dependency of NCicEnvironment over NCicLibrary? [ In that case, remember to
change back the exception caught by GrafiteDisambiguate ]
Instead of serializing closures (of type status -> status), we now
serialize data. This is achieved by implementing an existential type
NCicLibrary.Serializer(struct type status end).obj
whose semantics is "\exists 'a. 'a -> status -> status"
and by putting in the dump a list of these existential types.
The current implementation is the type-unsafe one based internally on Obj.magic.
However, the interface is (should be?) type-safe.
Other type-safe implementations could be derived by the ocaml m.l. thread on
existential types. In particular, I remember implementations via:
- references
- functors
- exceptions
- impredicative encoding via polymorphic methods
This fix allow to change the Matita code without invalidating the library.
(Critical) things still to be done:
- decompilation
- refreshment of URIs
Enrico Tassi [Mon, 15 Jun 2009 16:22:18 +0000 (16:22 +0000)]
EXPERIMENTAL COMMIT (by CSC,actuall :-)
This commit partially implements (in NCicLibrary) serialization for NG.
It creates several .matita/matita/.../foo.ng files that are ocaml dumps
of closures (NRstatus.refiner_status -> NRstatus.refiner_status) to be applied
to the current status.
The test tests/ng_includeB.ma shows how unification hints are preserved.
TODO:
a) decompilation is implemented in NCicLibrary, but not called anywhere
b) serialization of objects (and "query" db (and old to new cache??)) not
implemented yet
c) objects are removed from the library, but not from the environment!
Enrico Tassi [Mon, 15 Jun 2009 11:04:24 +0000 (11:04 +0000)]
huge commit regarding the grafite_status:
- in the ng_status component it embeds the lexicon status
- the lexicon status is not passed around alone anymore
- coercions/hints for the ng system are no longer imperative
(are in the e (for external) status of the tac_status
- ng_refiner does not take in input a look_for_coercions function
but an aggregate type "rdb" comprising hints and coercions
(and empty one is passed to disable hints/coercions)
functionalities losses:
- old (generated) hint are no longer translated on the fly
- old coercions are translated in a best effort way
(no universes calculation)
Enrico Tassi [Mon, 15 Jun 2009 09:36:46 +0000 (09:36 +0000)]
tacticals are really tactics now, they have an AST at the same level of
tactics. Parser/engine fixed accordingly. This allowed a better TPTP
exportation
denes [Thu, 11 Jun 2009 22:52:38 +0000 (22:52 +0000)]
Active goals are now demodulated after selecting a positive clause.
Implemented OrderedSet for passive clauses.
Selection is now based on weight (fairness condition to be added).
Ferruccio Guidi [Thu, 11 Jun 2009 12:59:35 +0000 (12:59 +0000)]
- some depend files fixed
- matitacLib: we peform a garbage collection after compiling every file instead of just .mma (let's see the times)
- transcript: support for "cr" inline param completed
- procedural: now record are supported
the records of logic/cprop_coonectives.ma are now reconstructed :)
logic higher_order_defs list nat Z Q are now fully reconstructed :))
Ferruccio Guidi [Wed, 10 Jun 2009 20:19:42 +0000 (20:19 +0000)]
- library/list/list.ma: unused code commented
- proceduralClassify type argument are no longer critical: let's see how it goes
- acic2Procedural: the inline parameter Debug now works
- procedural2: we remove the conversions before first order relexivities (exp. to avoid conversion to []=[] in list/list.ma [does not work because []=[] in an open term since the equality type is unspecified]). so we we strengthen reflexivity (see below)
- setoids: now reflexivity is retried after whd if it fails in the first place.
- grafiteAst: detection of convertible rewrites is now optional and activated with the inline parameter "cr". nat/factorial2 is very slow without rewrites
transcript: we now avoid the generation of dupplicated inlines (mistakely generated by the grafite parser [this can not be avoided without a better syntax for .ma scripts])
now list/list.ma is fully reconstructed :)
nat/factorial2.ma takes long to be produced 22m31. Some conversion is slowing the process. nat/bertrand.ma also: we are waiting for it now :(
Ferruccio Guidi [Tue, 9 Jun 2009 17:22:52 +0000 (17:22 +0000)]
- Procedural: more support for the Debug inline option (does not work yet)
- transcript: now we can process a given subset so the source files
- termContentPres: bugfix in the syntax of letrec, a space was missing :(
now nat/generic_iter_p.ma is fully reconstructed :) (thx Claudio)
Temporary (and partially broken) patch for Ferruccio: I duplicate
\Pi abstractions in let ... rec definitions in order to make the system
infer the same names. However, it could be infer a -> in place of a \forall.
This commit restores the ids_to_father_ids table.
However, after the implementation, I sort of realized that maybe this table
is useless, after all.
Thus I am gonna do my commit and immediately revert it (just to keep the
code in SVN in case of need).
Ferruccio Guidi [Fri, 5 Jun 2009 22:18:01 +0000 (22:18 +0000)]
- Procedural convertible rewrites in the conclusion are now detected and replaced by change
- grafiteAst: semantics of the Include flag changed: now true means normal include, New Inline flags Coercions, Comments (activated) Debug (not yet)
- library: eq_plus_Zplus moved from Z/times to Z/plus
now Z/plus.ma Z/times.ma are fully reconstructed :)
1) the home button of CicBrowser now works also for NG
2) implemented simple (i.e. no natural language) rendering of NG constants.
Inductive types and (co)recursive definitions are still missing.
The kernel _must_ check the correctness of the height since the reduction
machine never tries to reduce terms whose height is 0. Thus, if the
declared height is 0, the height is no longer an optimization!
Ferruccio Guidi [Thu, 4 Jun 2009 18:35:24 +0000 (18:35 +0000)]
- doubleTypeInference: we check for unreferenced letins in the inferred type also after beta-reduction because beta-reduction can cause unreferenced letins
- procedural: bugfix in the use of inner types, the expected type was sometimes used in place of the inferred type; context cleaning is now disabled because the clear tactics are not generated; debugging mode is now activated