inc META-FULL-MAUDE-SIGN .
op HETS-GRAMMAR : -> FModule [memo] .
eq HETS-GRAMMAR = addImports((including 'HETS-SIGNATURE .), GRAMMAR) .
fmod HETS-COMMAND-PROCESSING is
mod HETS-DATABASE-HANDLING is
pr HETS-COMMAND-PROCESSING .
subsort HetsDatabaseClass < DatabaseClass .
op HetsDatabase : -> HetsDatabaseClass [ctor] .
*** Initial values of the attributes (except input and output)
op init-state : -> AttributeSet .
eq init-state = db : initialDatabase, default : 'CONVERSION .
vars T T' T1 T2 T3 T4 : Term .
var X@DatabaseClass : DatabaseClass .
var ME : ModuleExpression .
var AttS : AttributeSet .
< O : X@DatabaseClass | db : DB, input : (F[T, T']), output : nil,
=> < O : X@DatabaseClass | db : DB', input : nilTermList,
output : haskellify(M), default : H, AttS >
if (F == 'fmod+_is_endfm) or-else
(F == 'mod+_is_endm) or-else
(F == 'fth+_is_endfth) or-else
(F == 'th+_is_endth) or-else
(F == 'omod+_is_endom) /\
DB' := procModule(coreMaudeOp(F)[T, T'], DB) /\
M := getTopModule(H, DB') .
< O : X@DatabaseClass | db : DB, input : ('view+_from_to_is_endv[T1, T2, T3, T4]),
=> < O : X@DatabaseClass | db : DB', input : nilTermList,
output : haskellify(V), AttS >
if DB' := procView('view_from_to_is_endv[T1, T2, T3, T4], DB) /\
op coreMaudeOp : Qid ~> Qid .
eq coreMaudeOp('fmod+_is_endfm) = 'fmod_is_endfm .
eq coreMaudeOp('mod+_is_endm) = 'mod_is_endm .
eq coreMaudeOp('fth+_is_endfth) = 'fth_is_endfth .
eq coreMaudeOp('th+_is_endth) = 'th_is_endth .
eq coreMaudeOp('omod+_is_endom) = 'omod_is_endom .
< O : X@DatabaseClass | db : DB, input : ('hets_.[T]), output : nil, AttS >
=> < O : X@DatabaseClass | db : DB', input : nilTermList,
output : haskellify(M), AttS >
if < DB' ; ME > := evalModExp(parseModExp(T), DB) /\
M := getTopModule(ME, DB') .
inc HETS-DATABASE-HANDLING .
vars QIL QIL' QIL'' : QidList .
var AttS : AttributeSet .
vars RP RP' : ResultPair .
var HDC : HetsDatabaseClass .
var X@Database : DatabaseClass .
op init-hets : -> System .
=> [nil, < o : HetsDatabase | input : nilTermList, output : nil, init-state >, nil] .
-----------------------------------------------------------------------------------------
---------------------------------------- IN ---------------------------------------------
-----------------------------------------------------------------------------------------
eq ['fmod QIL, S:State, QIL'] = ['fmod+ QIL, S:State, QIL'] .
eq ['mod QIL, S:State, QIL'] = ['mod+ QIL, S:State, QIL'] .
eq ['fth QIL, S:State, QIL'] = ['fth+ QIL, S:State, QIL'] .
eq ['th QIL, S:State, QIL'] = ['th+ QIL, S:State, QIL'] .
eq ['view QIL, S:State, QIL'] = ['view+ QIL, S:State, QIL'] .
[QIL, < O : X@Database | input : nilTermList, AttS >, QIL']
=> [nil, < O : X@Database | input : getTerm(RP), AttS >, QIL']
RP := metaParse(HETS-GRAMMAR, QIL, '@Input@) .
[QIL, < O : X@Database | output : nil, AttS >, QIL']
< O : X@Database | output : ('\r 'Warning:
printSyntaxError(metaParse(HETS-GRAMMAR, QIL, '@Input@), QIL)
'\r 'Error: '\o 'No 'parse 'for 'input. '\n), AttS >,
noParse(N) := metaParse(HETS-GRAMMAR, QIL, '@Input@) .
[QIL, < O : X@Database | output : nil, AttS >, QIL']
< O : X@Database | output : ('\r 'Error: '\o 'Ambiguous 'input. '\n), AttS >,
ambiguity(RP, RP') := metaParse(HETS-GRAMMAR, QIL, '@Input@) .
[QIL, < O : X@Database | output : (QI QIL'), AttS >, QIL'']
=> [QIL, < O : X@Database | output : nil, AttS >, (QIL'' QI QIL')] .
print conceal mod_is_sorts_._____endm .
print conceal fmod_is_sorts_.____endfm .
subsort Foo1 < Foo2 Foo3 < Foo4{X} .
op c : Foo1 Foo1 -> Foo1 [assoc comm] .
*** (fmod A{X :: TRIV} is pr NAT . endfm)