Importing inference rules from LaTeX to aslspec#1703
Merged
Roman-Manevich merged 12 commits intomasterfrom Mar 2, 2026
Merged
Conversation
a048f64 to
23f51c9
Compare
02f9536 to
202394a
Compare
202394a to
943e3d1
Compare
0b17d34 to
e8be879
Compare
2b41323 to
4008847
Compare
e8be879 to
4ae8ec3
Compare
5bc80fe to
151cc2a
Compare
4ae8ec3 to
cad3814
Compare
…r to catch such errors in the future
…in check and map_apply
cad3814 to
5dbd029
Compare
… a special symbol to test whether elements belong to the domain of functions
HadrienRenaud
approved these changes
Feb 26, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The main contribution of this PR is the replacement of inference rules for typing/dynamic semantics relations by auto-generated rules, which are defined in
asl.spec.Other minor changes:
\choicemacro with\ifthenelseop.% DO NOT LINT% comments fromASLMacros.tex`, which are not needed due to improved linting ([asl][reference] more precise linting #1702).doclint.pynow accpets 4 warnings (there's a new one that shows up for the microtype package).The translation from LaTeX to aslspec was aided by an AI assistant trained by examples and guidance.
Here are some of the bugs that were found and fixed.
Bugfixes in rules:
annotate_local_decl_type_annot: inannotate_local_decl_type_annot, the argumente'was missing side effects.annotate_type:ty'in premise should betys'named_lowest_common_ancestor: inFOUNDcase the result should wrapped in aSomebuild_dependencies:def_enum_labelsreturns a set, not a list.decl_dependencies: the output is a list, not a set.declare_subprograms:declare_one_funcinvoked without side-effects components.use_decl:typed_identifier/parameter pairs are tuples; uselist_combineto access types.use_lexpr:LE_Varreturns an element, not a set.use_stmt:index_nameinstead ofOther(index_name)static_env_to_env: the rule hasn't updatedpending_callsand did not store the storage in thestoragefieldfilter_call_candidates: the function doesn't need a short-circuit expression as it never errors.filter_call_candidates:candidatesis a set, not a list.insert_stdlib_param: missingtenvargumentsubprogram_for_signature:G.overloaded_subprogramsdoes returns names but no side-effects.subprogram_for_signature: need to correctly retrieve side effects for the found candidate.subst_expr:E_Calldoes not have three components but rather one (call).annotate_args: wrong grouping of expressions forannotate_argspremiseannotate_func_sig: signature was missing side-effects in the output type.annotate_func_sig: include recursion-limit side effects inses_with_params.annotate_one_arg:annotate_typemissing first argument.annotate_one_param: signature misses side-effects in outputannotate_params: signature misses side-effects in outputannotate_return_type: return type argument is not a type but rather an optionalty.annotate_return_type:annotate_typerequires an extra firstBooleanargument.check_param_decls: attempt to return undefined variablebdeclare_one_func: LaTeX ordersadd_new_funcargs as (tenv,qualifier,name,args,type); use the spec signature.paramsofty:WellConstraineddoesn't have aBooleancomponent.subprogram_clash:subprogram_clashneeds to be an optional.compare_monomial_bindings: inputs are not monomials but rather unitary monomials.expr_equal_case:E_Callwas missing comparison of parameters.reduce_constraint: missing short-circuits for type errorstype_equal: inTArraycase we need to applyarray_length_equalto the array indices, notexpr_equaltype_of:loca_storage_typesreturns a pair, not just a type.unitary_monomials_to_expr: Inexp_gt_two, we need> 2, not>= 2, to avoid overlap with previous cases.approx_expr:BINOP_PRECISEcase was missingintset_to_constraints.annotate_extra_fields: third output component had wrong type.annotate_extra_fields: wrongly sharing variable names.declare_type:declare_enum_labelsreturns a type environment, not a global static environment.eval_lexpr: in caseLESetArray"include the RHS graphgwhen updating the array."eval_lexpr: inLESetFieldsthe first transition is all wrong, e.g., refers torm_record_new, which is undefined.find_catcher: use ofsubtypesisn't correct - it's not a function but rather a field in the static environment.eval_expr: inEGetTupleItem, the order of tuple value and index forget_indexis reversed.is_val_of_type: should be applied to typedWellConstrainednot the untyped variant.eval_pattern: LaTeX usesevalexprsefon a pattern; should useeval_pattern.declare_local_identifier_mm: LaTeX drops {x} in thedeclare_local_identifier_mpremise.decr_pending_calls: the dynamic environment is a record, not a pair.get_index:vecis a native vector, not a list, so|vec|can't be applied directly.max_pos_of_slice:sandlare not integers but rather native values, so we can't directly compare to 0 and perform arithmetic.set_pending_calls: the output type should have beenglobal_dynamic_envs, notdynamic_envseval_spec: signature was missing diverging configurationseval_for_loop: missing short-circuits foreval_for_stepeval_loop: relation signature was missingTDivergingeval_call: include the subprogram execution graph in each return value's graph.eval_call: in the throwing case: keep parameter evaluation order consistent with the normal case.eval_subprogram:tenv.G.subprogramsalso returns side effects.read_value_from: LaTeX swaps the order of arguments toread_identifier.Other bug fixes:
Pattern_Notshould contain a pattern, not an expression.