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
Ferruccio Guidi [Wed, 3 Jun 2009 20:20:11 +0000 (20:20 +0000)]
- boxPp: added missing spaces
- core_notation: bug fix in the input notation for congruent: we added term 90 after \sub
- library/nat/permutation.ma: added input notation for transpose and fixed term precedence in its output notation
- library/Makefile: compilation of single files re-enabled.
The syntax for compiling file.ma is is "make file.mo" and "make file.mo.opt"
now nat/congruence.ma and nat/permutation.ma are fully reconstructed :)
1) CicNotationPres.render: type changed to make it more general (no
dependency on the Hashtbl) and URI/REFERENCE agnostic.
A compatibility function CicNotationPres.lookup_uri is provided to
easily map the (old) Hashtbl to the (new) lookup function.
2) user interface partially changed to render NG objects in the CicBrowser
and to follow NG hyperlinks
3) New CicNotationPt entries NRef (similar to Uri) and NRefPattern
(similar to UriPattern) to avoid hijacking the old Uris (actually,
uris + xpointers) to also hold new references.
This allows to properly implement notation (for NG) and to properly
handle hyperlinks.
4) all remaining Warnings for unused variables fixed (in some way or
another, hopefully the correct one)
5) GrafiteEngine, NQed: the height of an object is now recomputed just
before putting it in the environment. This fixes all the bugs related
to reduction.
6) GrafiteParser/LexiconEngine: both old URIs and new references are now
allowed in NG terms and in notations
7) ng_cic_content: rendering functions now return an "id |-> reference" table
to correctly implement MathML hrefs
8) NReference: new compare function
9) NCicUntrusted: new height_of_obj_kind function (to be used in GrafiteEngine)
10) OCic2NCic: new reference_of_oxuri function to map old uris + xpointers
into new references
11) bug fixed: after the commit by Enrico that starts using the extensible
PTS, the old-to-new objects translations used to map Type into "Type" which
was not declared. Type is now mapped into Type[0] and Type (as a "notation")
is now a synonim of Type[0] (only during parsing for now)
12) bug fixed: after the commit by Enrico that cleans up terms for
alpha-conversion and dummy products, the test in NCicTypeChecker that
verifies the consistency of left parameters in constructor --- that used
to do that NOT up to alpha-conversion --- used to fail when dummy products
were found. The test is now relaxed to include alpha-conversion.
13) bug fixed: NCicTypeChecker did not verify that a .dec reference pointed to
an axiom and that a .def reference did not point to an axiom. Fixed.
Ferruccio Guidi [Fri, 29 May 2009 14:26:50 +0000 (14:26 +0000)]
- cicNotationParser: added extra space to TeX control sequences accordind to previous commit of cicNotationLexer
- core_notation: bugfix in the notation for exp
- library/nat/congruence.ma: notation for "congruent" moved to core_notation
Ferruccio Guidi [Thu, 28 May 2009 17:17:29 +0000 (17:17 +0000)]
- cicInspect: relevant nodes count updated: letin nodes are not relevant
- Procedural: reflexivity is now supported
- grafiteAst: boolean flag for include to tag inclusion of a source file. This command is relevant for .ma generation only. [ the source file of a .mma is not included in the generated .ma ]
- cicNotationLexer: unexpanded TeX macro symbols are now encoded with an extra space at the end. This is consistent with the concept of TeX sequence and fixes a bug in the renering of these symbols. The space is needed for reparsing!
Ferruccio Guidi [Wed, 27 May 2009 17:16:31 +0000 (17:16 +0000)]
- Procedural: we specify more unifiers for apply to help higher-order unification
- cicNotationPp: bugfix in the notation for Meta and ImplicitPattern
- transcript: grafite lexer/parser updated