source: src/ResolvExpr/Unify.h @ ab9c1b3

Last change on this file since ab9c1b3 was 2908f08, checked in by Andrew Beach <ajbeach@…>, 12 months ago

Most of ResolvExpr? was written before the new style standard. Some files updated, focus on headers.

  • Property mode set to 100644
File size: 2.1 KB
Line 
1//
2// Cforall Version 1.0.0 Copyright (C) 2015 University of Waterloo
3//
4// The contents of this file are covered under the licence agreement in the
5// file "LICENCE" distributed with Cforall.
6//
7// Unify.h --
8//
9// Author           : Richard C. Bilson
10// Created On       : Sun May 17 13:09:04 2015
11// Last Modified By : Andrew Beach
12// Last Modified On : Tue Jan 17 11:12:00 2023
13// Update Count     : 5
14//
15
16#pragma once
17
18#include "AST/Node.hpp"             // for ptr
19#include "AST/TypeEnvironment.hpp"  // for TypeEnvironment, AssertionSet, OpenVarSet
20#include "WidenMode.h"              // for WidenMode
21
22namespace ast {
23        class SymbolTable;
24        class Type;
25}
26
27namespace ResolvExpr {
28
29bool unify(
30        const ast::ptr<ast::Type> & type1, const ast::ptr<ast::Type> & type2,
31        ast::TypeEnvironment & env, ast::AssertionSet & need, ast::AssertionSet & have,
32        ast::OpenVarSet & open );
33
34bool unify(
35        const ast::ptr<ast::Type> & type1, const ast::ptr<ast::Type> & type2,
36        ast::TypeEnvironment & env, ast::AssertionSet & need, ast::AssertionSet & have,
37        ast::OpenVarSet & open, ast::ptr<ast::Type> & common );
38
39bool unifyExact(
40        const ast::Type * type1, const ast::Type * type2, ast::TypeEnvironment & env,
41        ast::AssertionSet & need, ast::AssertionSet & have, const ast::OpenVarSet & open,
42        WidenMode widen );
43
44bool unifyInexact(
45        const ast::ptr<ast::Type> & type1, const ast::ptr<ast::Type> & type2,
46        ast::TypeEnvironment & env, ast::AssertionSet & need, ast::AssertionSet & have,
47        const ast::OpenVarSet & open, WidenMode widen,
48        ast::ptr<ast::Type> & common );
49
50bool typesCompatible(
51        const ast::Type *, const ast::Type *,
52        const ast::TypeEnvironment & env = {} );
53
54bool typesCompatibleIgnoreQualifiers(
55        const ast::Type *, const ast::Type *,
56        const ast::TypeEnvironment & env = {} );
57
58/// Creates or extracts the type represented by returns in a `FunctionType`.
59ast::ptr<ast::Type> extractResultType( const ast::FunctionType * func );
60
61std::vector<ast::ptr<ast::Type>> flattenList(
62        const std::vector<ast::ptr<ast::Type>> & src, ast::TypeEnvironment & env
63);
64
65} // namespace ResolvExpr
66
67// Local Variables: //
68// tab-width: 4 //
69// mode: c++ //
70// compile-command: "make install" //
71// End: //
Note: See TracBrowser for help on using the repository browser.